Page sections / Blog & articles
Photo Banner with Collaborator Sidebar
Article layout: a wide 1340×738 photo banner with a light 32px overlay statement in the right half, then a two-column body with a left 'Research Collaborators' rail of circular avatars/logos and names, and a narrow right column of bold question lead-ins, body paragraphs, and sub/superscript footnotes.
Rebuilt from seed.com/seedlabs 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: index, title, imageSrc, statement, railLabel, collaborators (name + mark shape), lead and paragraphs. Renders standalone with defaults; footnote numbers link to #ref-N anchors.
components/research-feature-panel.tsx
"use client"; import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; type Collaborator = { name: string; role?: string; mark: "circle" | "square" | "ring" | "dots" }; type Props = { index?: string; title?: string; imageSrc?: string; statement?: string; railLabel?: string; collaborators?: Collaborator[]; lead?: string; paragraphs?: string[]; }; function Mark({ kind, initials }: { kind: Collaborator["mark"]; initials: string }) { const bg = kind === "circle" ? "bg-forest-soft" : kind === "square" ? "bg-lemongrass" : kind === "ring" ? "bg-faded-green" : "bg-lime-highlight"; return ( <span aria-hidden="true" className={`flex h-[70px] w-[70px] shrink-0 items-center justify-center overflow-hidden rounded-pill text-label text-ink ${bg}`}> <svg viewBox="0 0 40 40" className="h-9 w-9" fill="none" stroke="currentColor" strokeWidth="2"> {kind === "circle" && <circle cx="20" cy="20" r="12" />} {kind === "square" && <rect x="9" y="9" width="22" height="22" rx="4" />} {kind === "ring" && (<><circle cx="20" cy="20" r="13" /><circle cx="20" cy="20" r="5" /></>)} {kind === "dots" && (<><circle cx="13" cy="14" r="4" /><circle cx="26" cy="18" r="5" /><circle cx="16" cy="28" r="3" /></>)} </svg> <span className="sr-only">{initials}</span> </span> ); } export default function PhotoBannerWithCollaboratorSidebar({ index = "02", title = "Kelp", imageSrc = "https://yoink-app.fly.dev/stock/nature-2.jpg", statement = "Studying seaweed farms to restore coastal waters.", railLabel = "Field Partners", collaborators = [ { name: "Dr. Mara Lindqvist, Marine Ecology, Northwind Institute", mark: "circle" }, { name: "The Altura Tide Program", mark: "square" }, { name: "Kitefield Shoreline Lab", mark: "ring" }, { name: "Lumen Citizen Science", mark: "dots" }, ], lead = "Can cultivated seaweed help clean our bays?", paragraphs = [ "Coastal bays are among the busiest habitats on the planet. They shelter young fish, filter runoff and cushion towns from storms, yet many have grown murky in recent years.", "Kelp is a fast-growing alga that absorbs excess nitrogen straight from the water. Small test plots show clearer water within a single season, and nearby shellfish beds tend to recover too.", "Our team began mapping pilot sites last spring, pairing local fishers with university researchers. Together they track temperature, salinity and growth every week, and share the results openly.", ], }: Props) { return ( <section className="bg-canvas font-sans text-ink"> <div className="mx-auto max-w-[1340px] px-5 md:px-0"> <header className="flex flex-col gap-2 border-t border-ink pt-6 md:grid md:grid-cols-[1fr_auto_1fr] md:gap-0"> <span className="text-h1 font-light">{index}</span> <h2 className="text-h1 font-light">{title}</h2> <span /> </header> <Reveal from="scale" className="mt-12"> <div className="relative aspect-[4/5] overflow-hidden sm:aspect-video"> <img src={imageSrc} alt="Close-up of a green leaf covered in water drops" width={1340} height={738} className="absolute inset-0 h-full w-full object-cover" /> <div className="absolute inset-0 bg-hero-side-scrim" /> <p className="absolute bottom-8 left-6 right-6 text-h2 font-light text-canvas md:bottom-auto md:left-auto md:right-12 md:top-1/2 md:w-[45%] md:-translate-y-1/2" style={{ fontSize: 32, lineHeight: 1.25 }}> {statement} </p> </div> </Reveal> <div className="mt-16 grid gap-10 pb-20 md:grid-cols-[348px_minmax(0,640px)]"> <aside aria-label={railLabel}> <h3 className="text-label font-semibold">{railLabel}</h3> <ul className="mt-10 space-y-3"> {collaborators.map((c) => ( <li key={c.name} className="flex items-center gap-5"> <Mark kind={c.mark} initials={c.name.slice(0, 2)} /> <span className="text-body">{c.name}</span> </li> ))} </ul> </aside> <div className="space-y-6 text-body"> <p className="font-semibold">{lead}</p> {paragraphs.map((p, i) => ( <p key={i} className="leading-6"> {p} <sup className="ml-0.5 text-caption"> <a href={`#ref-${i + 1}`} className="underline transition-colors duration-ui-hover ease-ui-hover hover:text-ink-50 focus-visible:outline focus-visible:outline-2">{i + 1}</a> </sup> </p> ))} </div> </div> </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 Collaborator = { name: string; role?: string; mark: "circle" | "square" | "ring" | "dots" }; type Props = { index?: string; title?: string; imageSrc?: string; statement?: string; railLabel?: string; collaborators?: Collaborator[]; lead?: string; paragraphs?: string[]; }; function Mark({ kind, initials }: { kind: Collaborator["mark"]; initials: string }) { const bg = kind === "circle" ? "bg-foreground" : kind === "square" ? "bg-muted" : kind === "ring" ? "bg-foreground" : "bg-verdant-lime-highlight"; return ( <span aria-hidden="true" className={`flex h-[70px] w-[70px] shrink-0 items-center justify-center overflow-hidden rounded-full text-verdant-label text-foreground ${bg}`}> <svg viewBox="0 0 40 40" className="h-9 w-9" fill="none" stroke="currentColor" strokeWidth="2"> {kind === "circle" && <circle cx="20" cy="20" r="12" />} {kind === "square" && <rect x="9" y="9" width="22" height="22" rx="4" />} {kind === "ring" && (<><circle cx="20" cy="20" r="13" /><circle cx="20" cy="20" r="5" /></>)} {kind === "dots" && (<><circle cx="13" cy="14" r="4" /><circle cx="26" cy="18" r="5" /><circle cx="16" cy="28" r="3" /></>)} </svg> <span className="sr-only">{initials}</span> </span> ); } export default function PhotoBannerWithCollaboratorSidebar({ index = "02", title = "Kelp", imageSrc = "https://yoink-app.fly.dev/stock/nature-2.jpg", statement = "Studying seaweed farms to restore coastal waters.", railLabel = "Field Partners", collaborators = [ { name: "Dr. Mara Lindqvist, Marine Ecology, Northwind Institute", mark: "circle" }, { name: "The Altura Tide Program", mark: "square" }, { name: "Kitefield Shoreline Lab", mark: "ring" }, { name: "Lumen Citizen Science", mark: "dots" }, ], lead = "Can cultivated seaweed help clean our bays?", paragraphs = [ "Coastal bays are among the busiest habitats on the planet. They shelter young fish, filter runoff and cushion towns from storms, yet many have grown murky in recent years.", "Kelp is a fast-growing alga that absorbs excess nitrogen straight from the water. Small test plots show clearer water within a single season, and nearby shellfish beds tend to recover too.", "Our team began mapping pilot sites last spring, pairing local fishers with university researchers. Together they track temperature, salinity and growth every week, and share the results openly.", ], }: Props) { return ( <section className="bg-background font-sans text-foreground"> <div className="mx-auto max-w-[1340px] px-5 md:px-0"> <header className="flex flex-col gap-2 border-t border-foreground pt-6 md:grid md:grid-cols-[1fr_auto_1fr] md:gap-0"> <span className="text-verdant-h1 font-light">{index}</span> <h2 className="text-verdant-h1 font-light">{title}</h2> <span /> </header> <Reveal from="scale" className="mt-12"> <div className="relative aspect-[4/5] overflow-hidden sm:aspect-video"> <img src={imageSrc} alt="Close-up of a green leaf covered in water drops" width={1340} height={738} className="absolute inset-0 h-full w-full object-cover" /> <div className="absolute inset-0 " /> <p className="absolute bottom-8 left-6 right-6 text-verdant-h2 font-light text-background md:bottom-auto md:left-auto md:right-12 md:top-1/2 md:w-[45%] md:-translate-y-1/2" style={{ fontSize: 32, lineHeight: 1.25 }}> {statement} </p> </div> </Reveal> <div className="mt-16 grid gap-10 pb-20 md:grid-cols-[348px_minmax(0,640px)]"> <aside aria-label={railLabel}> <h3 className="text-verdant-label font-semibold">{railLabel}</h3> <ul className="mt-10 space-y-3"> {collaborators.map((c) => ( <li key={c.name} className="flex items-center gap-5"> <Mark kind={c.mark} initials={c.name.slice(0, 2)} /> <span className="text-verdant-body">{c.name}</span> </li> ))} </ul> </aside> <div className="space-y-6 text-verdant-body"> <p className="font-semibold">{lead}</p> {paragraphs.map((p, i) => ( <p key={i} className="leading-6"> {p} <sup className="ml-0.5 text-verdant-caption"> <a href={`#ref-${i + 1}`} className="underline transition-colors duration-verdant-ui-hover ease-verdant-ui-hover hover:text-muted-foreground focus-visible:outline focus-visible:outline-2">{i + 1}</a> </sup> </p> ))} </div> </div> </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: 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.