-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage.js
More file actions
36 lines (29 loc) · 1.04 KB
/
Copy pathpage.js
File metadata and controls
36 lines (29 loc) · 1.04 KB
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
const wrapper = document.querySelector(".wrapper");
const loginLink = document.querySelector(".login-link");
const registerLink = document.querySelector(".register-link");
const btnPopup = document.querySelector(".btnLogin-popup");
const cancleBtn = document.querySelector(".icon-close");
registerLink.addEventListener("click", () => {
wrapper.classList.add("active");
});
loginLink.addEventListener("click", () => {
wrapper.classList.remove("active");
});
btnPopup.addEventListener("click", () => {
wrapper.classList.add("active-popup");
document.body.style.overflow = "hidden";
});
cancleBtn.addEventListener("click", () => {
wrapper.classList.remove("active-popup");
document.body.style.overflow = "auto";
});
const hamburger = document.getElementById("hamburger");
const nav = document.getElementById("nav");
hamburger.addEventListener("click", () => {
nav.classList.toggle("show");
});
document.querySelectorAll(".btnLogin-popup").forEach((link) => {
link.addEventListener("click", () => {
nav.classList.remove("show");
});
});