File size: 809 Bytes
e05cec4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | // Shared JavaScript across all pages
document.addEventListener('DOMContentLoaded', () => {
// Add animation classes to elements
const animateElements = document.querySelectorAll('.fade-in');
animateElements.forEach((el, index) => {
el.style.animationDelay = `${index * 0.1}s`;
});
// Smooth scroll for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
});
// Dynamic year for footer
const yearSpan = document.querySelector('#current-year');
if (yearSpan) {
yearSpan.textContent = new Date().getFullYear();
} |