File size: 744 Bytes
cb48938
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// 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');
    });
});