StealThis .dev

Shop — Promo / Countdown Banner

A self-contained e-commerce urgency kit built with vanilla HTML, CSS, and JavaScript. It pairs a dismissible sticky announcement bar that copies a promo code and remembers being closed, a bold hero sale banner with a live days-hours-minutes-seconds countdown, and a compact flash-deal card whose animated stock meter and add-to-cart button decrement real, working stock. On-palette, accessible, and responsive down to small phones.

Open in Lab
html css vanilla-js
Targets: JS HTML

Code

Promo / Countdown Banner

A ready-to-drop promotional set for a storefront, tuned for urgency without the tackiness. A sticky announcement bar runs across the top with a free-shipping note and a dashed code pill — click it to copy FREESHIP75 to the clipboard with a confirmation toast. Dismiss the bar and it stays gone via localStorage, with a small “Show announcement bar” button to bring it back.

Below it, a deep ink-to-brand hero banner anchors the sale with a live countdown that ticks every second across days, hours, minutes, and seconds, pulsing gently on each tick and flipping to an “ended” state when it reaches zero. A compact flash-deal card sits underneath: star rating, struck-through original price, percent-off chip, and an animated “almost gone” stock meter. Adding the item to the cart decrements real stock, updates the progress bar, and disables the button once it sells out.

Everything is vanilla — no frameworks, no images, no CDNs beyond the Google Fonts link. Product art is rendered as inline SVG on softly tinted tiles, the layout collapses cleanly to a single column on small screens, controls are keyboard-usable with visible focus rings, and a prefers-reduced-motion query stills the animations.

Illustrative storefront UI only — fictional products, prices, and reviews. No real checkout.