About this set
A split-flap style clock in six dark digit cards, grouped as hours, minutes and seconds with colon separators. Each card has a thin seam across the middle like a mechanical flap display, and when its digit changes the card folds away and back in a 320 millisecond animation. Only the cards whose digit actually changed flip, so most seconds move just one card and the clock stays calm to look at. Use it on a landing page, an event screen or a product that wants a tactile, retro feel; for a dense dashboard the plain digital set is quieter. The script writes the six digits of the current time into the [data-digit] cards once a second, re-timed to the second boundary, and restarts the animation by removing and re-adding a data-flipping attribute, which the CSS turns into the fold. Below 520 pixels the cards shrink so all six fit a phone screen without scrolling. The Bootstrap version builds the cards from display, colour and rounding utilities, and the Tailwind version plays the same keyframes through a data-flipping variant.
What’s included
- Six digit cards with a centre seam, grouped as HH:MM:SS
- Only cards whose digit changed play the fold
- Animation triggered by a data-flipping attribute, no class juggling
- Cards shrink below 520 pixels so the clock fits a phone
- Fold switched off under prefers-reduced-motion while the digits keep updating
Accessibility
The cards and separators are aria-hidden, and a visually hidden line such as "Current time 21:48" changes once a minute without being a live region, so a screen reader is never told every second. Under prefers-reduced-motion the fold animation is removed and the digits simply change. The colon separators reach 3:1 contrast as large text.
Customise it
Change the card background, size and font size on .flip .d in plain CSS, and the fold speed in the flip-fold animation. In Bootstrap recolour the cards through --bs-dark-rgb and --bs-border-radius on .flip; in Tailwind edit the bg-, h-, w- and text- utilities and the --animate-flip-fold theme value.






