Page sections / Feature sections
Glossy Icon Section Header
Centered section intro: a 170px looping-video 3D app icon (black glass squircle with colored under-glow: orange, purple, cyan, green), a silver-gradient display headline and a two-line gray subhead. Repeated for each feature chapter.
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: title, description, and glow (any CSS colour, e.g. var(--color-accent-orange)) to change the icon's under-glow. Repeat the component per feature chapter; the header fades in on scroll.
components/glossy-icon-section-header.tsx
"use client"; import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; export default function GlossyIconSectionHeader({ title = "Everything within your reach", description = "All the tools you need to run your delivery pipeline, inspect detailed traces, and keep your sender health strong, minus the busywork.", glow = "var(--color-accent-green)", }: { title?: string; description?: string; glow?: string; }) { return ( <section className="relative bg-background px-6 py-20 text-center"> <Reveal from="up" duration={500} className="mx-auto flex max-w-2xl flex-col items-center"> <div className="relative h-[170px] w-[170px]" role="img" aria-label="Glossy glass app icon with a glowing sphere" > <div className="absolute inset-x-6 bottom-2 h-10 rounded-full opacity-70 blur-2xl" style={{ background: glow }} /> <div className="relative mx-auto mt-3 flex h-[146px] w-[146px] items-center justify-center rounded-[34px] border border-hairline bg-gradient-to-b from-surface-high to-surface shadow-card-soft overflow-hidden"> <div className="absolute inset-0 bg-[radial-gradient(70%_50%_at_50%_100%,var(--color-accent-green),transparent)] opacity-40" /> <div className="relative h-20 w-20 rounded-full bg-[radial-gradient(circle_at_30%_25%,#4a4d4f,#0a0a0a_60%)] shadow-[inset_0_0_14px_rgba(255,255,255,0.18),0_6px_22px_rgba(0,0,0,0.8)]"> <div className="absolute left-4 top-3 h-4 w-8 rotate-[-25deg] rounded-full bg-white/20 blur-[3px]" /> </div> </div> </div> <h2 className="mt-8 bg-silver-text bg-clip-text font-serif text-5xl tracking-[-0.03em] text-transparent md:text-6xl"> {title} </h2> <p className="mt-5 max-w-xl text-lead text-secondary">{description}</p> </Reveal> </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"; export default function GlossyIconSectionHeader({ title = "Everything within your reach", description = "All the tools you need to run your delivery pipeline, inspect detailed traces, and keep your sender health strong, minus the busywork.", glow = "var(--color-obsidian-accent-green)", }: { title?: string; description?: string; glow?: string; }) { return ( <section className="relative bg-background px-6 py-20 text-center"> <Reveal from="up" duration={500} className="mx-auto flex max-w-2xl flex-col items-center"> <div className="relative h-[170px] w-[170px]" role="img" aria-label="Glossy glass app icon with a glowing sphere" > <div className="absolute inset-x-6 bottom-2 h-10 rounded-full opacity-70 blur-2xl" style={{ background: glow }} /> <div className="relative mx-auto mt-3 flex h-[146px] w-[146px] items-center justify-center rounded-[34px] border border-border bg-gradient-to-b from-muted to-card shadow-obsidian-card-soft overflow-hidden"> <div className="absolute inset-0 bg-[radial-gradient(70%_50%_at_50%_100%,var(--color-obsidian-accent-green),transparent)] opacity-40" /> <div className="relative h-20 w-20 rounded-full bg-[radial-gradient(circle_at_30%_25%,#4a4d4f,#0a0a0a_60%)] shadow-[inset_0_0_14px_rgba(255,255,255,0.18),0_6px_22px_rgba(0,0,0,0.8)]"> <div className="absolute left-4 top-3 h-4 w-8 rotate-[-25deg] rounded-full bg-foreground/20 blur-[3px]" /> </div> </div> </div> <h2 className="mt-8 bg-clip-text font-sans text-5xl tracking-[-0.03em] text-transparent md:text-6xl"> {title} </h2> <p className="mt-5 max-w-xl text-obsidian-lead text-muted-foreground">{description}</p> </Reveal> </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.