Motion & effects / Animated graphics
Gradient-Outlined Odometer Pill
Rounded pill with a thin blue-to-pink gradient outline containing ghosted '8' segments and lit DSEG7 digits of a large running total, captioned with wide-tracked uppercase text in gradient colouring.
Rebuilt from vercel.com/solutions/turborepo in the Monochrome Precision style.
npx shadcn@latest add https://justyoink.it/r/monochrome-precision/blocks/seven-segment-counter.json
Looks exactly like vercel.com: brings its fonts and colours, namespaced so your own theme stays untouched.
npx shadcn@latest add https://justyoink.it/r/monochrome-precision/mine/seven-segment-counter.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: initialValue (starting total), caption (text under the pill), ratePerSecond (how fast the counter ticks up). Digits tick continuously and respect reduced motion.
components/seven-segment-counter.tsx
import { useEffect, useState } from "react"; export default function GradientOutlinedOdometerPill({ initialValue = 1521556673, caption = "Total build minutes reclaimed by shared caching", ratePerSecond = 7, }: { initialValue?: number; caption?: string; ratePerSecond?: number; }) { const [value, setValue] = useState(initialValue); useEffect(() => { const reduce = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches; if (reduce) return; const id = setInterval(() => setValue((v) => v + Math.max(1, Math.round(ratePerSecond / 4))), 250); return () => clearInterval(id); }, [ratePerSecond]); const text = value.toLocaleString("en-US"); return ( <div className="flex flex-col items-center gap-5 bg-canvas px-4 py-10"> <div role="img" aria-label={`${text} ${caption}`} className="rounded-pill bg-gradient-to-r from-accent-azure via-accent-violet to-accent-magenta p-px" > <div className="flex items-center rounded-pill bg-canvas px-10 py-3 font-mono text-[40px] leading-none tabular-nums tracking-[0.04em]"> {text.split("").map((ch, i) => ch === "," ? ( <span key={i} className="w-3 text-ink self-end">,</span> ) : ( <span key={i} className="relative inline-block w-[0.7em] text-center"> <span aria-hidden className="absolute inset-0 text-ink/10">8</span> <span className="relative text-ink">{ch}</span> </span> ) )} </div> </div> <p className="bg-gradient-to-r from-accent-azure via-accent-violet to-accent-magenta bg-clip-text text-center text-[11px] font-semibold uppercase tracking-[0.25em] text-transparent"> {caption} </p> </div> ); }import { useEffect, useState } from "react"; export default function GradientOutlinedOdometerPill({ initialValue = 1521556673, caption = "Total build minutes reclaimed by shared caching", ratePerSecond = 7, }: { initialValue?: number; caption?: string; ratePerSecond?: number; }) { const [value, setValue] = useState(initialValue); useEffect(() => { const reduce = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches; if (reduce) return; const id = setInterval(() => setValue((v) => v + Math.max(1, Math.round(ratePerSecond / 4))), 250); return () => clearInterval(id); }, [ratePerSecond]); const text = value.toLocaleString("en-US"); return ( <div className="flex flex-col items-center gap-5 bg-background px-4 py-10"> <div role="img" aria-label={`${text} ${caption}`} className="rounded-full bg-gradient-to-r from-monochrome-accent-azure via-monochrome-accent-violet to-monochrome-accent-magenta p-px" > <div className="flex items-center rounded-full bg-background px-10 py-3 font-mono text-[40px] leading-none tabular-nums tracking-[0.04em]"> {text.split("").map((ch, i) => ch === "," ? ( <span key={i} className="w-3 text-foreground self-end">,</span> ) : ( <span key={i} className="relative inline-block w-[0.7em] text-center"> <span aria-hidden className="absolute inset-0 text-foreground/10">8</span> <span className="relative text-foreground">{ch}</span> </span> ) )} </div> </div> <p className="bg-gradient-to-r from-monochrome-accent-azure via-monochrome-accent-violet to-monochrome-accent-magenta bg-clip-text text-center text-[11px] font-semibold uppercase tracking-[0.25em] text-transparent"> {caption} </p> </div> ); }
Quality checks
Automated, in a real browser · 4d ago- Accessible: passedNo serious accessibility problems (axe-core): readable contrast, labelled buttons and images.
- Responsive: not passedScrolls sideways at phone width (390px)
- 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.