// Luxury Enhancements for Salla (Custom JS)
// 1) Sticky header class on scroll
(function () {
const root = document.documentElement;
let ticking = false;
function onScroll() {
if (!ticking) {
window.requestAnimationFrame(() => {
const y = window.scrollY || 0;
root.classList.toggle("lx-scrolled", y > 12);
ticking = false;
});
ticking = true;
}
}
window.addEventListener("scroll", onScroll, { passive: true });
onScroll();
})();
// 2) Soft reveal animation
(function () {
const els = document.querySelectorAll(
".s-products-slider-wrapper, .store-footer, .section, .s-product-card-entry"
);
const io = new IntersectionObserver(
(entries) => {
entries.forEach((e) => {
if (e.isIntersecting) {
e.target.classList.add("lx-reveal");
io.unobserve(e.target);
}
});
},
{ threshold: 0.12 }
);
els.forEach((el) => io.observe(el));
})();