} }); // Filter functionality function filterMilestones(category) { const items = document.querySelectorAll('.timeline-item'); const buttons = document.querySelectorAll('.filter-btn'); // Update active button buttons.forEach(btn => btn.classList.remove('active')); event.target.classList.add('active'); items.forEach(item => { if (category === 'all') { item.style.display = 'block'; } else { const itemCategory = item.getAttribute('data-category'); if (category === 'accreditation' && (itemCategory === 'accreditation' || itemCategory === 'recognition')) { item.style.display = 'block'; } else if (category === 'courses' && itemCategory === 'courses') { item.style.display = 'block'; } else if (category === 'recognition' && (itemCategory === 'recognition' || itemCategory === 'celebration')) { item.style.display = 'block'; } else { item.style.display = 'none'; } } }); } // Add 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.style.opacity = '1'; entry.target.style.transform = 'translateY(0)'; } }); }, observerOptions); // Add smooth scrolling 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' }); } }); }); // Initialize animations document.addEventListener('DOMContentLoaded', function() { createParticles(); // Add parallax effect to shapes window.addEventListener('scroll', function() { const scrolled = window.pageYOffset; const shapes = document.querySelectorAll('.shape'); shapes.forEach((shape, index) => { const speed = 0.5 + (index * 0.1); shape.style.transform = `translateY(${scrolled * speed}px)`; }); }); // Observe timeline items for scroll animations const timelineItems = document.querySelectorAll('.timeline-item'); timelineItems.forEach((item, index) => { item.style.animationDelay = `${index * 0.1}s`; observer.observe(item); }); }); // Add mouse follow effect document.addEventListener('mousemove', function(e) { const shapes = document.querySelectorAll('.shape'); const mouseX = e.clientX / window.innerWidth; const mouseY = e.clientY / window.innerHeight; shapes.forEach((shape, index) => { const speed = 0.05 + (index * 0.01); const x = (mouseX - 0.5) * 50 * speed; const y = (mouseY - 0.5) * 50 * speed; shape.style.transform += ` translate(${x}px, ${y}px)`; }); });