-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
42 lines (31 loc) · 1.09 KB
/
main.js
File metadata and controls
42 lines (31 loc) · 1.09 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
37
38
39
40
41
42
//change navbar styles
window.addEventListener('scroll',() =>{
document.querySelector('nav').classList.toggle('window-scroll',window.scrollY > 0)
})
// toggle menu navbar
const menu = document.querySelector(".nav__menu");
const menuBtn = document.querySelector("#open-menu-btn");
const closeBtn = document.querySelector("#close-menu-btn");
menuBtn.addEventListener('click',()=>{
menu.style.display = 'flex';
closeBtn.style.display = 'inline-block';
menuBtn.style.display = 'none';
})
const closeNav = () =>{
menu.style.display = 'none';
closeBtn.style.display = 'none';
menuBtn.style.display = 'inline-block';
}
closeBtn.addEventListener('click',closeNav);
// Function to open the login overlay
function openLoginOverlay() {
document.getElementById('login-overlay').style.display = 'flex';
}
// Function to open the sign-up overlay
function openSignupOverlay() {
document.getElementById('signup-overlay').style.display = 'flex';
}
// Function to close overlays
function closeOverlay(id) {
document.getElementById(id).style.display = 'none';
}