Page sections / Feature sections
Bundle Gallery with Eyebrow
Left: a large product render on a foam rounded card with dotted callout labels, plus three equal square lifestyle thumbnails below. Right: a lime pill eyebrow, light 40px headline, body copy and a dark pill CTA.
Rebuilt from seed.com in the Verdant Lab Editorial style.
Looks exactly like seed.com: brings its fonts and colours, namespaced so your own theme stays untouched.
Restyled to your project: uses your shadcn colours, fonts and radius, so it matches the rest of your app. Layout, type sizes and motion stay as designed.
Usage
Props: eyebrow, heading, body, ctaLabel, ctaHref, thumbs (array of {src, alt}), and optional mainImage (if omitted, a coded jar illustration with callouts is shown). Renders standalone with no props.
components/routine-bundle-showcase.tsx
"use client"; import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; type Props = { eyebrow?: string; heading?: string; body?: string; ctaLabel?: string; ctaHref?: string; mainImage?: string; thumbs?: { src: string; alt: string }[]; }; function Jar({ tone, label, className }: { tone: string; label: string; className: string }) { return ( <div className={"absolute bottom-[8%] flex flex-col items-stretch " + className}> <div className="h-[14%] min-h-5 rounded-t-md bg-ink shadow-capsule-drop" /> <div className={"flex flex-1 flex-col items-center justify-between rounded-b-2xl px-3 py-6 " + tone}> <span className="text-caption text-canvas">{label}</span> <span className="h-3 w-3 rounded-full bg-canvas" /> <span className="text-[8px] tracking-wide text-canvas/80">30 CAPSULES</span> </div> </div> ); } function Callout({ text, className }: { text: string; className: string }) { return ( <div className={"absolute flex flex-col items-center " + className}> <span className="rounded-pill border border-ink bg-canvas px-2 py-0.5 text-caption text-ink">{text}</span> <span className="h-4 border-l border-dashed border-ink" /> <span className="h-1.5 w-1.5 rounded-full bg-ink" /> </div> ); } export default function BundleGalleryWithEyebrow({ eyebrow = "Build your ritual", heading = "Gentle daily support for energy and everyday balance.", body = "Two thoughtfully formulated capsules, designed to work together, to support steady energy and a calmer, more comfortable routine.", ctaLabel = "Shop the Morning Pair", ctaHref = "#", mainImage, thumbs = [ { src: "https://yoink-app.fly.dev/stock/food-1.jpg", alt: "Latte on a wooden table" }, { src: "https://yoink-app.fly.dev/stock/nature-2.jpg", alt: "Green leaf with water drops" }, { src: "https://yoink-app.fly.dev/stock/workspace-5.jpg", alt: "Bright wooden table with laptop" }, ], }: Props) { return ( <section className="bg-canvas px-4 py-12 text-ink md:px-8 md:py-20"> <div className="mx-auto grid max-w-[1376px] items-center gap-8 lg:grid-cols-[672px_1fr] lg:gap-8"> <Reveal from="up"> <div className="flex flex-col gap-4"> <div className="relative aspect-video overflow-hidden rounded-card bg-surface-foam"> {mainImage ? ( <img src={mainImage} alt="Two supplement jars" width={672} height={377} className="h-full w-full object-cover" /> ) : ( <> <div className="absolute inset-x-[10%] bottom-[6%] h-6 rounded-full bg-ink/10 blur-xl" /> <Jar tone="bg-gradient-to-b from-ink to-forest-soft" label="Seedling" className="left-[25%] top-[22%] w-[29%]" /> <Jar tone="bg-gradient-to-b from-faded-green to-ink/70" label="Seedling" className="left-[56%] top-[40%] w-[27%]" /> <Callout text="AB-01" className="left-[33%] top-[6%]" /> <Callout text="AB-02" className="left-[63%] top-[17%]" /> </> )} </div> <div className="grid grid-cols-3 gap-4"> {thumbs.map((t, i) => ( <div key={i} className={"overflow-hidden rounded-card bg-surface " + (i === 2 ? "aspect-[3/4] sm:aspect-square" : "aspect-square")}> <img src={t.src} alt={t.alt} width={213} height={213} loading="lazy" className="h-full w-full object-cover transition-transform duration-ui-hover ease-ui-hover hover:scale-105" /> </div> ))} </div> </div> </Reveal> <Reveal from="up" delay={120}> <div className="flex max-w-[600px] flex-col items-start gap-5 lg:pl-0"> <span className="rounded-pill bg-lime-highlight px-2 py-1 text-caption">{eyebrow}</span> <h2 className="text-[32px] font-light leading-[1.1] tracking-[-0.02em] md:text-[40px]">{heading}</h2> <p className="text-body text-ink">{body}</p> <a href={ctaHref} className="rounded-pill bg-ink px-6 py-4 text-body text-canvas transition-all duration-ui-hover ease-ui-hover hover:bg-ink/80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ink"> {ctaLabel} </a> </div> </Reveal> </div> </section> ); } // ---- Yoink motion (inlined, no dependencies): Reveal ---- const YK_EASE = "cubic-bezier(0.16, 1, 0.3, 1)"; const useYkLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect; function ykReducedMotion(): boolean { return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches; } // "idle": untouched (visible) · "hidden": waiting below the fold · "shown": play the entrance. // Content is only hidden once we know we can show it again (IntersectionObserver exists, motion allowed, // and there is a box to watch), and a safety net reveals anything on screen that is still hidden. type YkRevealState = "idle" | "hidden" | "shown"; function useYkReveal(ref: RefObject<Element | null>, once = true): YkRevealState { const [state, setState] = useState<YkRevealState>("idle"); useYkLayoutEffect(() => { const el = ref.current; if (!el || ykReducedMotion() || typeof IntersectionObserver === "undefined") return; // watch the element's own box, or its children when it has none (display: contents) const boxes = () => (getComputedStyle(el).display === "contents" ? Array.from(el.children) : [el]); const onScreen = (t: Element) => { const r = t.getBoundingClientRect(); return (r.width > 0 || r.height > 0) && r.bottom > 0 && r.right > 0 && r.top < window.innerHeight && r.left < window.innerWidth; }; if (!boxes().some((t) => t.getBoundingClientRect().width > 0 || t.getBoundingClientRect().height > 0)) return; // e.g. hidden at mount: leave it visible let shown = false; const show = (v: boolean) => { if (v !== shown) (shown = v), setState(v ? "shown" : "hidden"); }; setState("hidden"); const inView = new Set<Element>(); const io = new IntersectionObserver((entries) => { for (const e of entries) { if (e.isIntersecting) inView.add(e.target); else inView.delete(e.target); } if (inView.size) { show(true); if (once) io.disconnect(); } else if (!once) show(false); }); const watched = new Set<Element>(); const watch = () => boxes().forEach((t) => !watched.has(t) && (watched.add(t), io.observe(t))); watch(); // safety net: styles that land after mount (display: contents) get watched too, and nothing // stays hidden for more than a moment while it is actually on screen const start = Date.now(); const net = setInterval(() => { if (shown) return once && clearInterval(net); watch(); if (Date.now() - start > 2400 && boxes().some(onScreen)) show(true); }, 600); return () => { io.disconnect(); clearInterval(net); }; }, [once]); return state; } type YkRevealFrom = "up" | "down" | "left" | "right" | "scale" | "blur" | "none"; /** Fades content in as it scrolls into view. */ function Reveal({ children, from = "up", delay = 0, duration = 700, distance = 24, once = true, as = "div", className, style, }: { children?: ReactNode; from?: YkRevealFrom; delay?: number; duration?: number; distance?: number; once?: boolean; as?: ElementType; className?: string; style?: CSSProperties; }) { const Tag = as; const ref = useRef<HTMLElement>(null); const state = useYkReveal(ref, once); const hidden = state === "hidden"; const offset = { up: `translate3d(0, ${distance}px, 0)`, down: `translate3d(0, ${-distance}px, 0)`, left: `translate3d(${-distance}px, 0, 0)`, right: `translate3d(${distance}px, 0, 0)`, scale: "scale(0.94)", blur: `translate3d(0, ${distance / 2}px, 0)`, none: "none", }[from]; const t = `${duration}ms ${YK_EASE} ${delay}ms`; return ( <Tag ref={ref} className={className} style={{ ...style, ...(hidden && { opacity: 0, transform: offset, filter: from === "blur" ? "blur(12px)" : undefined }), ...(state === "shown" && { transition: `opacity ${t}, transform ${t}, filter ${t}` }), }} > {children} </Tag> ); }"use client"; import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; type Props = { eyebrow?: string; heading?: string; body?: string; ctaLabel?: string; ctaHref?: string; mainImage?: string; thumbs?: { src: string; alt: string }[]; }; function Jar({ tone, label, className }: { tone: string; label: string; className: string }) { return ( <div className={"absolute bottom-[8%] flex flex-col items-stretch " + className}> <div className="h-[14%] min-h-5 rounded-t-md bg-foreground shadow-verdant-capsule-drop" /> <div className={"flex flex-1 flex-col items-center justify-between rounded-b-2xl px-3 py-6 " + tone}> <span className="text-verdant-caption text-background">{label}</span> <span className="h-3 w-3 rounded-full bg-background" /> <span className="text-[8px] tracking-wide text-background/80">30 CAPSULES</span> </div> </div> ); } function Callout({ text, className }: { text: string; className: string }) { return ( <div className={"absolute flex flex-col items-center " + className}> <span className="rounded-full border border-foreground bg-background px-2 py-0.5 text-verdant-caption text-foreground">{text}</span> <span className="h-4 border-l border-dashed border-foreground" /> <span className="h-1.5 w-1.5 rounded-full bg-foreground" /> </div> ); } export default function BundleGalleryWithEyebrow({ eyebrow = "Build your ritual", heading = "Gentle daily support for energy and everyday balance.", body = "Two thoughtfully formulated capsules, designed to work together, to support steady energy and a calmer, more comfortable routine.", ctaLabel = "Shop the Morning Pair", ctaHref = "#", mainImage, thumbs = [ { src: "https://yoink-app.fly.dev/stock/food-1.jpg", alt: "Latte on a wooden table" }, { src: "https://yoink-app.fly.dev/stock/nature-2.jpg", alt: "Green leaf with water drops" }, { src: "https://yoink-app.fly.dev/stock/workspace-5.jpg", alt: "Bright wooden table with laptop" }, ], }: Props) { return ( <section className="bg-background px-4 py-12 text-foreground md:px-8 md:py-20"> <div className="mx-auto grid max-w-[1376px] items-center gap-8 lg:grid-cols-[672px_1fr] lg:gap-8"> <Reveal from="up"> <div className="flex flex-col gap-4"> <div className="relative aspect-video overflow-hidden rounded-2xl bg-muted"> {mainImage ? ( <img src={mainImage} alt="Two supplement jars" width={672} height={377} className="h-full w-full object-cover" /> ) : ( <> <div className="absolute inset-x-[10%] bottom-[6%] h-6 rounded-full bg-foreground/10 blur-xl" /> <Jar tone="bg-gradient-to-b from-foreground to-foreground" label="Seedling" className="left-[25%] top-[22%] w-[29%]" /> <Jar tone="bg-gradient-to-b from-foreground to-foreground/70" label="Seedling" className="left-[56%] top-[40%] w-[27%]" /> <Callout text="AB-01" className="left-[33%] top-[6%]" /> <Callout text="AB-02" className="left-[63%] top-[17%]" /> </> )} </div> <div className="grid grid-cols-3 gap-4"> {thumbs.map((t, i) => ( <div key={i} className={"overflow-hidden rounded-2xl bg-card " + (i === 2 ? "aspect-[3/4] sm:aspect-square" : "aspect-square")}> <img src={t.src} alt={t.alt} width={213} height={213} loading="lazy" className="h-full w-full object-cover transition-transform duration-verdant-ui-hover ease-verdant-ui-hover hover:scale-105" /> </div> ))} </div> </div> </Reveal> <Reveal from="up" delay={120}> <div className="flex max-w-[600px] flex-col items-start gap-5 lg:pl-0"> <span className="rounded-full bg-verdant-lime-highlight px-2 py-1 text-verdant-caption">{eyebrow}</span> <h2 className="text-[32px] font-light leading-[1.1] tracking-[-0.02em] md:text-[40px]">{heading}</h2> <p className="text-verdant-body text-foreground">{body}</p> <a href={ctaHref} className="rounded-full bg-foreground px-6 py-4 text-verdant-body text-background transition-all duration-verdant-ui-hover ease-verdant-ui-hover hover:bg-foreground/80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-foreground"> {ctaLabel} </a> </div> </Reveal> </div> </section> ); } // ---- Yoink motion (inlined, no dependencies): Reveal ---- const YK_EASE = "cubic-bezier(0.16, 1, 0.3, 1)"; const useYkLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect; function ykReducedMotion(): boolean { return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches; } // "idle": untouched (visible) · "hidden": waiting below the fold · "shown": play the entrance. // Content is only hidden once we know we can show it again (IntersectionObserver exists, motion allowed, // and there is a box to watch), and a safety net reveals anything on screen that is still hidden. type YkRevealState = "idle" | "hidden" | "shown"; function useYkReveal(ref: RefObject<Element | null>, once = true): YkRevealState { const [state, setState] = useState<YkRevealState>("idle"); useYkLayoutEffect(() => { const el = ref.current; if (!el || ykReducedMotion() || typeof IntersectionObserver === "undefined") return; // watch the element's own box, or its children when it has none (display: contents) const boxes = () => (getComputedStyle(el).display === "contents" ? Array.from(el.children) : [el]); const onScreen = (t: Element) => { const r = t.getBoundingClientRect(); return (r.width > 0 || r.height > 0) && r.bottom > 0 && r.right > 0 && r.top < window.innerHeight && r.left < window.innerWidth; }; if (!boxes().some((t) => t.getBoundingClientRect().width > 0 || t.getBoundingClientRect().height > 0)) return; // e.g. hidden at mount: leave it visible let shown = false; const show = (v: boolean) => { if (v !== shown) (shown = v), setState(v ? "shown" : "hidden"); }; setState("hidden"); const inView = new Set<Element>(); const io = new IntersectionObserver((entries) => { for (const e of entries) { if (e.isIntersecting) inView.add(e.target); else inView.delete(e.target); } if (inView.size) { show(true); if (once) io.disconnect(); } else if (!once) show(false); }); const watched = new Set<Element>(); const watch = () => boxes().forEach((t) => !watched.has(t) && (watched.add(t), io.observe(t))); watch(); // safety net: styles that land after mount (display: contents) get watched too, and nothing // stays hidden for more than a moment while it is actually on screen const start = Date.now(); const net = setInterval(() => { if (shown) return once && clearInterval(net); watch(); if (Date.now() - start > 2400 && boxes().some(onScreen)) show(true); }, 600); return () => { io.disconnect(); clearInterval(net); }; }, [once]); return state; } type YkRevealFrom = "up" | "down" | "left" | "right" | "scale" | "blur" | "none"; /** Fades content in as it scrolls into view. */ function Reveal({ children, from = "up", delay = 0, duration = 700, distance = 24, once = true, as = "div", className, style, }: { children?: ReactNode; from?: YkRevealFrom; delay?: number; duration?: number; distance?: number; once?: boolean; as?: ElementType; className?: string; style?: CSSProperties; }) { const Tag = as; const ref = useRef<HTMLElement>(null); const state = useYkReveal(ref, once); const hidden = state === "hidden"; const offset = { up: `translate3d(0, ${distance}px, 0)`, down: `translate3d(0, ${-distance}px, 0)`, left: `translate3d(${-distance}px, 0, 0)`, right: `translate3d(${distance}px, 0, 0)`, scale: "scale(0.94)", blur: `translate3d(0, ${distance / 2}px, 0)`, none: "none", }[from]; const t = `${duration}ms ${YK_EASE} ${delay}ms`; return ( <Tag ref={ref} className={className} style={{ ...style, ...(hidden && { opacity: 0, transform: offset, filter: from === "blur" ? "blur(12px)" : undefined }), ...(state === "shown" && { transition: `opacity ${t}, transform ${t}, filter ${t}` }), }} > {children} </Tag> ); }
Quality checks
Automated, in a real browser · 4d ago- Accessible: passedNo serious accessibility problems (axe-core): readable contrast, labelled buttons and images.
- Responsive: passedRenders at phone (390px), tablet (768px) and desktop width without sideways scrolling.
- Dark mode: not passedElements must meet minimum color contrast ratio thresholds (1 element)
- Themeable: passedUses design tokens rather than hard-coded colours, so it follows your theme cleanly.
- Animates cleanly: passedIts animation plays and finishes with everything visible, and it stays still for people who turn on reduced motion.