Motion & effects / Animated graphics
Paper Orbit Illustration Card
Cream grainy 3:4 card with blurred concentric grey rings and thin-line globe with dots, reads as soft tactile paper.
Rebuilt from mercury.com in the Twilight Ledger style.
npx shadcn@latest add https://justyoink.it/r/twilight-ledger-0e1ecf/blocks/cream-orbit-illustration.json
Looks exactly like mercury.com: brings its fonts and colours, namespaced so your own theme stays untouched.
npx shadcn@latest add https://justyoink.it/r/twilight-ledger-0e1ecf/mine/cream-orbit-illustration.json
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, cardLabel, heading, body, linkLabel, others (string[]). Renders standalone; globe rotation and ring pulse are CSS and pause under reduced motion.
components/cream-orbit-illustration.tsx
"use client"; import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; export default function PaperOrbitIllustrationCard({ title = "Keep more of every dollar. Put the savings to work on what comes next.", cardLabel = "Illustration of a thin-line globe inside soft concentric rings", heading = "Send fee-free payments across borders", body = "No charge to move money by wire, transfer, or instant payout.", linkLabel = "Learn about payments", others = ["Earn steady cashback on every card purchase", "Grow idle balances with a managed reserve"] }: { title?: string; cardLabel?: string; heading?: string; body?: string; linkLabel?: string; others?: string[] }) { return ( <section className="bg-canvas px-5 py-16 text-ink md:py-24"> <style>{` @keyframes po-spin{from{transform:rotateY(0)}to{transform:rotateY(360deg)}} @keyframes po-pulse{0%,100%{transform:scale(1);opacity:.9}50%{transform:scale(1.04);opacity:.6}} @media (prefers-reduced-motion: reduce){.po-a{animation:none!important}} `}</style> <div className="mx-auto grid max-w-[1024px] gap-10 md:grid-cols-2 md:gap-16"> <Reveal from="up" distance={50} delay={150} duration={670}> <div role="img" aria-label={cardLabel} className="relative mx-auto aspect-[3/4] w-full max-w-[480px] overflow-hidden rounded-md bg-[#f8f7f3]"> {[88, 68, 48, 30].map((s, i) => ( <div key={s} className="po-a absolute left-1/2 top-1/2 rounded-full" style={{ width: `${s * 1.3}%`, aspectRatio: "1", marginLeft: `-${s * 0.65}%`, marginTop: `-${s * 0.65}%`, background: i === 3 ? "radial-gradient(circle,#f3f2ea 60%,#e3e6e0)" : "radial-gradient(circle,transparent 55%,rgba(150,160,155,.28) 78%,transparent 100%)", filter: "blur(6px)", animation: `po-pulse ${6 + i}s ease-in-out ${i * 0.8}s infinite` }} /> ))} <div className="absolute left-1/2 top-1/2 h-[40%] w-[50%] -translate-x-1/2 -translate-y-1/2" style={{ perspective: 600 }}> <svg viewBox="0 0 120 120" className="po-a h-full w-full" style={{ animation: "po-spin 24s linear infinite" }} fill="none" stroke="#2a2a33" strokeWidth="0.6"> <circle cx="60" cy="60" r="58" /> <ellipse cx="60" cy="60" rx="40" ry="58" /> <ellipse cx="60" cy="60" rx="32" ry="58" /> <line x1="60" y1="2" x2="60" y2="118" /> <g fill="#2a2a33" stroke="none"><circle cx="60" cy="34" r="1.6" /><circle cx="60" cy="84" r="1.6" /><circle cx="30" cy="28" r="1.6" /><circle cx="92" cy="66" r="1.6" /></g> </svg> </div> <div className="pointer-events-none absolute inset-0 opacity-30 mix-blend-multiply" style={{ backgroundImage: "url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.5'/></svg>\")" }} /> </div> </Reveal> <Reveal from="up" distance={50} delay={150} duration={670} className="flex flex-col justify-between gap-16"> <h2 className="text-h3 font-display text-ink">{title}</h2> <div> <div className="relative border-t border-ink/70 pt-5"> <span className="absolute -left-4 top-6 h-2 w-2 rounded-full bg-accent" /> <h3 className="text-body text-ink">{heading}</h3> <p className="mt-1 max-w-[420px] text-body text-ink-muted">{body}</p> <a href="#" className="mt-6 inline-block border-b border-ink-muted text-body text-ink-muted transition-colors duration-hover-wash hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent">{linkLabel}</a> </div> <ul className="mt-6"> {others.map((o) => ( <li key={o} className="border-t border-hairline py-3 text-body text-ink-muted">{o}</li> ))} </ul> </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 { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; export default function PaperOrbitIllustrationCard({ title = "Keep more of every dollar. Put the savings to work on what comes next.", cardLabel = "Illustration of a thin-line globe inside soft concentric rings", heading = "Send fee-free payments across borders", body = "No charge to move money by wire, transfer, or instant payout.", linkLabel = "Learn about payments", others = ["Earn steady cashback on every card purchase", "Grow idle balances with a managed reserve"] }: { title?: string; cardLabel?: string; heading?: string; body?: string; linkLabel?: string; others?: string[] }) { return ( <section className="bg-background px-5 py-16 text-foreground md:py-24"> <style>{` @keyframes po-spin{from{transform:rotateY(0)}to{transform:rotateY(360deg)}} @keyframes po-pulse{0%,100%{transform:scale(1);opacity:.9}50%{transform:scale(1.04);opacity:.6}} @media (prefers-reduced-motion: reduce){.po-a{animation:none!important}} `}</style> <div className="mx-auto grid max-w-[1024px] gap-10 md:grid-cols-2 md:gap-16"> <Reveal from="up" distance={50} delay={150} duration={670}> <div role="img" aria-label={cardLabel} className="relative mx-auto aspect-[3/4] w-full max-w-[480px] overflow-hidden rounded-lg bg-[#f8f7f3]"> {[88, 68, 48, 30].map((s, i) => ( <div key={s} className="po-a absolute left-1/2 top-1/2 rounded-full" style={{ width: `${s * 1.3}%`, aspectRatio: "1", marginLeft: `-${s * 0.65}%`, marginTop: `-${s * 0.65}%`, background: i === 3 ? "radial-gradient(circle,#f3f2ea 60%,#e3e6e0)" : "radial-gradient(circle,transparent 55%,rgba(150,160,155,.28) 78%,transparent 100%)", filter: "blur(6px)", animation: `po-pulse ${6 + i}s ease-in-out ${i * 0.8}s infinite` }} /> ))} <div className="absolute left-1/2 top-1/2 h-[40%] w-[50%] -translate-x-1/2 -translate-y-1/2" style={{ perspective: 600 }}> <svg viewBox="0 0 120 120" className="po-a h-full w-full" style={{ animation: "po-spin 24s linear infinite" }} fill="none" stroke="#2a2a33" strokeWidth="0.6"> <circle cx="60" cy="60" r="58" /> <ellipse cx="60" cy="60" rx="40" ry="58" /> <ellipse cx="60" cy="60" rx="32" ry="58" /> <line x1="60" y1="2" x2="60" y2="118" /> <g fill="#2a2a33" stroke="none"><circle cx="60" cy="34" r="1.6" /><circle cx="60" cy="84" r="1.6" /><circle cx="30" cy="28" r="1.6" /><circle cx="92" cy="66" r="1.6" /></g> </svg> </div> <div className="pointer-events-none absolute inset-0 opacity-30 mix-blend-multiply" style={{ backgroundImage: "url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.5'/></svg>\")" }} /> </div> </Reveal> <Reveal from="up" distance={50} delay={150} duration={670} className="flex flex-col justify-between gap-16"> <h2 className="text-twilight-h3 font-sans text-foreground">{title}</h2> <div> <div className="relative border-t border-foreground/70 pt-5"> <span className="absolute -left-4 top-6 h-2 w-2 rounded-full bg-primary" /> <h3 className="text-twilight-body text-foreground">{heading}</h3> <p className="mt-1 max-w-[420px] text-twilight-body text-muted-foreground">{body}</p> <a href="#" className="mt-6 inline-block border-b border-muted-foreground text-twilight-body text-muted-foreground transition-colors duration-twilight-hover-wash hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary">{linkLabel}</a> </div> <ul className="mt-6"> {others.map((o) => ( <li key={o} className="border-t border-border py-3 text-twilight-body text-muted-foreground">{o}</li> ))} </ul> </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 · 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: not passed2 hard-coded colours (bg-[#f8f7f3], #2a2a33). These ignore the theme and break dark mode.
- Animates cleanly: not passedStays invisible after its animation: <div>Stays invisible after its animation: <div> "Keep more of every dollar. Put the savin"