-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
34 lines (29 loc) · 1 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
function toggleMenu() {
const navLinks = document.querySelector('.nav-links');
const hamburger = document.querySelector('.hamburger');
navLinks.classList.toggle('active');
hamburger.classList.toggle('toggle');
}
function closeMenu() {
const navLinks = document.querySelector('.nav-links');
const hamburger = document.querySelector('.hamburger');
navLinks.classList.remove('active');
hamburger.classList.remove('toggle');
}
document.addEventListener('DOMContentLoaded', function() {
const sections = document.querySelectorAll('section');
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
}
});
}, {
threshold: 0.2
});
sections.forEach(section => {
section.classList.add('fade-in');
observer.observe(section);
});
});
const animatedElements = document.querySelectorAll('.text, svg');