in footer.php */ document.addEventListener('DOMContentLoaded', function () { /* ── 1. Scroll-triggered fade-up animations ───────────── */ const animateTargets = [ '.elementor-widget-image-box', 'ul.products li.product', '.woocommerce-product-gallery', '.woocommerce-tabs', '.related.products', '.cart-collaterals', '.woocommerce-MyAccount-navigation', '.woocommerce-MyAccount-content', '.elementor-widget-heading', '.elementor-widget-text-editor', ]; if ('IntersectionObserver' in window) { const observer = new IntersectionObserver((entries) => { entries.forEach((entry, i) => { if (entry.isIntersecting) { entry.target.classList.add('dp-animate'); entry.target.style.animationDelay = (i % 5 * 0.08) + 's'; observer.unobserve(entry.target); } }); }, { threshold: 0.12, rootMargin: '0px 0px -40px 0px' }); animateTargets.forEach(selector => { document.querySelectorAll(selector).forEach(el => { if (!el.classList.contains('dp-animate')) observer.observe(el); }); }); } /* ── 2. Hamburger / Mobile Drawer ────────────────────── */ const toggleBtn = document.querySelector('.header-action.toggle-button'); const siteDrawer = document.querySelector('.site-drawer'); if (toggleBtn && siteDrawer) { toggleBtn.addEventListener('click', function (e) { e.preventDefault(); e.stopPropagation(); const isOpen = siteDrawer.classList.contains('drawer-active'); siteDrawer.classList.toggle('drawer-active', !isOpen); document.body.classList.toggle('drawer-open', !isOpen); this.setAttribute('aria-expanded', String(!isOpen)); }); // Close on outside click document.addEventListener('click', function (e) { if ( siteDrawer.classList.contains('drawer-active') && !e.target.closest('.site-drawer') && !e.target.closest('.header-action.toggle-button') ) { siteDrawer.classList.remove('drawer-active'); document.body.classList.remove('drawer-open'); } }); // Close on ESC document.addEventListener('keydown', function (e) { if (e.key === 'Escape' && siteDrawer.classList.contains('drawer-active')) { siteDrawer.classList.remove('drawer-active'); document.body.classList.remove('drawer-open'); toggleBtn.focus(); } }); } /* ── 3. Product card — stagger entrance in grid ─────── */ document.querySelectorAll('ul.products li.product').forEach((card, i) => { card.style.transitionDelay = (i % 4 * 0.06) + 's'; }); /* ── 4. Smooth quantity input +/- feel ──────────────── */ document.querySelectorAll('input.qty').forEach(input => { input.addEventListener('focus', () => input.select()); }); /* ── 5. Add loading state to Add to Cart buttons ────── */ document.querySelectorAll('.single_add_to_cart_button').forEach(btn => { btn.addEventListener('click', function () { if (!this.classList.contains('loading')) { const orig = this.textContent; this.setAttribute('data-orig-text', orig); } }); }); });
No products added in the comparison table.