About this set
Two countdowns to a launch moment. The boxed countdown shows days, hours, minutes and seconds in four white tiles with uppercase unit labels, for the hero of a launch, event or sale page. The inline banner counter is a dark pill with a green status dot that reads Launching in 32d 06:59:59, for an announcement bar or a header where space is short. The target is one line at the top of the script, a Date you can set to any fixed moment; the demo counts to 32 days and 7 hours after the page loads so it never reads zero. The remaining time is always the target minus Date.now(), so it stays correct in a background tab, and the loop stops when it reaches zero. Values land in elements marked with data-show, so both styles can sit on one page and share one script. Below 520 pixels the four tiles share the width equally. The Bootstrap version builds the tiles from .card and the banner from .badge.rounded-pill, and the Tailwind version uses utility classes only.
What’s included
- Four-tile days, hours, minutes and seconds countdown
- Compact pill counter for a banner or header
- Target date set on one line at the top of the script
- Time left computed from Date.now(), so throttled tabs stay accurate
- Tiles share the width equally on small screens
Accessibility
The ticking numbers are aria-hidden, and visually hidden text such as "Time until launch: 32 days, 6 hours and 59 minutes" changes once a minute and is not a live region, so screen readers are not interrupted every second. The unit labels were darkened to reach 4.5:1 against the white tiles. Nothing animates.
Customise it
Set COUNTDOWN_TARGET at the top of the script. In plain CSS change the colours and sizes on .cd .u and .cd-inline; in Bootstrap the --bs-card-* variables on .cd .card and the --bs-badge-* variables on .cd-inline; in Tailwind the bg-, text- and rounded- utilities.






