Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/retro-cosmic-arcade/llms.txt
Use this file to discover all available pages before exploring further.
HitCounter recreates the classic “Visitor Counter” widget that adorned countless GeoCities and Angelfire pages in the late 1990s. It renders a horizontal row of individually framed LCD digit cells, each styled with a dark background and a faint lime-green inner glow. You pass in a number, and the component pads it with leading zeros to always display exactly seven digits.
Props
The visitor count to display. The value is coerced to a string and left-padded with zeros to produce a 7-character display (e.g.
1337 → "0001337"). Negative numbers and non-integer values will produce unexpected display strings.Usage
Static display
Wired to state
How it works
The component convertscount to a string with Number.toString(), then pads the result to 7 characters with String.prototype.padStart(7, "0"). The resulting string is split character-by-character with .split(""), and each digit is wrapped in its own <div> styled as an individual LCD cell.
Digit cell styling
| Property | Value / Class |
|---|---|
| Dimensions | h-8 w-6 |
| Background | bg-[#111] |
| Text color | text-y2k-lime |
| Inner glow | shadow-[inset_0_0_5px_rgba(173,255,47,0.2)] |
| Outer border | border border-y2k-panel |
| Alignment | flex items-center justify-center |
Container styling
The digit row sits inside aborder-2 border-y2k-darkSilver bg-black p-1 wrapper, which mimics the plastic housing of a physical LCD counter. Above it, the label “Visitors since the dawn of time:” is rendered in text-y2k-cyan font-vt323 text-xl.
Styling notes
- Digit colors use the
y2k-limetoken (#adff2f). Adjust the token intailwind.config.jsto change the glow color across all digits at once. - The
shadow-[inset_...]syntax is Tailwind’s arbitrary value notation — ensure your Tailwind config hascontentpaths that include this component file so the class is not purged.
Caveats
The component pads to exactly 7 digits. Counts larger than 9,999,999 will overflow the fixed-width display and render more than 7 cells. Consider capping your count prop at
9999999 if you need a visually consistent display.