Sprint

Focus
Length
No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/card-sprint

About this component

A focus timer in a graphite capsule: rolling numerals between a play disc and a reset disc, with the time carried as a lime light that runs round the capsule's own rim. Presets sit in a tray underneath and the countdown is real.

Triggers

  • Click
  • State change
  • Continuous
  • Glow
  • Border
  • Icon swap
  • Card

Techniques

  • requestAnimationFrame
  • State machine
  • SVG stroke
  • stroke-dashoffset
  • CSS transition
  • Keyframes
  • Text animation
  • CSS variables

Difficulty

Advanced

Accessibility

Keyboard and screen readers

Start and pause is one native button with aria-pressed and a label that changes ("Start timer", "Pause timer"); reset is a native button named "Reset timer". The readout is role="timer" with an aria-label in words ("0 minutes 46 seconds left") and the rolling digit columns are aria-hidden. Presets are native radios in a fieldset with a visually hidden legend ("Length"), each named in full ("5 minutes"); arrow keys move between them and every control has a :focus-visible ring.

Reduced motion

The digits and thumb change without transitions and the colon blink and finish flash are off; the rim light still shows progress.

Use it in anything you build, commercial and client work included. Licence

More cards

See all

Activity

659 commits in 16 weeks

TilesGet code
SavedYour changes are live.
Cut-inGet code
PillarGet code
AgendaGet code