Skip to content

Advent calendar

A 24-door Advent calendar where each surprise only opens from its day in December, with opened doors remembered.

  • Tailwind
  • React
  • CSS
  • WordPress
Open in a new tab

Description

A way to bring visitors back every day of December: a grid of 24 numbered doors, each hiding a discount, a staff pick or an in-store event. A door only opens from its own day (“Patience: door 12 opens on 12 December”); once opened it swings, changes colour and its surprise shows in a panel announced to screen readers (role="status"). Opened doors are remembered in the browser from one visit to the next. Outside December, the data-cav-preview attribute opens every door so the calendar can be explored; remove it for real use. The doors are real buttons, in day order so they stay easy to find by keyboard, and their state (closed or open) is read with the number. Four columns on phones, six on large screens, targets well above 44 px, AA contrast in light and dark mode; the door swing disappears with prefers-reduced-motion. Surprises are set in each door’s data-cav-text attribute. Example: a bookshop in Nantes.

Code

Loading the code…

The code of this component in

Archive contents

calendrier-avent-html-tailwind.zip3 files · 6 Ko

  • index.html22 Ko
  • README.md4 Ko
  • LICENSE.md1 Ko

Tags

Updated on December 2, 2026.

Reviews

No reviews yet.

In the same spirit

  • A mobile page to link from your social profiles: portrait, name, priority links (booking, WhatsApp, website, reviews, call), opening hours with an open or closed status, social links and a share button, in dependency-free HTML and CSS.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A single-plan pricing card: struck-through price and discount, a places-left gauge driven by a data attribute, the list of everything included and a booking button that turns into a waiting list once sold out.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Three treatment cards in accessible neumorphism: gently raised surfaces, buttons that sink in when activated, a light/dark switch for the block itself. 3:1 outlines and AA text kept.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Four fully clickable workshop cards in a neo-brutalist style: thick border, solid offset shadow and a card that sinks onto its shadow on hover or focus. Pastel tones, dark mode, no JavaScript.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component