Spaces:
Running
Running
| // Smooth scrolling for nav links | |
| document.querySelectorAll('a.nav-link').forEach(anchor => { | |
| anchor.addEventListener('click', function(e) { | |
| e.preventDefault(); | |
| const targetId = this.getAttribute('href').substring(1); | |
| document.getElementById(targetId).scrollIntoView({ behavior: 'smooth' }); | |
| }); | |
| }); | |
| // Add animation on scroll | |
| const observer = new IntersectionObserver((entries) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| entry.target.classList.add('animate__animated', 'animate__fadeInUp'); | |
| } | |
| }); | |
| }); | |
| document.querySelectorAll('.card, h2, .lead').forEach(el => { | |
| observer.observe(el); | |
| }); |