-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
41 lines (41 loc) · 1.33 KB
/
script.js
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
36
37
38
39
40
41
{
const list = document.querySelectorAll(".wallsCategoryLink");
function activeLink() {
const activeIndex = Array.from(list).indexOf(this);
localStorage.setItem("activeIndex", activeIndex);
list.forEach((item) => item.classList.remove("active"));
this.classList.add("active");
}
list.forEach((item) => item.addEventListener("click", activeLink));
const activeIndex = localStorage.getItem("activeIndex");
if (activeIndex !== null) {
list[activeIndex].classList.add("active");
}
}
{
document.addEventListener("DOMContentLoaded", function () {
setTimeout(function () {
document.querySelector(".homeWallpaper").style.height = "0";
2500;
document.querySelector(".content").style.display = "block";
}, 2500);
setTimeout(function () {
document.querySelector(".homeTitle").style.opacity = "0";
}, 2500);
setTimeout(function () {
document.querySelector("header").style.display = "none";
}, 6000);
});
}
{
document.addEventListener("DOMContentLoaded", function () {
setTimeout(function () {
const loadingScreen = document.querySelector(".loading-screen");
const content = document.querySelector(".content");
if (loadingScreen && content) {
loadingScreen.style.display = "none";
content.style.display = "block";
}
}, 2500);
});
}