-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNav.js
More file actions
26 lines (22 loc) · 863 Bytes
/
Nav.js
File metadata and controls
26 lines (22 loc) · 863 Bytes
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
const openSection = document.querySelector('.open-nav');
const closeSection = document.querySelector('.close-nav');
const bluR = document.querySelector('.downBlur');
const naV = document.getElementById('nav');
openSection.addEventListener('click', () => {
bluR.style.display = 'flex';
setTimeout(() => bluR.style.opacity = '100%', 200);
setTimeout(() => {
naV.style.left = '50%';
openSection.style.display = 'none';
closeSection.style.display = 'block';
}, 200);
});
closeSection.addEventListener('click', () => {
setTimeout(() => {
naV.style.left = '150%';
openSection.style.display = 'block';
closeSection.style.display = 'none';
}, 200);
setTimeout(() => bluR.style.opacity = '0', 200);
setTimeout(() => { bluR.style.display = 'none'; }, 400);
});