Floating Object Project Hero
Large Didone project title bottom-left over a soft studio-lit grey backdrop, with a cutout product photo (a red classic car) floating across the headline. Outlined pill and arrow text link below, and a mini journal list with dated rows and hairlines at right.
Rebuilt from epic.net in the Gallery Graphite Editorial style.
Looks exactly like epic.net: 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: title, label, projectHref, allHref, and entries (array of {date, title}) for the journal list. Renders standalone with defaults; the car is an inline SVG cutout that slides in on load.
components/serif-project-hero.tsx
"use client"; import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; type Entry = { date: string; title: string }; export default function FloatingObjectProjectHero({ title = "Lumen Atelier", label = "Journal", projectHref = "#", allHref = "#", entries = [ { date: "04 March 2026", title: "Designing Quiet Interfaces for Slow Brands" }, { date: "21 February 2026", title: "Notes on Type, Grids & Restraint" }, { date: "09 February 2026", title: "Studio Light: Photographing Objects" }, ] as Entry[], }: { title?: string; label?: string; projectHref?: string; allHref?: string; entries?: Entry[]; }) { const pill = "group inline-flex items-center gap-2 rounded-pill border border-ink px-4 py-2 text-label uppercase font-sans text-ink transition-colors duration-hover-fill ease-hover-fill hover:bg-ink hover:text-on-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ink"; const arrow = ( <svg aria-hidden="true" width="14" height="14" viewBox="0 0 14 14" fill="none" stroke="currentColor" strokeWidth="1.2" className="transition-transform duration-smooth-slide ease-smooth-slide group-hover:translate-x-1"> <path d="M1 7h12M8 2l5 5-5 5" /> </svg> ); return ( <section className="relative isolate overflow-hidden bg-canvas text-ink"> <div className="relative mx-auto min-h-[560px] max-w-6xl px-5 pt-16 pb-12 md:min-h-[640px]"> <div aria-hidden="true" className="absolute left-1/2 top-4 -z-10 h-[420px] w-[720px] max-w-full -translate-x-1/2 bg-studio-glow opacity-90 blur-2xl" /> <div aria-hidden="true" className="absolute left-[8%] top-[18%] -z-10 h-[360px] w-[60%] rounded-full bg-[radial-gradient(closest-side,var(--color-studio-light),transparent)]" /> <Reveal from="right" distance={80} duration={1200} className="absolute left-[6%] top-[22%] w-[78%] max-w-[620px] md:left-[14%] md:top-[24%]"> <svg viewBox="0 0 600 200" role="img" aria-label="Red classic coupe in profile" className="w-full drop-shadow-[0_30px_30px_rgba(0,0,0,0.25)]"> <ellipse cx="300" cy="178" rx="270" ry="10" fill="#000" opacity="0.18" /> <path d="M20 140 C20 112 60 100 110 92 C150 62 200 38 270 36 C330 36 370 56 400 84 C470 92 560 100 580 130 C586 150 580 158 570 160 L30 160 C22 158 20 150 20 140Z" fill="#b3151b" /> <path d="M150 90 C180 62 220 50 270 50 C320 50 345 66 365 88Z" fill="#2a2a2a" opacity="0.85" /> <g fill="#111"><path d="M440 110l12 0-14 40-12 0z" /><path d="M462 110l12 0-14 40-12 0z" /><path d="M484 110l12 0-14 40-12 0z" /></g> {[130, 460].map((cx) => ( <g key={cx}> <circle cx={cx} cy="152" r="34" fill="#111" /> <circle cx={cx} cy="152" r="22" fill="#999" /> <circle cx={cx} cy="152" r="6" fill="#222" /> </g> ))} </svg> </Reveal> <div className="absolute right-5 top-[30%] hidden w-[300px] md:block"> <div className="flex items-center justify-between border-b border-hairline pb-2 text-label uppercase font-sans"> <span>{label}</span> <a href={allHref} className="group inline-flex items-center gap-2 focus-visible:outline focus-visible:outline-1">See all {arrow}</a> </div> <Stagger step={100} from="up" distance={12} className="flex flex-col"> {entries.map((e) => ( <a key={e.title} href={allHref} className="block border-b border-hairline py-3 transition-colors duration-hover-fill hover:bg-hairline-soft focus-visible:outline focus-visible:outline-1"> <div className="text-label uppercase font-sans opacity-60">{e.date}</div> <div className="text-body font-sans">{e.title}</div> </a> ))} </Stagger> </div> <div className="relative mt-[300px] md:mt-[380px]"> <Reveal from="up" duration={1000}> <h1 className="font-display text-display-xl leading-none tracking-tight">{title}</h1> </Reveal> <div className="mt-5 flex flex-wrap items-center gap-4"> <a href={projectHref} className={pill}>Visit project {arrow}</a> <a href={allHref} className="group inline-flex items-center gap-2 text-label uppercase font-sans focus-visible:outline focus-visible:outline-1">See all projects {arrow}</a> </div> </div> </div> <div className="mx-auto max-w-6xl border-b border-hairline px-5" /> </section> ); } // ---- Yoink motion (inlined, no dependencies): Reveal, Stagger ---- 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> ); } /** Reveals each direct child one after another when the group scrolls into view. */ function Stagger({ children, step = 90, from = "up", distance = 20, duration = 650, delay = 0, once = true, as = "div", className, style, }: { children?: ReactNode; step?: number; from?: "up" | "down" | "left" | "right" | "scale" | "fade"; distance?: number; duration?: number; delay?: number; once?: boolean; as?: ElementType; className?: string; style?: CSSProperties; }) { const Tag = as; const ref = useRef<HTMLElement>(null); const state = useYkReveal(ref, once); useYkLayoutEffect(() => { const items = Array.from(ref.current?.children ?? []) as HTMLElement[]; if (state === "idle") return; 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.92)", fade: "none", }[from]; if (state === "hidden") { for (const el of items) Object.assign(el.style, { transition: "none", opacity: "0", transform: offset }); return; } items.forEach((el, i) => { const t = `${duration}ms ${YK_EASE} ${delay + i * step}ms`; Object.assign(el.style, { transition: `opacity ${t}, transform ${t}`, opacity: "", transform: "" }); }); // hand the children their own transitions back once everything has landed const done = setTimeout(() => items.forEach((el) => (el.style.transition = "")), delay + items.length * step + duration + 50); return () => clearTimeout(done); }, [state]); return ( <Tag ref={ref} className={className} style={style}> {children} </Tag> ); }"use client"; import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; type Entry = { date: string; title: string }; export default function FloatingObjectProjectHero({ title = "Lumen Atelier", label = "Journal", projectHref = "#", allHref = "#", entries = [ { date: "04 March 2026", title: "Designing Quiet Interfaces for Slow Brands" }, { date: "21 February 2026", title: "Notes on Type, Grids & Restraint" }, { date: "09 February 2026", title: "Studio Light: Photographing Objects" }, ] as Entry[], }: { title?: string; label?: string; projectHref?: string; allHref?: string; entries?: Entry[]; }) { const pill = "group inline-flex items-center gap-2 rounded-full border border-foreground px-4 py-2 text-gallery-label uppercase font-sans text-primary-foreground transition-colors duration-gallery-hover-fill ease-gallery-hover-fill hover:bg-primary hover:text-primary-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-foreground"; const arrow = ( <svg aria-hidden="true" width="14" height="14" viewBox="0 0 14 14" fill="none" stroke="currentColor" strokeWidth="1.2" className="transition-transform duration-gallery-smooth-slide ease-gallery-smooth-slide group-hover:translate-x-1"> <path d="M1 7h12M8 2l5 5-5 5" /> </svg> ); return ( <section className="relative isolate overflow-hidden bg-background text-foreground"> <div className="relative mx-auto min-h-[560px] max-w-6xl px-5 pt-16 pb-12 md:min-h-[640px]"> <div aria-hidden="true" className="absolute left-1/2 top-4 -z-10 h-[420px] w-[720px] max-w-full -translate-x-1/2 opacity-90 blur-2xl" /> <div aria-hidden="true" className="absolute left-[8%] top-[18%] -z-10 h-[360px] w-[60%] rounded-full bg-[radial-gradient(closest-side,var(--color-muted),transparent)]" /> <Reveal from="right" distance={80} duration={1200} className="absolute left-[6%] top-[22%] w-[78%] max-w-[620px] md:left-[14%] md:top-[24%]"> <svg viewBox="0 0 600 200" role="img" aria-label="Red classic coupe in profile" className="w-full drop-shadow-[0_30px_30px_rgba(0,0,0,0.25)]"> <ellipse cx="300" cy="178" rx="270" ry="10" fill="var(--color-foreground)" opacity="0.18" /> <path d="M20 140 C20 112 60 100 110 92 C150 62 200 38 270 36 C330 36 370 56 400 84 C470 92 560 100 580 130 C586 150 580 158 570 160 L30 160 C22 158 20 150 20 140Z" fill="#b3151b" /> <path d="M150 90 C180 62 220 50 270 50 C320 50 345 66 365 88Z" fill="#2a2a2a" opacity="0.85" /> <g fill="#111"><path d="M440 110l12 0-14 40-12 0z" /><path d="M462 110l12 0-14 40-12 0z" /><path d="M484 110l12 0-14 40-12 0z" /></g> {[130, 460].map((cx) => ( <g key={cx}> <circle cx={cx} cy="152" r="34" fill="#111" /> <circle cx={cx} cy="152" r="22" fill="#999" /> <circle cx={cx} cy="152" r="6" fill="#222" /> </g> ))} </svg> </Reveal> <div className="absolute right-5 top-[30%] hidden w-[300px] md:block"> <div className="flex items-center justify-between border-b border-border pb-2 text-gallery-label uppercase font-sans"> <span>{label}</span> <a href={allHref} className="group inline-flex items-center gap-2 focus-visible:outline focus-visible:outline-1">See all {arrow}</a> </div> <Stagger step={100} from="up" distance={12} className="flex flex-col"> {entries.map((e) => ( <a key={e.title} href={allHref} className="block border-b border-border py-3 transition-colors duration-gallery-hover-fill hover:bg-border focus-visible:outline focus-visible:outline-1"> <div className="text-gallery-label uppercase font-sans opacity-60">{e.date}</div> <div className="text-gallery-body font-sans">{e.title}</div> </a> ))} </Stagger> </div> <div className="relative mt-[300px] md:mt-[380px]"> <Reveal from="up" duration={1000}> <h1 className="font-sans text-gallery-display-xl leading-none tracking-tight">{title}</h1> </Reveal> <div className="mt-5 flex flex-wrap items-center gap-4"> <a href={projectHref} className={pill}>Visit project {arrow}</a> <a href={allHref} className="group inline-flex items-center gap-2 text-gallery-label uppercase font-sans focus-visible:outline focus-visible:outline-1">See all projects {arrow}</a> </div> </div> </div> <div className="mx-auto max-w-6xl border-b border-border px-5" /> </section> ); } // ---- Yoink motion (inlined, no dependencies): Reveal, Stagger ---- 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> ); } /** Reveals each direct child one after another when the group scrolls into view. */ function Stagger({ children, step = 90, from = "up", distance = 20, duration = 650, delay = 0, once = true, as = "div", className, style, }: { children?: ReactNode; step?: number; from?: "up" | "down" | "left" | "right" | "scale" | "fade"; distance?: number; duration?: number; delay?: number; once?: boolean; as?: ElementType; className?: string; style?: CSSProperties; }) { const Tag = as; const ref = useRef<HTMLElement>(null); const state = useYkReveal(ref, once); useYkLayoutEffect(() => { const items = Array.from(ref.current?.children ?? []) as HTMLElement[]; if (state === "idle") return; 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.92)", fade: "none", }[from]; if (state === "hidden") { for (const el of items) Object.assign(el.style, { transition: "none", opacity: "0", transform: offset }); return; } items.forEach((el, i) => { const t = `${duration}ms ${YK_EASE} ${delay + i * step}ms`; Object.assign(el.style, { transition: `opacity ${t}, transform ${t}`, opacity: "", transform: "" }); }); // hand the children their own transitions back once everything has landed const done = setTimeout(() => items.forEach((el) => (el.style.transition = "")), delay + items.length * step + duration + 50); return () => clearTimeout(done); }, [state]); return ( <Tag ref={ref} className={className} style={style}> {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: not passed5 hard-coded colours (#b3151b, #2a2a2a, #111, #999). These ignore the theme and break dark mode.
- Animates cleanly: passedIts animation plays and finishes with everything visible, and it stays still for people who turn on reduced motion.