// Initialize Lucide icons lucide.createIcons(); // Navbar scroll effect const navbar = document.getElementById('navbar'); let lastScroll = 0; window.addEventListener('scroll', () => { const currentScroll = window.pageYOffset; if (currentScroll > 50) { navbar.classList.add('shadow-sm'); } else { navbar.classList.remove('shadow-sm'); } lastScroll = currentScroll; }); // Intersection Observer for fade-in animations const observerOptions = { root: null, rootMargin: '0px', threshold: 0.1 }; const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.classList.add('animate-fade-in-up'); observer.unobserve(entry.target); } }); }, observerOptions); // Observe elements document.querySelectorAll('.group').forEach((el) => { el.style.opacity = '0'; observer.observe(el); }); // Smooth scroll for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); const target = document.querySelector(this.getAttribute('href')); if (target) { target.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }); }); // Interactive hover effects for feature cards document.querySelectorAll('.group').forEach(card => { card.addEventListener('mouseenter', function() { this.style.opacity = '1'; }); }); // Mobile menu toggle (if needed for future expansion) const mobileMenuBtn = document.createElement('button'); mobileMenuBtn.className = 'md:hidden p-2'; mobileMenuBtn.innerHTML = ''; mobileMenuBtn.onclick = () => { // Toggle mobile menu logic here console.log('Mobile menu toggled'); }; // Re-initialize icons after dynamic content setTimeout(() => { lucide.createIcons(); }, 100); // Add subtle parallax effect to hero section window.addEventListener('scroll', () => { const scrolled = window.pageYOffset; const parallaxElements = document.querySelectorAll('.animate-float'); parallaxElements.forEach(el => { const speed = 0.5; el.style.transform = `translateY(${scrolled * speed}px)`; }); });