Skip to content
animorio
IT
Back to the library

Snow on the cards

Physics, HoverGSAP, Canvas, CSS onlyAdvancedCompressed weight: Demo 13 KBGSAP 28 KBFreeDownload the zip

The «The Holiday Edit» section of Ferncastle, a made-up shop of small things for the home: three clean product cards (a candle, a mug, a scarf: a photo, the name, the price and an Add button) on a night blue page while the snow falls slowly. The snow really settles on the top edge of the cards, of the Add buttons and of the letters of the title, column by column; pointing at a card makes it tremble and its snow slides off the sides in small clumps that fall and crumble, and Add drops the button's snow and confirms.

The code

A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.

<!doctype html>
<!--
  "Snow on the cards" from Animorio · https://animorio.com
  License: free on your own sites and your clients’ sites, paid work included.
  Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Ferncastle, the holiday edit in the snow</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- the holiday edit of Ferncastle, a made-up shop of small things for the home: three product cards on a night blue
       page while the snow falls slowly. The snow really settles: every top edge (the cards, the Add buttons, the letters
       of the title) keeps a height for each column that grows where the flakes land, slumps to a natural slope and
       rounds off at the ends. Pointing at a card shakes it on a spring and its snow slides off the sides in small
       clumps that tip over the edge and break into powder; Add drops the button's snow and confirms. The cards are plain
       interface cards: a photo, the name, the price and Add -->
  <canvas class="snow snow--back" data-back aria-hidden="true"></canvas>

  <main class="stage" data-stage>
    <header class="head">
      <p class="head__brand" data-rise>
        <svg class="head__mark" viewBox="0 0 20 20" aria-hidden="true"><path d="M10 2.2 15.6 11H12.4L16.4 17.4H3.6L7.6 11H4.4Z" fill="currentColor"/><path d="M9.2 17.4h1.6v1.6H9.2z" fill="currentColor"/></svg>
        <span>Ferncastle</span>
      </p>
      <h1 class="head__title" data-title><span class="head__line" data-rise>The Holiday Edit</span></h1>
      <p class="head__note" data-rise>Three small things for long, slow evenings.</p>
    </header>

    <ul class="row" role="list">
      <li class="card" data-card>
        <div class="card__body" data-body>
          <figure class="card__art"><img src="candela.webp" alt="A lit candle flame close up in the dark" width="800" height="533" draggable="false"></figure>
          <p class="card__name">Pine candle</p>
          <p class="card__meta"><span>Beeswax</span><span class="card__price">$24</span></p>
          <button class="add" type="button" data-add><span class="add__face"><span class="add__t" data-t>Add</span><svg class="add__ok" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.4 8.4 6.6 11.4 12.6 4.8" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" pathLength="1" data-ok/></svg></span></button>
        </div>
      </li>
      <li class="card" data-card>
        <div class="card__body" data-body>
          <figure class="card__art"><img src="tazza.webp" alt="A red cup of flat white with latte art on a black saucer, on a wooden table" width="800" height="600" draggable="false"></figure>
          <p class="card__name">Café cup</p>
          <p class="card__meta"><span>Glazed red</span><span class="card__price">$32</span></p>
          <button class="add" type="button" data-add><span class="add__face"><span class="add__t" data-t>Add</span><svg class="add__ok" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.4 8.4 6.6 11.4 12.6 4.8" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" pathLength="1" data-ok/></svg></span></button>
        </div>
      </li>
      <li class="card" data-card>
        <div class="card__body" data-body>
          <figure class="card__art"><img class="card__img--scarf" src="sciarpa.webp" alt="Three knitted scarves folded in a stack on a wooden table" width="800" height="520" draggable="false"></figure>
          <p class="card__name">Wool scarf</p>
          <p class="card__meta"><span>Hand knitted</span><span class="card__price">$68</span></p>
          <button class="add" type="button" data-add><span class="add__face"><span class="add__t" data-t>Add</span><svg class="add__ok" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.4 8.4 6.6 11.4 12.6 4.8" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" pathLength="1" data-ok/></svg></span></button>
        </div>
      </li>
    </ul>
  </main>

  <canvas class="snow snow--front" data-front aria-hidden="true"></canvas>
  <svg class="hand" data-hand viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 18.6 13.4 12.2 14.2 15.6 20.6 13 21.8 9.6 15.4 5 19.8Z" fill="#fff" stroke="#0e1526" stroke-width="1.2" stroke-linejoin="round"/></svg>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="script.js"></script>
</body>
</html>

Playground

Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.

35 values to change

Or ask your AI assistant for it

With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:

Take “Snow on the cards” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a night blue page with a fine grain, at the top the Ferncastle wordmark with a small cranberry fir, the title «The Holiday Edit» and the line «Three small things for long, slow evenings.»; below, three clean interface product cards: a real photo (a candle flame in the dark, a red cup of flat white on a wooden table, three folded wool scarves), with a light veil that sinks it into the blue at the bottom, the name (Pine candle, Café cup, Wool scarf), a line, the price and an Add button. Pointing at the card, the photo comes a little closer and warms up. The snow falls slowly with a light wind and gusts, the far flakes behind the cards and the near ones in front, each fluttering as it turns. The near flakes settle: on the top edge of every card, every button and every letter of the title a layer of snow grows, higher where more of it falls, slumping to the slope it can hold, rounding off at the ends, thinner on the curves of the letters and with a soft shadow under it; what spills over the ends drops in crumbs. Pointing at a card makes it tremble on a spring and the snow breaks into small clumps that slide to the nearest side, the ones at the edge first, turn over the corner and crumble into powder as they fall; a thin film stays in the middle, and the snow starts to settle again. Clicking Add, the button gives by two pixels and comes back up one pixel too far, its snow falls, the label turns into Added with a check drawn in red, and after 2.6 seconds it is Add again.

How it works

Every edge is a row of columns

The top edge of a card, a button or a letter is a row of columns two pixels wide: for each one the shape below (how far the surface drops, for the rounded corners and the curves) and how much snow there is. The letters are read by drawing each one on a small canvas and looking, column by column, for the first full pixel from the top; every continuous stretch becomes an edge of its own.

A flake that settles

A near flake that reaches below the top of a column's snow stops there and leaves a small mound over eleven columns, bell shaped; how much it leaves falls as the layer gets close to its most. A fine powder settles everywhere too, so the layer is soft but grows more where the flakes land.

The slope it holds

Every frame the snow slides from a column to the next while the difference in height is more than the slope it holds (REPOSE). The most each column can take drops on the curves and towards the ends, so the layer rounds off; what goes over passes to the neighbours, and past the ends it gathers and falls as a crumb.

The spring and the clumps

The card trembles on two springs, one for the shift and one for the turn around its foot, and the snow follows it with the same transform. The snow breaks into clumps eight to eighteen pixels wide: each one starts with a delay that grows towards the middle, speeds up towards the nearest side, and past the corner becomes a free body with gravity and a spin; after a while it crumbles into powder that the wind carries off.

Add

GSAP moves the button and CSS its face: two pixels down, one up, still. The button's snow falls in clumps that open to the sides, the label rolls to Added and the check draws with stroke-dashoffset; a delayedCall brings back Add after 2.6 s.

Values to change

NameFileDefaultWhat it changes
FLAKESscript.js1How many flakes: 2 twice as many, 0.5 half.
FALLscript.js1How fast the flakes fall.
WINDscript.js12The steady wind to the right, in pixels a second (negative blows left).
GUSTSscript.js1How strong the gusts are (0 none).
DEPOSITscript.js1How much snow each flake leaves where it lands.
DEPTHscript.js1How thick the snow can get on the edges.
REPOSEscript.js0.45The steepest slope the snow holds before it slumps.
SHAKEscript.js1How much a card trembles under the pointer.
SLIDEscript.js1How fast the snow slides off the sides.
SETTLEscript.js5.5Seconds the autopilot leaves the snow to settle before it points at the cards.

Try them in the Playground

When to use it

For the holiday section of an online shop, a gift ideas page, a brand's winter window, an Advent calendar or a Christmas market page: snow settling on the products says the season without covering anything, and pointing at them makes it play.

On phones

The same, with the same three cards in a row, smaller: sizes take the smaller of width and height, so it all fits in a short box. There is no pointer: a tap on a card makes it tremble and the snow slides off, a tap on Add drops its own.

With reduced motion

The snow is already settled on the cards, buttons and letters, still, and nothing falls; the cards do not tremble. The title and the cards arrive with a fade, Add changes its label with a fade.

Pitfalls

  • A flake that lands on the snow must be looked up in the coordinates of the card at rest, not the screen's: while the card trembles and turns, the flake is taken back with the inverse transform of the spring.
  • The letters must be read after the fonts have loaded and after the entrance: measured before, the snow settles on a title still sixteen pixels off.
  • The same most for every column makes a boxy layer with straight walls: the most must drop towards the ends and on the curves, and the snow must slump to the slope it holds.
  • A sliding clump stays on the card until it passes the corner; from there it has to be turned into screen coordinates with the card's own transform, or it jumps a few pixels the moment it falls.
  • The autopilot moves the pointer as soon as the demo opens, when there is no snow yet: events that are not real wait SETTLE seconds.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 13 KB; the libraries: GSAP 28 KB.

Testing

Tested on 19 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.

All animations