Skip to content
animorio
IT
Back to the library

Snowfall background

Backgrounds, PhysicsCanvas, GSAPMediumCompressed weight: Demo 8.9 KBGSAP 28 KBFreeDownload the zip

The opening of a made-up mountain village, Valbruna, on a cold morning: snow falls on three planes, small and slow behind, soft and fast in front of the headline, and the pointer is the wind that bends it, with inertia. A thin crust of snow settles on the top of the letters and of the button, following the real shape of the letters, and now and then slips off in small pieces. Minimal style.

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>
<!--
  "Snowfall background" 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>Valbruna, first 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 opening of a made-up ski village on a cold morning: snow falls on three planes behind and in front of the
       heading, the pointer is the wind that bends it, and a thin crust of snow settles on the top of the letters and
       of the button, now and then slipping off in small pieces -->
  <section class="stage" data-stage>
    <canvas class="snow snow--back" aria-hidden="true" data-back></canvas>

    <header class="bar" data-in>
      <span class="brand">
        <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true">
          <path d="M2.5 19.5 9 8.5l3.6 6 2.4-3.6 6.5 8.6"/>
          <path class="brand__cap" d="M7.2 11.6 9 8.5l1.8 3"/>
        </svg>
        Valbruna
      </span>
      <span class="bar__report">Snow report</span>
    </header>

    <div class="hero">
      <p class="eyebrow" data-in>Valbruna, 1,840 m</p>
      <h1 class="title">
        <span class="title__mask"><span class="title__line" data-line>First snow</span></span>
        <span class="title__mask"><span class="title__line" data-line>at Valbruna.</span></span>
      </h1>
      <p class="lede" data-in>The lifts open on the fifth of December. Twelve runs, one quiet valley.</p>
      <a class="pill" href="#" data-pill>
        <span class="pill__fill" aria-hidden="true"></span>
        <span class="pill__words">Book the season</span>
        <svg class="pill__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h8.5M8.8 4.6 12.2 8l-3.4 3.4"/></svg>
      </a>
    </div>

    <dl class="report" data-in>
      <div class="report__item">
        <dt>Fresh overnight</dt>
        <dd><span data-count="38">0</span> cm</dd>
      </div>
      <div class="report__item">
        <dt>Summit</dt>
        <dd>&minus;<span data-count="6">0</span> &deg;C</dd>
      </div>
    </dl>

    <canvas class="snow snow--front" aria-hidden="true" data-front></canvas>
  </section>

  <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.

29 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Snowfall background” 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

A winter sky, from grey blue at the top to white at the bottom. At the top the Valbruna mark, a mountain outline drawn in line with a red ridge, and Snow report on the right. In the middle, in small capitals, Valbruna, 1,840 m; then the large headline First snow / at Valbruna., rising from its line; a line saying the lifts open on 5 December; the pill button Book the season. At the bottom the report: 38 centimetres of fresh snow and −6 degrees at the summit, with the numbers counting up. Snow falls on three planes: behind, small slow flakes; in the middle, medium flakes; in front of the headline, big soft fast flakes, as if out of focus. Every flake sways on its own. Moving the pointer bends the snow the way it goes, more close to the pointer, and when the pointer stops it slowly goes back to falling straight; the near flakes stretch a little in the direction of the wind. A thin crust of snow settles on the top edge of the letters and of the button, following the shape of each letter (on the F, on the t, on the curves of the o) without bridging the gaps; now and then a piece slips off, breaks into small blocks that fall with the wind and fade. Passing over the button shakes its snow off, the words widen and the pill swells with a bounce.

How it works

Three planes, two canvases

Two canvases as big as the screen: behind the text the far and middle flakes, the snow on the letters and the falling pieces; in front of the text the near flakes, with pointer-events: none. Each plane has its own sprite, a white radial gradient drawn once and then scaled, softer for the near flakes: depth of field without blur filters.

The wind has inertia

The pointer’s horizontal speed becomes a target wind that dies down by itself when the pointer stops; the real wind chases it with 1 − e^(−2.2·dt), and every flake chases the wind of its plane with its own readiness. Near the pointer an extra push is added, falling off with distance like a 170-pixel gaussian.

The snow follows the letters

The outline of each line of the headline is read from a mask: the line is drawn again on a hidden canvas with the same typeface and spacing, and for each 2-pixel column the first filled pixel from the top is found. Middle flakes crossing that edge settle and raise the snow there and on the nearby columns, but never across a step of the letter.

The piece that slips

Every BREAK seconds or so a stretch of thick enough snow becomes small blocks with a speed, a spin and a life: they fall with gravity and with the wind and fade. Each step uses the real time of the frame, so it runs the same at 60 and 120 Hz.

Values to change

NameFileDefaultWhat it changes
DENSITYscript.js1How much snow falls (1 = a calm snowfall).
FALLscript.js1How fast the snow falls.
SIZEscript.js1How big the flakes are.
WINDscript.js1How much the pointer’s wind bends the snow.
SWAYscript.js1How much each flake sways as it falls.
SETTLEscript.js3.5How thick the crust on the letters can grow, in pixels.
BREAKscript.js5Roughly every how many seconds a piece of crust slips off.
SOFTscript.js1How soft the near flakes are (the depth of field).

Try them in the Playground

When to use it

As the background of the opening of a ski resort, a mountain hut, an alpine hotel, a snow gear shop, a Christmas page or a winter campaign: where you want the season without a photo.

On phones

The same snow at adapted sizes: how many flakes depends on the area, the speed on the height, and the headline is sized on the height too. With a finger sliding on the screen the wind follows the finger.

With reduced motion

The snow stays still, already settled in a thin crust on the letters; no wind and no falling pieces, and the words fade in.

Pitfalls

  • The outline of the letters can only be read once the typeface has loaded (document.fonts.ready) and the line is in place: it is read again on resize and at the end of the entrance.
  • The snow must not bridge the gaps between letters: two columns hold together only if the edge of the letter does not step up or down more than two pixels between them.
  • On a light ground white flakes get lost: the sky is a grey blue and the crust on the letters has a half-pixel shadow.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 20 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