-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
55 lines (38 loc) · 1.27 KB
/
script.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
48
49
50
51
52
53
54
55
// MORI's Way for animating navbar
// const menu = document.querySelector('.menu')
// const navbar = document.querySelector('.navbar')
// let condition = 0
// menu.addEventListener('click', toggleMenu)
// function toggleMenu() {
// if ( !condition ) {
// document.querySelector('.navbar').style.top = 0
// document.querySelector('.menu').style.top = '15rem'
// condition = 1
// } else {
// document.querySelector('.navbar').style.top = '-13.8rem'
// document.querySelector('.menu').style.top = '1rem'
// condition = 0
// }
// }
// End of MORI's Way
document.querySelector('.menu').addEventListener('click', () => {
document.querySelectorAll('.target').forEach((item) => {
item.classList.toggle('change')
})
})
const icons = document.querySelectorAll('.section-1-icons i')
let i = 1
setInterval(() => {
i++
// console.log('i ', i)
const icon = document.querySelector('.section-1-icons .change')
// console.log('len ', icons.length);
if (i > icons.length) {
// console.log('if i ', i)
icons[0].classList.add('change')
i = 1
} else {
icon.nextElementSibling.classList.add('change')
}
icon.classList.remove('change')
}, 4000)