Spaces:
Running
Running
File size: 921 Bytes
8272bb5 | 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 | document.addEventListener('DOMContentLoaded', () => {
// Initialize Feather Icons
feather.replace();
// Intersection Observer for Fade-in Animation
const observerOptions = {
root: null,
rootMargin: '0px',
threshold: 0.1
};
const observer = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
observer.unobserve(entry.target); // Only animate once
}
});
}, observerOptions);
// Select elements to animate
const animatedElements = document.querySelectorAll('section div.relative, section dl div, section h2, section p');
animatedElements.forEach(el => {
el.classList.add('fade-in');
observer.observe(el);
});
console.log("Menuu Landing Page Loaded Successfully");
}); |