-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.js
More file actions
36 lines (29 loc) · 1.01 KB
/
Copy pathmain.js
File metadata and controls
36 lines (29 loc) · 1.01 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 navCloseEl = document.querySelector('.nav__close');
const navList = document.querySelector('.nav__list');
const navIconEl = document.querySelector('.nav__icon');
const navBgOverlayEl = document.querySelector('.nav__bgOverlay');
window.addEventListener('DOMContentLoaded', () =>{
document.body.style.visibility = 'visible';
});
const navOpen = () => {
navList.classList.add('show');
navBgOverlayEl.classList.add('active');
document.body.style= 'visibility: visible; height: 100vh; width:100vw; overflow:hidden;';
}
const navClose = () => {
navList.classList.remove('show');
navBgOverlayEl.classList.remove('active');
document.body.style= 'visibility: visible; height: initial; width: 100%; overflow-x: hidden;';
}
navIconEl.addEventListener('click', navOpen);
navCloseEl.addEventListener('click', navClose);
navBgOverlayEl.addEventListener('click', navClose)
AOS.init({
offset: 200,
delay: 100,
duration: 400,
easing: 'ease',
once: false,
mirror: false,
anchorPlacement: 'top-bottom',
});