Skip to content

Falling snowflakes

Snowflakes drifting down behind a winter banner, in pure CSS, with a button to pause the snow.

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

Description

Twenty-eight snowflakes of different sizes and opacities each fall at their own speed, drifting a little sideways, like light snow on a December evening. Ideal for the festive season, a Christmas market, a chocolate shop, a ski resort or the winter sales. The fall follows the banner’s real height thanks to container units (cqh): the flakes cross the whole section, whether it is 300 or 600 px tall. Only the transform is animated, the decoration is hidden from screen readers and never blocks a click. Since the animation lasts more than five seconds, a toggle button (aria-pressed) pauses and resumes it, by keyboard or mouse (WCAG 2.2.2). With prefers-reduced-motion the flakes stay still and the button disappears. The scene stays nocturnal in both light and dark mode, with AA contrast. Positions, sizes and speeds are set in each flake’s style attribute (--efn-d, --efn-delay, --efn-drift). No horizontal scrolling from 360 px.

Code

Loading the code…

The code of this component in

Archive contents

effet-flocons-neige-tombants-html-tailwind.zip3 files · 5 Ko

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

Tags

Updated on December 2, 2026.

Reviews

No reviews yet.

In the same spirit

  • Cards that fade in as they enter the screen, one after another in each row, without a line of JavaScript and with a static fallback.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A translucent card with a saturated blur whose sharper edge refracts the colourful shapes drifting behind it, with an opaque fallback when transparency is reduced.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • A help block shaped like a conversation: bubbles, three animated typing dots and clickable quick replies that show your answers to frequent questions, frozen under prefers-reduced-motion.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component