forked from immdipu/CINEMAA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAbout.js
109 lines (77 loc) · 2.96 KB
/
About.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
const arrowLeft = document.querySelector(".arrow_left");
const hamburger = document.querySelector(".hamburger");
const lightDarkmode = document.querySelector(".light_darkmode");
const hamburgerPhone = document.querySelector(".hamburgerphone");
const sidenavContainer = document.querySelector(".sidenav_container");
const overlaySideNavabar = document.querySelector(".overlay_side_navabar");
const sidenav = document.querySelector(".sidenav");
const searchbox = document.querySelector(".search");
const menuulLI = document.querySelectorAll(".menu_ul li");
const cards = document.querySelectorAll(".card blockquote");
const AllCards = document.querySelectorAll(".card");
const biChevronDown = document.querySelectorAll("card .bi-chevron-down");
menuulLI.forEach(item => {
item.addEventListener('click', function () {
menuulLI.forEach(i => i.classList.remove('hovered'))
item.classList.add('hovered');
})
})
lightDarkmode.addEventListener("click", function () {
document.body.classList.toggle("light");
if (document.body.classList.contains(`light`)) {
localStorage.setItem(`theme`, `light`)
} else {
localStorage.setItem(`theme`, `dark`);
}
});
function settheme() {
let currtheme = localStorage.getItem('theme');
if (currtheme == 'light') {
document.body.classList.add("light");
} else {
document.body.classList.remove("light");
}
}
settheme()
arrowLeft.addEventListener("click", function () {
document.body.classList.remove("minimize_siderbar");
});
hamburger.addEventListener("click", function () {
document.body.classList.add("minimize_siderbar");
});
hamburgerPhone.addEventListener("click", function () {
sidenavContainer.classList.add("sidenav_container_active");
overlaySideNavabar.classList.add("sidenav_container_active");
});
overlaySideNavabar.addEventListener("click", function () {
sidenavContainer.classList.remove("sidenav_container_active");
overlaySideNavabar.classList.remove("sidenav_container_active");
document.body.classList.remove("minimize_siderbar");
});
AllCards.forEach(card => card.classList.add('hideCard'));
AllCards.forEach(eachCard => {
eachCard.addEventListener('click', function () {
if (!eachCard.classList.contains('hideCard')) {
eachCard.classList.add('hideCard');
eachCard.classList.remove('rotate');
}
else {
AllCards.forEach(card => {
card.classList.add('hideCard');
card.classList.remove('rotate');
});
eachCard.classList.toggle('hideCard');
eachCard.classList.toggle('rotate');
}
})
})
menuulLI.forEach(item => {
item.addEventListener('click', function () {
menuulLI.forEach(i => i.classList.remove('hovered'))
item.classList.add('hovered');
})
})
menuulLI[3].classList.add('hovered');
searchbox.addEventListener('click', function () {
location.replace("./search.html")
})