-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
41 lines (40 loc) · 1.79 KB
/
app.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
// @ts-nocheck
const inputs = document.querySelectorAll(".field");
const hambugerMenuContainer = document.querySelector(".humburgerMenuContainer");
const navListContainer = document.querySelector(".navlist-container");
const hambugerMenuContainerLine1 = document.querySelector(".line1");
const hambugerMenuContainerLine2 = document.querySelector(".line2");
const hambugerMenuContainerLine3 = document.querySelector(".line3");
// @ts-ignore
hambugerMenuContainer.addEventListener("click", () => {
if (hambugerMenuContainer.classList.contains("isOpened")) {
hambugerMenuContainer.classList.remove("isOpened");
hambugerMenuContainerLine2.classList.remove("hideLine2");
hambugerMenuContainerLine1.classList.remove("rotateClockwise");
hambugerMenuContainerLine3.classList.remove("rotateAntiClockwise");
navListContainer.classList.remove("activate");
navListContainer.classList.add("overlay");
document.body.style.overflow = "visible";
} else {
hambugerMenuContainer.classList.add("isOpened");
hambugerMenuContainerLine2.classList.add("hideLine2");
hambugerMenuContainerLine1.classList.add("rotateClockwise");
hambugerMenuContainerLine3.classList.add("rotateAntiClockwise");
navListContainer.classList.add("activate");
navListContainer.classList.remove("overlay");
document.body.style.overflow = "hidden";
}
})
inputs.forEach((inpts) => {
inpts.addEventListener("focus", () => {
inpts.parentNode.classList.add("focus");
inpts.parentNode.classList.add("not-empty");
});
inpts.addEventListener("blur", () => {
if (inpts.value == "")
{
inpts.parentNode.classList.remove("not-empty");
}
inpts.parentNode.classList.remove("focus");
});
});