Motion & effects / Animated graphics
Hub-and-Spoke Integration Diagram
A rounded gray panel with a dark rounded-square hub in the center and white app icon tiles on both sides, joined by soft curved gray SVG lines. Below a hairline divider sits a 3-column list of icon-plus-title-plus-description rows.
Rebuilt from cal.com in the Warm Paper Calendar style.
Looks exactly like cal.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: badge, title, subtitle, hubLabel, and items (name, desc, color, glyph). The first five items appear as left tiles and the first six as right tiles; all items fill the 3-column list. Everything has defaults, so it renders with no props.
components/integration-hub-diagram.tsx
"use client"; import { useLayoutEffect, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; import { useEffect, useRef, useState } from "react"; type Item = { name: string; desc: string; color: string; glyph: string }; const defaultItems: Item[] = [ { name: "Northwind Mail", desc: "Sends a tidy recap to every attendee after each session.", color: "#3b82f6", glyph: "M" }, { name: "Kitefield Chat", desc: "Posts a short note to your channel on new sign-ups.", color: "#10b981", glyph: "K" }, { name: "Altura CRM", desc: "Keeps every contact record fresh and linked to its deal.", color: "#f97316", glyph: "A" }, { name: "Lumen Pay", desc: "Collects a deposit at the moment of reservation.", color: "#6366f1", glyph: "L" }, { name: "Orbit Sheets", desc: "Appends one row per event to a shared table.", color: "#22c55e", glyph: "O" }, { name: "Pebble Tasks", desc: "Creates a follow-up task for the right owner.", color: "#ec4899", glyph: "P" }, { name: "Harbor Files", desc: "Stores notes and documents beside each meeting.", color: "#0ea5e9", glyph: "H" }, { name: "Quill Notes", desc: "Drafts agendas ahead of time from past threads.", color: "#a855f7", glyph: "Q" }, { name: "Meridian Stats", desc: "Tracks page visits without cookies.", color: "#111827", glyph: "M" }, ]; function Tile({ it, size = 48, shown, delay }: { it: Item; size?: number; shown: boolean; delay: number }) { return ( <span className={"flex items-center justify-center rounded-xl bg-canvas shadow-ring-raised transition-all duration-500 ease-out " + (shown ? "opacity-100 translate-y-0" : "opacity-0 translate-y-2")} style={{ width: size, height: size, transitionDelay: delay + "ms" }} > <span className="flex h-6 w-6 items-center justify-center rounded-md text-[12px] font-bold text-white" style={{ background: it.color }}>{it.glyph}</span> </span> ); } export default function HubAndSpokeIntegrationDiagram({ badge = "Integrations", title = "Every workflow, wired to your calendar.", subtitle = "Link mail, chat and billing in minutes. Events flow wherever your crew works.", hubLabel = "Hub", items = defaultItems, }: { badge?: string; title?: string; subtitle?: string; hubLabel?: string; items?: Item[] }) { const ref = useRef<HTMLDivElement>(null); const [shown, setShown] = useState(false); useEffect(() => { const el = ref.current; if (!el) return; const io = new IntersectionObserver(([e]) => { if (e.isIntersecting) { setShown(true); io.disconnect(); } }, { threshold: 0.2 }); io.observe(el); return () => io.disconnect(); }, []); const left = items.slice(0, 5); const right = items.slice(0, 6).reverse(); const ly = [40, 108, 176, 244, 312].map((y) => y + 24); const ry = [0, 59, 118, 177, 236, 295].map((y) => y + 24 + 20); const cx = 500, cy = 210; return ( <section className="bg-canvas px-4 py-16 font-sans text-ink sm:px-8"> <div className="mx-auto max-w-6xl"> <Reveal from="up"> <span className="inline-block rounded-md bg-canvas px-3 py-1.5 text-ui shadow-ring-raised">{badge}</span> <h2 className="mt-6 max-w-2xl font-display text-h1 text-ink-deep">{title}</h2> <p className="mt-5 max-w-lg text-lead text-soft">{subtitle}</p> </Reveal> <div className="mt-8 flex gap-2"> <button className="rounded-md bg-ink px-4 py-2 text-ui text-canvas duration-color-transition ease-color-transition hover:bg-ink-deep focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2">Start now</button> <button className="rounded-md bg-canvas px-4 py-2 text-ui shadow-ring-raised duration-color-transition ease-color-transition hover:bg-panel focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2">Browse list</button> </div> <div ref={ref} className="mt-14 rounded-[32px] bg-panel p-6 shadow-hairline-inset sm:p-10"> <div className="relative mx-auto hidden w-full max-w-[1000px] sm:block" style={{ aspectRatio: "1000/420" }}> <svg viewBox="0 0 1000 420" className="absolute inset-0 h-full w-full" fill="none" aria-hidden> {ly.map((y, i) => ( <path key={"l" + i} d={`M 50 ${y} C 200 ${y}, 300 ${cy}, ${cx - 48} ${cy}`} stroke="#c9ccd1" strokeWidth="1.5" style={{ opacity: shown ? 1 : 0, transition: "opacity 700ms ease-out " + (60 + i * 120) + "ms" }} /> ))} {ry.map((y, i) => ( <path key={"r" + i} d={`M ${cx + 48} ${cy} C 700 ${cy}, 800 ${y}, 950 ${y}`} stroke="#c9ccd1" strokeWidth="1.5" style={{ opacity: shown ? 1 : 0, transition: "opacity 700ms ease-out " + (60 + i * 120) + "ms" }} /> ))} </svg> {left.map((it, i) => ( <div key={it.name} className="absolute" style={{ left: 0, top: ly[i] / 4.2 + "%", transform: "translateY(-50%)" }}> <Tile it={it} shown={shown} delay={300 + i * 150} /> </div> ))} {right.map((it, i) => ( <div key={it.name + "r"} className="absolute" style={{ right: 0, top: ry[i] / 4.2 + "%", transform: "translateY(-50%)" }}> <Tile it={it} shown={shown} delay={440 + i * 150} /> </div> ))} <div className={"absolute left-1/2 top-1/2 flex h-24 w-24 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-[22px] bg-ink-deep text-h3 font-display text-canvas shadow-soft transition-all duration-500 ease-out " + (shown ? "scale-100 opacity-100" : "scale-95 opacity-0")}>{hubLabel}</div> </div> <div className="my-0 border-t border-hairline sm:mt-12" /> <ul className="mt-10 grid gap-x-8 gap-y-8 sm:grid-cols-2 lg:grid-cols-3"> {items.map((it) => ( <li key={it.name} className="flex gap-4"> <span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-canvas shadow-ring-raised"> <span className="flex h-5 w-5 items-center justify-center rounded text-[10px] font-bold text-white" style={{ background: it.color }}>{it.glyph}</span> </span> <div> <p className="text-ui text-ink">{it.name}</p> <p className="mt-1 max-w-xs text-ui text-muted">{it.desc}</p> </div> </li> ))} </ul> </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 { useLayoutEffect, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; import { useEffect, useRef, useState } from "react"; type Item = { name: string; desc: string; color: string; glyph: string }; const defaultItems: Item[] = [ { name: "Northwind Mail", desc: "Sends a tidy recap to every attendee after each session.", color: "#3b82f6", glyph: "M" }, { name: "Kitefield Chat", desc: "Posts a short note to your channel on new sign-ups.", color: "#10b981", glyph: "K" }, { name: "Altura CRM", desc: "Keeps every contact record fresh and linked to its deal.", color: "#f97316", glyph: "A" }, { name: "Lumen Pay", desc: "Collects a deposit at the moment of reservation.", color: "#6366f1", glyph: "L" }, { name: "Orbit Sheets", desc: "Appends one row per event to a shared table.", color: "#22c55e", glyph: "O" }, { name: "Pebble Tasks", desc: "Creates a follow-up task for the right owner.", color: "#ec4899", glyph: "P" }, { name: "Harbor Files", desc: "Stores notes and documents beside each meeting.", color: "#0ea5e9", glyph: "H" }, { name: "Quill Notes", desc: "Drafts agendas ahead of time from past threads.", color: "#a855f7", glyph: "Q" }, { name: "Meridian Stats", desc: "Tracks page visits without cookies.", color: "#111827", glyph: "M" }, ]; function Tile({ it, size = 48, shown, delay }: { it: Item; size?: number; shown: boolean; delay: number }) { return ( <span className={"flex items-center justify-center rounded-2xl bg-background shadow-warm-ring-raised transition-all duration-500 ease-out " + (shown ? "opacity-100 translate-y-0" : "opacity-0 translate-y-2")} style={{ width: size, height: size, transitionDelay: delay + "ms" }} > <span className="flex h-6 w-6 items-center justify-center rounded-lg text-[12px] font-bold text-background" style={{ background: it.color }}>{it.glyph}</span> </span> ); } export default function HubAndSpokeIntegrationDiagram({ badge = "Integrations", title = "Every workflow, wired to your calendar.", subtitle = "Link mail, chat and billing in minutes. Events flow wherever your crew works.", hubLabel = "Hub", items = defaultItems, }: { badge?: string; title?: string; subtitle?: string; hubLabel?: string; items?: Item[] }) { const ref = useRef<HTMLDivElement>(null); const [shown, setShown] = useState(false); useEffect(() => { const el = ref.current; if (!el) return; const io = new IntersectionObserver(([e]) => { if (e.isIntersecting) { setShown(true); io.disconnect(); } }, { threshold: 0.2 }); io.observe(el); return () => io.disconnect(); }, []); const left = items.slice(0, 5); const right = items.slice(0, 6).reverse(); const ly = [40, 108, 176, 244, 312].map((y) => y + 24); const ry = [0, 59, 118, 177, 236, 295].map((y) => y + 24 + 20); const cx = 500, cy = 210; return ( <section className="bg-background px-4 py-16 font-sans text-foreground sm:px-8"> <div className="mx-auto max-w-6xl"> <Reveal from="up"> <span className="inline-block rounded-lg bg-background px-3 py-1.5 text-warm-ui shadow-warm-ring-raised">{badge}</span> <h2 className="mt-6 max-w-2xl font-sans text-warm-h1 text-muted-foreground">{title}</h2> <p className="mt-5 max-w-lg text-warm-lead text-muted-foreground">{subtitle}</p> </Reveal> <div className="mt-8 flex gap-2"> <button className="rounded-lg bg-foreground px-4 py-2 text-warm-ui text-background duration-warm-color-transition ease-warm-color-transition hover:bg-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2">Start now</button> <button className="rounded-lg bg-background px-4 py-2 text-warm-ui shadow-warm-ring-raised duration-warm-color-transition ease-warm-color-transition hover:bg-card focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2">Browse list</button> </div> <div ref={ref} className="mt-14 rounded-[32px] bg-card p-6 shadow-warm-hairline-inset sm:p-10"> <div className="relative mx-auto hidden w-full max-w-[1000px] sm:block" style={{ aspectRatio: "1000/420" }}> <svg viewBox="0 0 1000 420" className="absolute inset-0 h-full w-full" fill="none" aria-hidden> {ly.map((y, i) => ( <path key={"l" + i} d={`M 50 ${y} C 200 ${y}, 300 ${cy}, ${cx - 48} ${cy}`} stroke="#c9ccd1" strokeWidth="1.5" style={{ opacity: shown ? 1 : 0, transition: "opacity 700ms ease-out " + (60 + i * 120) + "ms" }} /> ))} {ry.map((y, i) => ( <path key={"r" + i} d={`M ${cx + 48} ${cy} C 700 ${cy}, 800 ${y}, 950 ${y}`} stroke="#c9ccd1" strokeWidth="1.5" style={{ opacity: shown ? 1 : 0, transition: "opacity 700ms ease-out " + (60 + i * 120) + "ms" }} /> ))} </svg> {left.map((it, i) => ( <div key={it.name} className="absolute" style={{ left: 0, top: ly[i] / 4.2 + "%", transform: "translateY(-50%)" }}> <Tile it={it} shown={shown} delay={300 + i * 150} /> </div> ))} {right.map((it, i) => ( <div key={it.name + "r"} className="absolute" style={{ right: 0, top: ry[i] / 4.2 + "%", transform: "translateY(-50%)" }}> <Tile it={it} shown={shown} delay={440 + i * 150} /> </div> ))} <div className={"absolute left-1/2 top-1/2 flex h-24 w-24 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-[22px] bg-foreground text-warm-h3 font-sans text-background shadow-warm-soft transition-all duration-500 ease-out " + (shown ? "scale-100 opacity-100" : "scale-95 opacity-0")}>{hubLabel}</div> </div> <div className="my-0 border-t border-border sm:mt-12" /> <ul className="mt-10 grid gap-x-8 gap-y-8 sm:grid-cols-2 lg:grid-cols-3"> {items.map((it) => ( <li key={it.name} className="flex gap-4"> <span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-background shadow-warm-ring-raised"> <span className="flex h-5 w-5 items-center justify-center rounded text-[10px] font-bold text-background" style={{ background: it.color }}>{it.glyph}</span> </span> <div> <p className="text-warm-ui text-foreground">{it.name}</p> <p className="mt-1 max-w-xs text-warm-ui text-muted-foreground">{it.desc}</p> </div> </li> ))} </ul> </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 · 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: not passed10 hard-coded colours (#3b82f6, #10b981, #f97316, #6366f1). These ignore the theme and break dark mode.
- Animates cleanly: not passedKeeps animating when reduced motion is turned on