Cards & content / Media & mockups
Dark Glass Account Panel Mockup
Code-drawn banking UI: rounded 12px dark panel with account rows (round emblem icons, balances with dimmed cents), '+' and menu circular buttons, and footer notification strip with accent toggle pill. Sits on a blurred larger frosted slab.
Rebuilt from mercury.com in the Twilight Ledger style.
Looks exactly like mercury.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, accounts (name, dollars, cents), moreCount, notice, actionLabel. Renders standalone on a canvas background; the panel slides in from the right over 600ms and a cursor icon pulses a click on the action link.
components/app-window-mock.tsx
"use client"; import { useLayoutEffect, useRef, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; import { useEffect, useState } from "react"; type Account = { name: string; dollars: string; cents: string }; type Props = { title?: string; accounts?: Account[]; moreCount?: number; notice?: string; actionLabel?: string; }; const defaultAccounts: Account[] = [ { name: "Everyday Spend", dollars: "$14,820", cents: "40" }, { name: "Reserve", dollars: "$120,000", cents: "00" }, { name: "Payroll", dollars: "$986,114", cents: "27" }, { name: "Vendors", dollars: "$88,903", cents: "15" }, { name: "Receivables", dollars: "$7,264", cents: "09" }, ]; function Emblem() { return ( <span className="flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-ink-muted/50 bg-glass-fill"> <svg viewBox="0 0 24 24" className="h-5 w-5 text-ink-muted" fill="none" stroke="currentColor" strokeWidth="1"> <circle cx="12" cy="12" r="9" /> <circle cx="12" cy="12" r="5" /> <circle cx="12" cy="12" r="1.6" /> <path d="M12 3v4M12 17v4M3 12h4M17 12h4" /> </svg> </span> ); } export default function DarkGlassAccountPanelMockup({ title = "Accounts", accounts = defaultAccounts, moreCount = 4, notice = "2 scheduled sweeps touch your accounts", actionLabel = "Review", }: Props) { const [click, setClick] = useState(false); useEffect(() => { const id = setInterval(() => setClick((c) => !c), 1400); return () => clearInterval(id); }, []); return ( <div className="relative w-full overflow-hidden bg-canvas p-4 md:p-10"> <Reveal from="right" duration={600} distance={80}> <div className="relative mx-auto max-w-[680px]"> <div className="absolute -inset-x-4 -inset-y-8 rounded-xl border border-hairline bg-surface/60 blur-[2px]" aria-hidden /> <div className="absolute -bottom-20 left-0 h-28 w-[42%] rounded-xl border border-hairline bg-surface/50 blur-[1px]" aria-hidden /> <div className="absolute -bottom-20 right-8 h-28 w-[45%] rounded-xl border border-hairline bg-surface/50 blur-[1px]" aria-hidden /> <div className="relative mx-auto w-full max-w-[472px] overflow-hidden rounded-[12px] border border-hairline bg-surface shadow-float"> <div className="flex items-center justify-between px-6 pt-6"> <h3 className="text-body text-ink-muted">{title}</h3> <div className="flex items-center gap-4"> <button aria-label="Add account" className="flex h-8 w-8 items-center justify-center rounded-full bg-glass-fill text-ink hover:bg-hover-wash focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent">+</button> <button aria-label="More options" className="flex h-8 w-8 items-center justify-center rounded-full text-ink-muted hover:bg-hover-wash focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent"> <svg viewBox="0 0 4 14" className="h-3 w-1" fill="currentColor"><circle cx="2" cy="2" r="1.2" /><circle cx="2" cy="7" r="1.2" /><circle cx="2" cy="12" r="1.2" /></svg> </button> </div> </div> <ul className="px-6 py-4"> {accounts.map((a) => ( <li key={a.name} className="flex h-11 items-center gap-3 text-body text-ink"> <Emblem /> <span className="flex-1 truncate">{a.name}</span> <span className="tabular-nums">{a.dollars}<sup className="ml-px text-[10px] text-ink-subtle">.{a.cents}</sup></span> </li> ))} <li className="flex h-11 items-center gap-3 text-body text-ink"> <span className="flex h-7 w-7 items-center justify-center rounded-full bg-glass-fill text-[10px] text-ink-muted">+{moreCount}</span> <span>View all accounts</span> </li> </ul> <div className="relative flex items-center justify-between border-t border-hairline px-6 py-5 text-label text-ink-muted"> <span className="flex items-center gap-3"> <span className="flex h-3 w-6 items-center rounded-pill bg-accent/80 pl-0.5"><span className="h-2.5 w-2.5 rounded-full bg-ink" /></span> {notice} </span> <span className="relative flex items-center gap-1 text-accent"> {actionLabel} <svg viewBox="0 0 6 10" className="h-2.5 w-1.5" fill="none" stroke="currentColor" strokeWidth="1.5"><path d="M1 1l4 4-4 4" /></svg> <svg aria-hidden viewBox="0 0 16 20" className={`absolute left-3 top-3 h-5 w-4 text-ink transition-transform duration-300 ${click ? "scale-90" : "scale-100"}`} fill="currentColor" stroke="#000" strokeWidth="1" > <path d="M5 1.5a1.2 1.2 0 012.4 0V8l1-.3a1.2 1.2 0 011.5.8l.9-.2a1.2 1.2 0 011.4 1l.8-.1c.8 0 1.4.7 1.3 1.5l-.4 4.6c-.2 2-1.7 3.2-3.6 3.2H8c-1.200 0-2.300-.6-3-1.600L2 12.500a1.300 1.300 0 012-1.600L5 12z" /> </svg> {click && <span className="absolute -left-1 -top-1 h-5 w-5 animate-ping rounded-full bg-accent/40" />} </span> </div> </div> </div> </Reveal> </div> ); } // ---- 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, useRef, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; import { useEffect, useState } from "react"; type Account = { name: string; dollars: string; cents: string }; type Props = { title?: string; accounts?: Account[]; moreCount?: number; notice?: string; actionLabel?: string; }; const defaultAccounts: Account[] = [ { name: "Everyday Spend", dollars: "$14,820", cents: "40" }, { name: "Reserve", dollars: "$120,000", cents: "00" }, { name: "Payroll", dollars: "$986,114", cents: "27" }, { name: "Vendors", dollars: "$88,903", cents: "15" }, { name: "Receivables", dollars: "$7,264", cents: "09" }, ]; function Emblem() { return ( <span className="flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-muted-foreground/50 bg-secondary"> <svg viewBox="0 0 24 24" className="h-5 w-5 text-muted-foreground" fill="none" stroke="currentColor" strokeWidth="1"> <circle cx="12" cy="12" r="9" /> <circle cx="12" cy="12" r="5" /> <circle cx="12" cy="12" r="1.6" /> <path d="M12 3v4M12 17v4M3 12h4M17 12h4" /> </svg> </span> ); } export default function DarkGlassAccountPanelMockup({ title = "Accounts", accounts = defaultAccounts, moreCount = 4, notice = "2 scheduled sweeps touch your accounts", actionLabel = "Review", }: Props) { const [click, setClick] = useState(false); useEffect(() => { const id = setInterval(() => setClick((c) => !c), 1400); return () => clearInterval(id); }, []); return ( <div className="relative w-full overflow-hidden bg-background p-4 md:p-10"> <Reveal from="right" duration={600} distance={80}> <div className="relative mx-auto max-w-[680px]"> <div className="absolute -inset-x-4 -inset-y-8 rounded-2xl border border-border bg-card/60 blur-[2px]" aria-hidden /> <div className="absolute -bottom-20 left-0 h-28 w-[42%] rounded-2xl border border-border bg-card/50 blur-[1px]" aria-hidden /> <div className="absolute -bottom-20 right-8 h-28 w-[45%] rounded-2xl border border-border bg-card/50 blur-[1px]" aria-hidden /> <div className="relative mx-auto w-full max-w-[472px] overflow-hidden rounded-[12px] border border-border bg-card shadow-twilight-float"> <div className="flex items-center justify-between px-6 pt-6"> <h3 className="text-twilight-body text-muted-foreground">{title}</h3> <div className="flex items-center gap-4"> <button aria-label="Add account" className="flex h-8 w-8 items-center justify-center rounded-full bg-secondary text-primary-foreground hover:bg-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary">+</button> <button aria-label="More options" className="flex h-8 w-8 items-center justify-center rounded-full text-primary-foreground hover:bg-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary"> <svg viewBox="0 0 4 14" className="h-3 w-1" fill="currentColor"><circle cx="2" cy="2" r="1.2" /><circle cx="2" cy="7" r="1.2" /><circle cx="2" cy="12" r="1.2" /></svg> </button> </div> </div> <ul className="px-6 py-4"> {accounts.map((a) => ( <li key={a.name} className="flex h-11 items-center gap-3 text-twilight-body text-foreground"> <Emblem /> <span className="flex-1 truncate">{a.name}</span> <span className="tabular-nums">{a.dollars}<sup className="ml-px text-[10px] text-muted-foreground">.{a.cents}</sup></span> </li> ))} <li className="flex h-11 items-center gap-3 text-twilight-body text-foreground"> <span className="flex h-7 w-7 items-center justify-center rounded-full bg-secondary text-[10px] text-muted-foreground">+{moreCount}</span> <span>View all accounts</span> </li> </ul> <div className="relative flex items-center justify-between border-t border-border px-6 py-5 text-twilight-label text-muted-foreground"> <span className="flex items-center gap-3"> <span className="flex h-3 w-6 items-center rounded-full bg-primary/80 pl-0.5"><span className="h-2.5 w-2.5 rounded-full bg-foreground" /></span> {notice} </span> <span className="relative flex items-center gap-1 text-primary"> {actionLabel} <svg viewBox="0 0 6 10" className="h-2.5 w-1.5" fill="none" stroke="currentColor" strokeWidth="1.5"><path d="M1 1l4 4-4 4" /></svg> <svg aria-hidden viewBox="0 0 16 20" className={`absolute left-3 top-3 h-5 w-4 text-foreground transition-transform duration-300 ${click ? "scale-90" : "scale-100"}`} fill="currentColor" stroke="#000" strokeWidth="1" > <path d="M5 1.5a1.2 1.2 0 012.4 0V8l1-.3a1.2 1.2 0 011.5.8l.9-.2a1.2 1.2 0 011.4 1l.8-.1c.8 0 1.4.7 1.3 1.5l-.4 4.6c-.2 2-1.7 3.2-3.6 3.2H8c-1.200 0-2.300-.6-3-1.600L2 12.500a1.300 1.300 0 012-1.600L5 12z" /> </svg> {click && <span className="absolute -left-1 -top-1 h-5 w-5 animate-ping rounded-full bg-primary/40" />} </span> </div> </div> </div> </Reveal> </div> ); } // ---- 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 passed1 hard-coded colour (#000). These ignore the theme and break dark mode.
- Animates cleanly: not passedKeeps animating when reduced motion is turned on