File size: 1,104 Bytes
c1dd1be
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

document.addEventListener('DOMContentLoaded', function() {
    // Initialize animations
    const animateElements = document.querySelectorAll('.animate-fade-in');
    animateElements.forEach((el, index) => {
        el.style.animationDelay = `${index * 0.1}s`;
    });

    // Handle shade parameter in URL for try-on page
    if (window.location.pathname.includes('try-on.html')) {
        const urlParams = new URLSearchParams(window.location.search);
        const shade = urlParams.get('shade');
        if (shade) {
            setTimeout(() => {
                const shadeBtn = document.querySelector(`#shade-palette button[style*="${shade}"]`);
                if (shadeBtn) {
                    shadeBtn.click();
                }
            }, 500);
        }
    }

    // Mobile menu toggle functionality will be handled by navbar component
});
// Shared utility functions
function debounce(func, wait = 100) {
    let timeout;
    return function(...args) {
        clearTimeout(timeout);
        timeout = setTimeout(() => {
            func.apply(this, args);
        }, wait);
    };
}