برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>javascript6</title> </head> <style> body{ padding: 0; margin: 0; background-color: aqua; } .modal{ display: none; left:0 ; top: 0; width: 100%; height: 100%; position: fixed; background-color: rgba(95, 95, 95, 0.274); text-align: center; } .modal-div{ border-radius: 20px; background-color: white; margin: 50px; padding: 20px; } .modal-div p a{ color: black; } </style> <body> <section style="font-size: 20px;text-align: center;"> this is main page <button onclick="showmodal()">click</button> </section> <div class="modal"> <div style="position: relative;" class="modal-div"> <span style="position: absolute; right: 10px; top: 5px; cursor:pointer;" onclick="closemodal()">X</span> <h3>Title</h3> <p>hellow.welcome to <a href="http://amirhn.ir" >amirhn.ir</a></p> </div> </div> <script> let showmodal =()=>{ document.querySelector(".modal").style.display="block" } let closemodal=()=>{ document.querySelector(".modal").style.display="none" } </script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> body{ padding: 5px; height: 5000px; } div{ position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50% ); z-index: 1000; width: 95%; height: 95vh; visibility: hidden; border-radius: 20px; background-color: #898989; opacity: 0; transition: opacity 0.5s; } #times{ position:absolute; top: 0; right: 0; content: "\00D7"; color: #a30202; background: rgba(181, 181, 181, 0.97); height: 40px; width: 40px; margin: 5px; border-radius: 10px; border-top-right-radius: 20px; font-size: 30px; font-weight: bolder; display: flex; align-items: center; justify-content: center; cursor: pointer; } </style> </head> <body> <button onclick="openBox()">open</button> <div> <span id="times" onclick="closeBox()">×</span> </div> <script> let div= document.querySelector("div") function openBox(){ div.style.visibility="visible" div.style.opacity = "1"; } function closeBox(){ div.style.opacity = "0"; setTimeout(() => { div.style.visibility="hidden" }, 500); } </script> </body> </html>
<!DOCTYPE html> <html lang="fa"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>باکس تمام صفحه</title> <link rel="stylesheet" href="styles.css"> </head> <body> <button id="openBox">باز کردن باکس</button> <div id="fullscreenBox" class="hidden"> <button id="closeBox" class="close-button">X</button> <h1>این یک باکس تمام صفحه است!</h1> </div> <script src="script.js"></script> </body> </html> CSS (styles.css) css body { font-family: Arial, sans-serif; margin: 0; padding: 0; } button { padding: 10px 20px; font-size: 16px; cursor: pointer; } #fullscreenBox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); color: white; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity 0.5s ease; opacity: 0; visibility: hidden; } #fullscreenBox.show { opacity: 1; visibility: visible; } .close-button { position: absolute; top: 20px; right: 20px; background-color: red; border: none; color: white; font-size: 20px; cursor: pointer; } .hidden { display: none; } JavaScript (script.js) javascript document.getElementById('openBox').addEventListener('click', function() { const box = document.getElementById('fullscreenBox'); box.classList.remove('hidden'); setTimeout(() => { box.classList.add('show'); }, 10); # To ensure the animation is running }); document.getElementById('closeBox').addEventListener('click', function() { const box = document.getElementById('fullscreenBox'); box.classList.remove('show'); box.addEventListener('transitionend', () => { box.classList.add('hidden'); }, { once: true }); # Run only once });
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>modal</title>
<style>
body,html{
height: 100%;
margin: 0;
top: 0;
}
.modal{
width: 100%;
height: 100%;
background-color: rgba(195, 64, 64, 0.772);
position: relative;
visibility: hidden;
transition: 1s;
opacity: 0;
}
.modal h3{
left: 48%;
position: relative;
}
#open{
background-color: rgb(217, 232, 232);
position: absolute;
color: rgb(1, 21, 21);
}
.modal button{
position: relative;
background-color: rgb(238, 199, 228);
left: 50%;
}
</style>
</head>
<body>
<button onclick="showModal()" id="open">open modal box</button>
<div class="modal">
<h3>press to exit</h3>
<button onclick="closModal()">x</button>
</div>
<script>
let modal=document.getElementById('open')
let shomodal=document.querySelectorAll(".mod
al")[0]
let showModal=()=>{
shomodal.style.visibility='visible'
setTimeout(()=>{
shomodal.style.opacity=1
},1000)
}
let closModal=()=>{
shomodal.style.visibility=0
setTimeout(()=>{
shomodal.style.opacity=0
},1000)
}
</script>
</body>
</html>
Submitting answers is currently unavailable.
Write a program that receives users' student names and number and stores in a file called Students.txt. Also, after each storage, display the entire information of this file at the output.
Write a program that receives a number of input and the factoriel calculates and prints it
Write a program that receives 2 dates in yyyy/mm/dd format and print 2 dates to the output for example Tarikh1: 1401/11/01 tarikh2: 1401/11/05 4 days Tarikh1: 1401/10/01 Tarikh2: 1401/11/05 34 Days
Write a function that receives a list (array) as a parameter, and deletes its duplicate items and returns the new (array) list
Write a program that receives students' scores and names and prints from the highest to the lowest score, respectively
Write a function that receives the user's postcode as a parameter and checks whether the postcode is correct? Must be 15 digits?
Write a program that receives a text and a word from the user, search the word in the text, and as the example below and then put the word * and print the text in the output. Example: Input1: Hello. My name is hooshang. I ...
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.