-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnav.js
34 lines (28 loc) · 801 Bytes
/
nav.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
const shadow = document.querySelector(".workstation-shadow"),
aside = document.querySelector("aside");
function viewMenu() {
shadow.classList.add("workstation-active");
aside.classList.add("workstation-active");
aside.focus();
}
function closeMenu() {
shadow.classList.remove("workstation-active");
aside.classList.remove("workstation-active");
}
document.getElementById("workstation-menu").onclick = (e) => {
e.preventDefault();
viewMenu();
};
document.querySelector(".workstation-close").onclick = (e) => {
e.preventDefault();
closeMenu();
};
shadow.onclick = (e) => {
e.preventDefault();
closeMenu();
};
if (document.readyState == "complete") {
document.body.addEventListener("contextmenu", (e) => {
e.preventDefault();
});
}