File size: 457 Bytes
98f8ae8
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export function scrollToSection(sectionId) {
    const element = document.getElementById(sectionId);
    if (element) {
        const elementRect = element.getBoundingClientRect();
        const absoluteElementTop = elementRect.top + window.pageYOffset;
        const offset = 120; // Account for fixed header + some padding
        
        window.scrollTo({
            top: absoluteElementTop - offset,
            behavior: 'smooth'
        });
    }
}