document.addEventListener('DOMContentLoaded', function() { // Initialize feather icons if (typeof feather !== 'undefined') { feather.replace(); } // Animate elements on scroll const animateOnScroll = () => { const elements = document.querySelectorAll('.fade-in, .slide-in-left, .slide-in-right'); elements.forEach(element => { const elementTop = element.getBoundingClientRect().top; const windowHeight = window.innerHeight; if (elementTop < windowHeight - 100) { element.style.opacity = '1'; element.style.transform = 'translate(0)'; } }); }; // Initialize animations window.addEventListener('scroll', animateOnScroll); animateOnScroll(); // Smooth scrolling for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function(e) { e.preventDefault(); const targetId = this.getAttribute('href'); if (targetId === '#') return; const targetElement = document.querySelector(targetId); if (targetElement) { targetElement.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }); }); // Mobile menu toggle functionality will be handled in the header component });