Page sections / Feature sections
Split Feature Panel with Tinted Media Well
Wide #f2f1ed container with hairline ring, text column vertically centered (ink title with muted-gray sentence directly beneath, orange arrow link) beside a large tinted media well holding a mockup or photo. Alternates sides down the page; wells use stone, slate or painterly backdrops.
Rebuilt from cursor.com in the Warm Paper Editorial style.
Looks exactly like cursor.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, linkLabel, linkHref, imageSrc (stock default) and reverse to flip sides. Mockup rows fade in with a 5px rise once scrolled into view.
components/split-feature-panel.tsx
"use client"; import { useLayoutEffect, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; import { useEffect, useRef, useState } from "react"; type Props = { title?: string; description?: string; linkLabel?: string; linkHref?: string; imageSrc?: string; reverse?: boolean; }; const week = ["Quarterly Insights Board", "Live Metrics Stream", "Zero-Downtime Releases"]; const month = ["Schema Migration Helper", "Edge Cache Warmup", "Token Rotation Job"]; export default function SplitFeaturePanelTintedMedia({ title = "Plans ahead, works in the background", description = "Assistants spin up their own workspaces to draft, check, and present changes so you can simply review the result.", linkLabel = "Explore background assistants", linkHref = "#", imageSrc = "https://yoink-app.fly.dev/stock/landscape-2.jpg", reverse = false, }: Props) { const ref = useRef<HTMLDivElement>(null); const [seen, setSeen] = useState(false); useEffect(() => { const el = ref.current; if (!el) return; const io = new IntersectionObserver(([e]) => { if (e.isIntersecting) { setSeen(true); io.disconnect(); } }, { threshold: 0.2 }); io.observe(el); return () => io.disconnect(); }, []); const row = (i: number) => ({ style: { transitionDelay: `${i * 140}ms` }, className: `transition-all duration-500 ease-out motion-reduce:transition-none ${seen ? "opacity-100 translate-y-0" : "opacity-0 translate-y-[5px]"}`, }); return ( <section className="bg-canvas p-4 font-sans"> <div className={`mx-auto grid max-w-[1300px] items-center gap-8 rounded-lg bg-surface p-4 shadow-hairline-ring lg:grid-cols-[840fr_400fr] lg:gap-10 ${reverse ? "lg:[&>*:first-child]:order-2 lg:grid-cols-[400fr_840fr]" : ""}`}> <div ref={ref} className="flex items-center justify-center rounded-md bg-media-slate p-4 sm:p-10 lg:p-12"> <div className="w-full overflow-hidden rounded-lg bg-surface shadow-window"> <div className="flex items-center gap-3 border-b border-hairline px-4 py-3"> <div className="flex gap-2" aria-hidden> <span className="h-2.5 w-2.5 rounded-pill bg-hairline" /> <span className="h-2.5 w-2.5 rounded-pill bg-hairline" /> <span className="h-2.5 w-2.5 rounded-pill bg-hairline" /> </div> <div className="mx-auto w-3/5 rounded-md bg-surface-sunken py-1 text-center text-product-micro text-ink-muted">example.app/assistant</div> </div> <div className="grid grid-cols-[34%_1fr]"> <aside className="hidden min-h-[440px] border-r border-hairline p-3 sm:block"> <div className="mb-4 h-4 w-4 rounded-xs bg-ink" aria-hidden /> <p className="mb-1 text-product-micro text-ink-faint">This Week</p> {week.map((w, i) => ( <div key={w} {...row(i)} className={`${row(i).className} mb-1 rounded-md px-2 py-1.5 text-product-micro text-ink ${i === 0 ? "bg-surface-sunken" : ""}`}>{w}</div> ))} <p className="mb-1 mt-4 text-product-micro text-ink-faint">This Month</p> {month.map((w, i) => ( <div key={w} {...row(i + 3)} className={`${row(i + 3).className} mb-1 px-2 py-1.5 text-product-micro text-ink`}>{w}</div> ))} </aside> <div className="col-span-2 space-y-3 p-4 sm:col-span-1"> <p className="text-product-micro text-ink">Quarterly Insights Board</p> <div {...row(1)} className={`${row(1).className} rounded-md border border-hairline bg-surface-sunken px-3 py-2 text-product-micro text-ink`}>let's build a board that makes our findings interactive</div> <p {...row(2)} className={`${row(2).className} text-product-micro text-ink`}>On it. I'll set up the charts, connect the data, and add sharing controls.</p> <p {...row(3)} className={`${row(3).className} animate-shimmer bg-shimmer-sweep bg-clip-text text-product-micro text-ink-muted`}>Worked for 9m 40s</p> <div {...row(4)} className={`${row(4).className} overflow-hidden rounded-md`}> <img src={imageSrc} alt="Preview of the finished board" width={292} height={164} loading="lazy" className="aspect-video w-full max-w-[292px] object-cover" /> </div> <p {...row(5)} className={`${row(5).className} text-product-micro text-ink`}>Summary: built the board with live charts and deployed it to staging.</p> <div {...row(6)} className={`${row(6).className} rounded-md border border-hairline p-3 text-product-micro text-ink-faint`}>Add a follow up...</div> </div> </div> </div> </div> <Reveal from="up" className="px-2 pb-4 lg:px-0 lg:pb-0"> <h3 className="text-lead text-ink">{title}</h3> <p className="text-lead text-ink-muted">{description}</p> <a href={linkHref} className="mt-5 inline-block text-ui text-accent transition-opacity duration-hover-color ease-hover-color hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent">{linkLabel} →</a> </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, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; import { useEffect, useRef, useState } from "react"; type Props = { title?: string; description?: string; linkLabel?: string; linkHref?: string; imageSrc?: string; reverse?: boolean; }; const week = ["Quarterly Insights Board", "Live Metrics Stream", "Zero-Downtime Releases"]; const month = ["Schema Migration Helper", "Edge Cache Warmup", "Token Rotation Job"]; export default function SplitFeaturePanelTintedMedia({ title = "Plans ahead, works in the background", description = "Assistants spin up their own workspaces to draft, check, and present changes so you can simply review the result.", linkLabel = "Explore background assistants", linkHref = "#", imageSrc = "https://yoink-app.fly.dev/stock/landscape-2.jpg", reverse = false, }: Props) { const ref = useRef<HTMLDivElement>(null); const [seen, setSeen] = useState(false); useEffect(() => { const el = ref.current; if (!el) return; const io = new IntersectionObserver(([e]) => { if (e.isIntersecting) { setSeen(true); io.disconnect(); } }, { threshold: 0.2 }); io.observe(el); return () => io.disconnect(); }, []); const row = (i: number) => ({ style: { transitionDelay: `${i * 140}ms` }, className: `transition-all duration-500 ease-out motion-reduce:transition-none ${seen ? "opacity-100 translate-y-0" : "opacity-0 translate-y-[5px]"}`, }); return ( <section className="bg-background p-4 font-sans"> <div className={`mx-auto grid max-w-[1300px] items-center gap-8 rounded-lg bg-card p-4 shadow-warm-hairline-ring lg:grid-cols-[840fr_400fr] lg:gap-10 ${reverse ? "lg:[&>*:first-child]:order-2 lg:grid-cols-[400fr_840fr]" : ""}`}> <div ref={ref} className="flex items-center justify-center rounded-md bg-muted p-4 sm:p-10 lg:p-12"> <div className="w-full overflow-hidden rounded-lg bg-card shadow-warm-window"> <div className="flex items-center gap-3 border-b border-border px-4 py-3"> <div className="flex gap-2" aria-hidden> <span className="h-2.5 w-2.5 rounded-full bg-border" /> <span className="h-2.5 w-2.5 rounded-full bg-border" /> <span className="h-2.5 w-2.5 rounded-full bg-border" /> </div> <div className="mx-auto w-3/5 rounded-md bg-muted py-1 text-center text-warm-product-micro text-muted-foreground">example.app/assistant</div> </div> <div className="grid grid-cols-[34%_1fr]"> <aside className="hidden min-h-[440px] border-r border-border p-3 sm:block"> <div className="mb-4 h-4 w-4 rounded-sm bg-foreground" aria-hidden /> <p className="mb-1 text-warm-product-micro text-muted-foreground">This Week</p> {week.map((w, i) => ( <div key={w} {...row(i)} className={`${row(i).className} mb-1 rounded-md px-2 py-1.5 text-warm-product-micro text-foreground ${i === 0 ? "bg-muted" : ""}`}>{w}</div> ))} <p className="mb-1 mt-4 text-warm-product-micro text-muted-foreground">This Month</p> {month.map((w, i) => ( <div key={w} {...row(i + 3)} className={`${row(i + 3).className} mb-1 px-2 py-1.5 text-warm-product-micro text-foreground`}>{w}</div> ))} </aside> <div className="col-span-2 space-y-3 p-4 sm:col-span-1"> <p className="text-warm-product-micro text-foreground">Quarterly Insights Board</p> <div {...row(1)} className={`${row(1).className} rounded-md border border-border bg-muted px-3 py-2 text-warm-product-micro text-foreground`}>let's build a board that makes our findings interactive</div> <p {...row(2)} className={`${row(2).className} text-warm-product-micro text-foreground`}>On it. I'll set up the charts, connect the data, and add sharing controls.</p> <p {...row(3)} className={`${row(3).className} animate-warm-shimmer bg-clip-text text-warm-product-micro text-muted-foreground`}>Worked for 9m 40s</p> <div {...row(4)} className={`${row(4).className} overflow-hidden rounded-md`}> <img src={imageSrc} alt="Preview of the finished board" width={292} height={164} loading="lazy" className="aspect-video w-full max-w-[292px] object-cover" /> </div> <p {...row(5)} className={`${row(5).className} text-warm-product-micro text-foreground`}>Summary: built the board with live charts and deployed it to staging.</p> <div {...row(6)} className={`${row(6).className} rounded-md border border-border p-3 text-warm-product-micro text-muted-foreground`}>Add a follow up...</div> </div> </div> </div> </div> <Reveal from="up" className="px-2 pb-4 lg:px-0 lg:pb-0"> <h3 className="text-warm-lead text-foreground">{title}</h3> <p className="text-warm-lead text-muted-foreground">{description}</p> <a href={linkHref} className="mt-5 inline-block text-warm-ui text-primary transition-opacity duration-warm-hover-color ease-warm-hover-color hover:opacity-75 focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary">{linkLabel} →</a> </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: not passedElements must meet minimum color contrast ratio thresholds (6 elements)
- 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: not passedStays invisible after its animation: <div> "Plans ahead, works in the background"Keeps animating when reduced motion is turned on