Sleep
7h42m
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initCardSleep(el) on the mounted element instead.
Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/card-sleepAbout this component
A sleep card in black: last night as a bar of lime light from bed to wake, deep sleep as darker bands inside it and two REM markers pulsing on its edge, with the total in big digits. Drag the knurled wake knob at the bar's end and the total rolls, the bands stretch or squeeze with it, and a sun climbs out of the card's corner, the sky warming, the later you set the alarm.
Triggers
- Card
- Neon
- Glow
- Continuous
- Ambient
- State change
Techniques
- CSS variables
- CSS transition
- Keyframes
- Event position
- Gradient
- Radial gradient
Difficulty
Intermediate
Accessibility
Keyboard and screen readers
The card is a section labelled Sleep. The wake knob is a native button with role=slider labelled Wake time, aria-valuemin 330 and aria-valuemax 540 in minutes, aria-valuenow and an aria-valuetext in HH:MM; arrow keys step 5 minutes, PageUp and PageDown 30, Home and End go to the limits, and it takes pointer drags with capture. The total is a polite live region; the bar, bands, markers, sun and time row are aria-hidden (the slider reads the time). The knob has a white focus ring.
Reduced motion
Nothing pulses or sweeps and every change is a cut.
Use it in anything you build, commercial and client work included. Licence