-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
32 lines (28 loc) · 1.03 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
const lists = document.querySelectorAll(".nav-menu li")
lists.forEach(link => {
link.addEventListener('click',()=>{
document.querySelector('.active').classList.remove('active');
link.classList.add("active");
})
})
const dropdown = document.querySelector(".select")
const menu = document.querySelector(".menu-social")
dropdown.addEventListener('click',()=>{
menu.classList.toggle("showSocial")
})
const menuIcon = document.querySelector('.bx-menu')
const menuList = document.querySelector('.nav-menu')
menuIcon.addEventListener('click',()=>{
menuList.classList.toggle("showNav")
})
// const observer = new IntersectionObserver((entries) => {
// entries.forEach((entry) => {
// if (entry.isIntersecting) {
// entry.target.classList.add("animate__fadeInDown");
// } else {
// entry.target.classList.remove("animate__fadeInDown");
// }
// });
// });
// const hiddenElements = document.querySelectorAll(".hidden");
// hiddenElements.forEach((el) => observer.observe(el));