-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
27 lines (23 loc) · 937 Bytes
/
script.js
File metadata and controls
27 lines (23 loc) · 937 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
// Get the menu icon element and the navbar element
const menu = document.querySelector('#menu-icon');
const navbar = document.querySelector('.navbar');
// Toggle menu and navbar classes on menu click
menu.onclick = () => {
menu.classList.toggle('bx-x');
navbar.classList.toggle('active');
};
// Remove menu and navbar classes on window scroll
window.onscroll = () => {
menu.classList.remove('bx-x');
navbar.classList.remove('active');
};
// Initialize ScrollReveal with configuration
const sr = ScrollReveal({
distance: '60px', // Movement distance of elements
duration: 2500, // Animation duration in milliseconds
reset: true // Enable resetting animations
});
// Reveal elements with specific configurations
sr.reveal('.home-text', { delay: 200, origin: 'top' });
sr.reveal('.home-img', { delay: 400, origin: 'top' });
sr.reveal('.about, .cta, .resume, .contact, .footer', { delay: 200, origin: 'top' });