Aviation169's picture
Add more components and feature
cb48938 verified
raw
history blame contribute delete
744 Bytes
// Initialize components and add interactivity
document.addEventListener('DOMContentLoaded', () => {
// 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'
});
});
});
// Add fade-in animation to all custom components
const components = document.querySelectorAll('custom-navbar, custom-card, custom-accordion, custom-testimonials, custom-newsletter, custom-footer');
components.forEach(component => {
component.classList.add('fade-in');
});
});