forked from mlee212/mlee212.github.io
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
27 lines (21 loc) · 736 Bytes
/
app.js
File metadata and controls
27 lines (21 loc) · 736 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
27
const navSlide = () => {
const menicon = document.querySelector('.menicon');
const nav = document.querySelector('.nav-links');
const navLinks = document.querySelectorAll('.nav-links li');
menicon.addEventListener('click', () => {
//Toggle Nav
nav.classList.toggle('nav-active');
//Animate links
navLinks.forEach((link,index) => {
if(link.style.animation) {
link.style.animation = '';
} else {
link.style.animation = `navLinkFade 0.5s ease forwards ${index / 7 + 0.3}s`;
console.log(index);
}
});
//Menicon Animation
menicon.classList.toggle('toggle');
});
}
navSlide();