Spaces:
Running
Running
File size: 616 Bytes
225fa9a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | // Theme initialization
document.addEventListener('DOMContentLoaded', () => {
// Check for saved theme preference
const savedTheme = localStorage.getItem('theme') || 'light';
document.documentElement.classList.add(savedTheme);
// Initialize all feather icons
feather.replace();
});
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
}); |