forked from flick9000/winscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
49 lines (40 loc) · 1.32 KB
/
main.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
function responsiveNav() {
const navbar = document.getElementById("navbar");
if (!navbar.classList.contains("responsive")) {
navbar.classList.add("responsive");
document.body.style.overflow = "hidden";
} else {
navbar.classList.remove("responsive");
document.body.style.overflow = "visible";
}
}
const privacyDialog = document.getElementById("privacyDialog");
const openPrivacyDialog = document.getElementById("openPrivacyDialog");
const closePrivacyDialog = document.getElementById("closePrivacyDialog");
openPrivacyDialog.addEventListener("click", () => {
privacyDialog.showModal();
})
closePrivacyDialog.addEventListener("click", () => {
privacyDialog.close();
})
const startDialog = document.getElementById("startDialog");
const openStartDialog = document.getElementById("openStartDialog");
const closeStartDialog = document.getElementById("closeStartDialog");
openStartDialog.addEventListener("click", () => {
startDialog.showModal();
})
closeStartDialog.addEventListener("click", () => {
startDialog.close();
})
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
}
});
}, {
threshold: 0.3
});
document.querySelectorAll('.fade-in').forEach((element) => {
observer.observe(element);
});