Serif Hero with Dark 3D Object
Left-aligned serif headline with silver gradient fill over a black field, with a gradient-bordered pill eyebrow (rainbow edge, glass blur), muted subcopy and a dark-glass button plus ghost link. A moody 3D rendered cube sits right, faded by a bottom mask, with a faint diagonal light streak across the page.
Rebuilt from resend.com in the Obsidian Serif Glow style.
Looks exactly like resend.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, titleLine1, titleLine2, description, primaryLabel, secondaryLabel. Renders standalone; text rises on load and the CSS 3D cube scales in on scroll.
components/serif-hero-with-3d-object.tsx
"use client"; import { useLayoutEffect, useRef, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; import { useEffect, useState } from "react"; export default function SerifHeroDarkObject({ eyebrow = "Meet Northwind Studio", titleLine1 = "Mail for", titleLine2 = "builders", description = "A calm, dependable way to reach inboxes instead of junk folders. Send product and campaign messages at any scale.", primaryLabel = "Start free", secondaryLabel = "Read the docs", }: { eyebrow?: string; titleLine1?: string; titleLine2?: string; description?: string; primaryLabel?: string; secondaryLabel?: string; }) { const [on, setOn] = useState(false); useEffect(() => { const t = requestAnimationFrame(() => setOn(true)); return () => cancelAnimationFrame(t); }, []); const rise = (d: number) => `transition-all duration-[1000ms] ease-out motion-reduce:transition-none ${on ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4"}` + (d ? "" : ""); const cells = Array.from({ length: 9 }); const face = (rot: string, light: boolean[]) => ( <div className={`absolute inset-0 grid grid-cols-3 grid-rows-3 gap-1 p-1 ${rot}`}> {cells.map((_, i) => ( <div key={i} className={`rounded-sm border border-hairline-soft ${light[i] ? "bg-[repeating-conic-gradient(#888_0%_25%,#ddd_0%_50%)] bg-[length:4px_4px] opacity-80" : "bg-gradient-to-br from-surface-raised to-background"}`} /> ))} </div> ); return ( <section className="relative isolate min-h-[720px] overflow-hidden bg-background text-primary"> <div className="pointer-events-none absolute inset-0 -z-10 bg-[radial-gradient(50%_40%_at_75%_0%,rgba(255,255,255,0.08),transparent)]" /> <div className="pointer-events-none absolute -left-20 bottom-[18%] -z-10 h-24 w-[130%] -rotate-[10deg] bg-[linear-gradient(90deg,transparent,rgba(255,255,255,0.07),transparent)] blur-xl" /> <div className="pointer-events-none absolute inset-x-0 bottom-0 -z-10 h-1/3 bg-gradient-to-t from-background to-transparent" /> <div className="mx-auto grid max-w-6xl items-center gap-10 px-6 py-24 md:grid-cols-2 md:py-32"> <div> <div className={rise(0)}> <a href="#" className="relative inline-flex items-center gap-2 rounded-pill bg-bg-rainbow-pill-edge p-px"> <span className="absolute inset-0 rounded-pill bg-[linear-gradient(150deg,#02fcef,#ffb52b,#a02bfe)] opacity-60" /> <span className="relative inline-flex items-center gap-2 rounded-pill bg-background/90 px-3 py-1.5 text-ui text-primary backdrop-blur-xl"> {eyebrow} <svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" strokeWidth="1.5" aria-hidden="true"><path d="M4.5 2.5 8 6l-3.5 3.5" /></svg> </span> </a> </div> <h1 className={`mt-8 font-serif text-[64px] leading-[0.95] tracking-[-0.03em] sm:text-[88px] bg-gradient-to-b from-white to-[#a1a4a5] bg-clip-text text-transparent ${rise(1)}`}> {titleLine1}<br />{titleLine2} </h1> <p className={`mt-6 max-w-md text-lead text-secondary ${rise(2)}`}>{description}</p> <div className={`mt-8 flex items-center gap-3 ${rise(3)}`}> <a href="#" className="rounded-lg border border-hairline bg-surface px-5 py-3 text-ui font-medium text-primary shadow-inset-highlight transition-colors duration-200 hover:bg-surface-high focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-blue">{primaryLabel}</a> <a href="#" className="rounded-lg px-5 py-3 text-ui font-medium text-secondary transition-colors duration-200 hover:text-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-blue">{secondaryLabel}</a> </div> </div> <Reveal from="scale" duration={1000} className="relative mx-auto flex h-[420px] w-full max-w-[460px] items-center justify-center [mask-image:linear-gradient(to_top,transparent_5%,black_35%)]"> <div className="absolute h-72 w-72 rounded-full bg-white/5 blur-3xl" /> <div className="relative h-56 w-56 [transform-style:preserve-3d] [transform:rotateX(-25deg)_rotateY(-35deg)]"> <div className="absolute inset-0 [transform:translateZ(112px)]">{face("", [false,false,true,false,false,false,false,false,true])}</div> <div className="absolute inset-0 [transform:rotateY(90deg)_translateZ(112px)]">{face("", [false,true,false,false,false,true,false,false,false])}</div> <div className="absolute inset-0 [transform:rotateX(90deg)_translateZ(112px)]">{face("", [false,false,false,false,true,false,false,false,false])}</div> </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 { useLayoutEffect, useRef, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; import { useEffect, useState } from "react"; export default function SerifHeroDarkObject({ eyebrow = "Meet Northwind Studio", titleLine1 = "Mail for", titleLine2 = "builders", description = "A calm, dependable way to reach inboxes instead of junk folders. Send product and campaign messages at any scale.", primaryLabel = "Start free", secondaryLabel = "Read the docs", }: { eyebrow?: string; titleLine1?: string; titleLine2?: string; description?: string; primaryLabel?: string; secondaryLabel?: string; }) { const [on, setOn] = useState(false); useEffect(() => { const t = requestAnimationFrame(() => setOn(true)); return () => cancelAnimationFrame(t); }, []); const rise = (d: number) => `transition-all duration-[1000ms] ease-out motion-reduce:transition-none ${on ? "opacity-100 translate-y-0" : "opacity-0 translate-y-4"}` + (d ? "" : ""); const cells = Array.from({ length: 9 }); const face = (rot: string, light: boolean[]) => ( <div className={`absolute inset-0 grid grid-cols-3 grid-rows-3 gap-1 p-1 ${rot}`}> {cells.map((_, i) => ( <div key={i} className={`rounded-md border border-obsidian-hairline-soft ${light[i] ? "bg-[repeating-conic-gradient(#888_0%_25%,#ddd_0%_50%)] bg-[length:4px_4px] opacity-80" : "bg-gradient-to-br from-accent to-background"}`} /> ))} </div> ); return ( <section className="relative isolate min-h-[720px] overflow-hidden bg-background text-foreground"> <div className="pointer-events-none absolute inset-0 -z-10 bg-[radial-gradient(50%_40%_at_75%_0%,rgba(255,255,255,0.08),transparent)]" /> <div className="pointer-events-none absolute -left-20 bottom-[18%] -z-10 h-24 w-[130%] -rotate-[10deg] bg-[linear-gradient(90deg,transparent,rgba(255,255,255,0.07),transparent)] blur-xl" /> <div className="pointer-events-none absolute inset-x-0 bottom-0 -z-10 h-1/3 bg-gradient-to-t from-background to-transparent" /> <div className="mx-auto grid max-w-6xl items-center gap-10 px-6 py-24 md:grid-cols-2 md:py-32"> <div> <div className={rise(0)}> <a href="#" className="relative inline-flex items-center gap-2 rounded-full bg-bg-rainbow-pill-edge p-px"> <span className="absolute inset-0 rounded-full bg-[linear-gradient(150deg,#02fcef,#ffb52b,#a02bfe)] opacity-60" /> <span className="relative inline-flex items-center gap-2 rounded-full bg-background/90 px-3 py-1.5 text-obsidian-ui text-foreground backdrop-blur-xl"> {eyebrow} <svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" strokeWidth="1.5" aria-hidden="true"><path d="M4.5 2.5 8 6l-3.5 3.5" /></svg> </span> </a> </div> <h1 className={`mt-8 font-sans text-[64px] leading-[0.95] tracking-[-0.03em] sm:text-[88px] bg-gradient-to-b from-foreground to-muted-foreground bg-clip-text text-transparent ${rise(1)}`}> {titleLine1}<br />{titleLine2} </h1> <p className={`mt-6 max-w-md text-obsidian-lead text-muted-foreground ${rise(2)}`}>{description}</p> <div className={`mt-8 flex items-center gap-3 ${rise(3)}`}> <a href="#" className="rounded-xl border border-border bg-card px-5 py-3 text-obsidian-ui font-medium text-foreground shadow-obsidian-inset-highlight transition-colors duration-200 hover:bg-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary">{primaryLabel}</a> <a href="#" className="rounded-xl px-5 py-3 text-obsidian-ui font-medium text-muted-foreground transition-colors duration-200 hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary">{secondaryLabel}</a> </div> </div> <Reveal from="scale" duration={1000} className="relative mx-auto flex h-[420px] w-full max-w-[460px] items-center justify-center [mask-image:linear-gradient(to_top,transparent_5%,black_35%)]"> <div className="absolute h-72 w-72 rounded-full bg-foreground/5 blur-3xl" /> <div className="relative h-56 w-56 [transform-style:preserve-3d] [transform:rotateX(-25deg)_rotateY(-35deg)]"> <div className="absolute inset-0 [transform:translateZ(112px)]">{face("", [false,false,true,false,false,false,false,false,true])}</div> <div className="absolute inset-0 [transform:rotateY(90deg)_translateZ(112px)]">{face("", [false,true,false,false,false,true,false,false,false])}</div> <div className="absolute inset-0 [transform:rotateX(90deg)_translateZ(112px)]">{face("", [false,false,false,false,true,false,false,false,false])}</div> </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 · 5d 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: passedStill readable when installed in your theme and switched to dark mode.
- 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.