Refresh storefront design with full-bleed hero and new type system
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+15
-6
@@ -1,16 +1,25 @@
|
||||
(() => {
|
||||
const header = document.querySelector(".site-header");
|
||||
const onScroll = () => {
|
||||
if (!header) return;
|
||||
header.classList.toggle("is-scrolled", window.scrollY > 12);
|
||||
};
|
||||
onScroll();
|
||||
window.addEventListener("scroll", onScroll, { passive: true });
|
||||
|
||||
const reveals = document.querySelectorAll(".reveal");
|
||||
if ("IntersectionObserver" in window) {
|
||||
const observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.classList.add("is-visible");
|
||||
observer.unobserve(entry.target);
|
||||
}
|
||||
entries.forEach((entry, index) => {
|
||||
if (!entry.isIntersecting) return;
|
||||
const el = entry.target;
|
||||
el.style.transitionDelay = `${Math.min(index * 0.04, 0.2)}s`;
|
||||
el.classList.add("is-visible");
|
||||
observer.unobserve(el);
|
||||
});
|
||||
},
|
||||
{ threshold: 0.15 }
|
||||
{ threshold: 0.12, rootMargin: "0px 0px -8% 0px" }
|
||||
);
|
||||
reveals.forEach((el) => observer.observe(el));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user