-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
35 lines (34 loc) · 1.67 KB
/
script.js
File metadata and controls
35 lines (34 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
async function main(){
let a=document.getElementById("background");
console.log(a);
let b=["images/Bg-01.jpg","images/Bg-02.jpg","images/Bg-03.jpg","images/Bg-04.jpg","images/Bg-05.jpg","images/Bg-06.jpg"];
console.log(b);
let index=0;
setInterval(() => {
index = (index + 1) % b.length;
a.style.backgroundImage=`url(${b[index]})`;
}, 10000);
document.querySelector("#ham-all").addEventListener("click",()=>{
document.querySelector(".left").style.display="block";
document.querySelector("#header-box").style.opacity="0.4";
document.querySelector(".right").style.opacity="0.4";
document.querySelector("#background").style.opacity="0.4";
document.querySelector(".background").style.opacity="0.4";
document.querySelector(".container-2").style.opacity="0.4";
document.querySelector("body").style.position="fixed";
document.querySelector("body").style.top="0";
document.querySelector("body").style.bottom="0";
document.querySelector("body").style.left="0";
document.querySelector("body").style.right="0";
})
document.querySelector(".cancel").addEventListener("click",()=>{
document.querySelector(".left").style.display="none";
document.querySelector("#header-box").style.opacity="1";
document.querySelector(".right").style.opacity="1";
document.querySelector("#background").style.opacity="1";
document.querySelector(".background").style.opacity="1";
document.querySelector(".container-2").style.opacity="1";
document.querySelector("body").style.position="static";
})
}
main();