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.

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>
  );
}

Quality checks

Automated, in a real browser · 4d ago
—

More from Monochrome Precision

The whole style →

Ink and Ghost Button Pair

Buttons

Dashed Orbit Integration Ring

Animated graphics

Customer Story Index List

Lists

Centered Quote with Meta Row

Testimonials

Hairline Navigation Bar

Headers & nav bars

Floating Triangle Hero with Logo Strip

Heroes