No.399 · Stats
Tide Gauge Stats
A row of glass tubes that fill to each metric as they scroll in. The number floats on the rolling surface, half under water, and inverts exactly where the wave crosses it.
The prompt
Written for the variant you picked above: Paper
Build a row of KPI gauges drawn as tall glass tubes (7.25rem × 17rem, fully rounded), one per metric, each a role="meter". Register --p (number), --x and --wave-height (lengths) with @property. On each tube, --top = (1 − p) × tube height is where the surface sits. Inside the tube render the number twice in the same place: once on the glass in ink, and once inside a 'water' layer whose background is the water colour and whose text is the inverted colour. Mask the water layer with two images — a seamless wave SVG (80px period, repeat-x) sized 80px × wave-height and positioned at (--x, --top − wave-height), plus a solid block sized 100% × (h − top) pinned to the bottom — so the print inverts exactly along the wave. Animate --x from 0 to 80px every 2.6s (each tube offset in phase). Add a paler back swell moving the other way. The number rides the surface: top = clamp(0.85rem, --top − 0.46em, h − 1.45em), so it is always half under water, which makes the inversion the thing you read. Its digits are reels that roll from 0 to the value as the water rises. An IntersectionObserver (35%) starts the fill once: --p transitions to value/max over 1.7s with a slight overshoot, staggered 160ms per tube, digits staggered 90ms per place. Optional target draws a dashed goal line with its value. Glass: a hairline rim, a vertical highlight and tick marks at quarters. Hovering a tube raises its swell. Label and note sit under each tube. Paper (teal water) and Night (frost water). Selected variant — Paper (paper): Palette for this theme (Paper): --tgs-back #6fb3aa; --tgs-bg #fffdf8; --tgs-focus #2f5fd0; --tgs-glass rgb(27 26 23 / 0.035); --tgs-gloss rgb(255 255 255 / 0.7); --tgs-goal rgb(168 67 47 / 0.85); --tgs-ink #1b1a17; --tgs-muted #6f6a62; --tgs-rim rgb(27 26 23 / 0.14); --tgs-water #1f6f6b; --tgs-water-ink #f3efe4. Treat these as the root colour tokens, one value per role, and name them to suit your code. Select it with the theme option set to "paper". Keep every dimension, spacing value, state and motion from the brief unchanged, and keep text at 4.5:1 contrast or better on these surfaces. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Scroll the row into view to fill the tubes; hover one to raise its swell. Motion: Fill 1.7s with overshoot, 160ms stagger; digits roll 1.5s; surface rolls every 2.6s; swell 600ms. Accessibility: Each tube is a role="meter" with min, max, value and a value text that includes the goal. The drawn numbers are aria-hidden duplicates; the label and note are real text. Reduced motion shows the final levels still, with no roll. Responsive behavior: Auto-fit columns; under 560px a 2×2 grid with shorter tubes. Touch: The swell stays at its resting height; everything else is the same. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.
Notes
- Interaction
- Scroll the row into view to fill the tubes; hover one to raise its swell.
- Motion
- Fill 1.7s with overshoot, 160ms stagger; digits roll 1.5s; surface rolls every 2.6s; swell 600ms.
- Accessibility
- Each tube is a role="meter" with min, max, value and a value text that includes the goal. The drawn numbers are aria-hidden duplicates; the label and note are real text. Reduced motion shows the final levels still, with no roll.
- Responsive
- Auto-fit columns; under 560px a 2×2 grid with shorter tubes.
- On touch
- The swell stays at its resting height; everything else is the same.