Spaces:
Running
Running
File size: 839 Bytes
a3cf36c | 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 | // Intersection Observer for scroll animations
const observerOptions = {
threshold: 0.1,
rootMargin: '0px 0px -50px 0px'
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('animate-fadeIn');
}
});
}, observerOptions);
document.querySelectorAll('section').forEach(section => {
observer.observe(section);
});
// Form handling
const contactForm = document.querySelector('form');
if (contactForm) {
contactForm.addEventListener('submit', (e) => {
e.preventDefault();
// Here you would typically send the form data
alert('Thank you for your message! We will get back to you soon.');
contactForm.reset();
});
}
// Mobile menu toggle (handled in navbar component) |