-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
47 lines (38 loc) · 1.65 KB
/
main.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
42
43
44
45
46
47
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
// AOS.refreshHard();
AOS.init({
offset: 200, // offset (in px) from the original trigger point
delay: 100, // values from 0 to 3000, with step 50ms
duration: 400, // values from 0 to 3000, with step 50ms
easing: 'ease', // default easing for AOS animations
once: false, // whether animation should happen only once - while scrolling down
mirror: false, // whether elements should animate out while scrolling past them
anchorPlacement: 'top-bottom', // defines which position of the element regarding to window should trigger the animation
});
// const dishGridEl = Array.from(document.querySelectorAll('#dishGrid'));
// if (dishGridEl.length > 0){
// // console.log(dishGridEl)
// dishGridEl.forEach(item => {
// item.setAttribute('data-aos', 'fade-up');
// })
// }