Skip to content
animorio
IT
Back to the library

Pollen forecast

HoverGSAP, CanvasMediumCompressed weight: Demo 6.5 KBGSAP 28 KBFreeDownload the zip

A pollen forecast on a dark card: pick a day and the three meters for trees, grass and weeds fill step by step, the level’s word changes weight, and the air of the card fills with yellow grains carried by the wind, or clears. The pointer brushes them aside as it passes.

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>
<!--
  "Pollen forecast" 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>Pollen forecast</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>
  <main class="stage">
    <!-- a pollen forecast: pick a day and the three meters refill, the level's word changes weight,
         and the air of the card fills with drifting grains or clears; the pointer brushes them aside -->
    <section class="po" data-po aria-label="Pollen forecast">
      <canvas class="po__air" data-air aria-hidden="true"></canvas>
      <header class="po__head">
        <span class="po__title">Pollen</span>
        <span class="po__place">Greenfield</span>
      </header>

      <p class="po__read" aria-live="polite">
        <b class="po__level"><span data-level></span></b>
        <span class="po__main"><span data-main></span></span>
      </p>

      <div class="po__rows" data-rows></div>

      <div class="po__days" data-days role="radiogroup" aria-label="Day">
        <span class="po__pick" data-pick aria-hidden="true"><i></i></span>
      </div>
    </section>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
  </main>

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

13 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 “Pollen forecast” 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 black, a very dark green card: at the top “Pollen” and the place; below, the level’s word in yellow, large (“High”), and a line saying which pollen weighs most; then three rows, Trees, Grass and Weeds, each with a five-step meter and its number; at the bottom five days, each with three small bars summing up its levels. Behind the text, inside the card, the air: large and small yellow grains drifting left to right with a sway. Moving over a day, the light tile slides under its name, the steps being added snap in from the left, the extra ones go out from the end, the word rolls and gets heavier and wider at high levels, and the grains thicken or thin out in a fade: on Thursday the air is dense, on Saturday nearly clean. The pointer, moving inside the card, opens a gap among the grains, which then closes again.

How it works

The air on a canvas

The grains live on a canvas behind the text, driven by GSAP’s ticker: each has its own speed and sways on a sine. How many are needed comes from a single number, the sum of the three levels, animated from one day to the next: the extra ones fade in, the surplus fade out.

The steps, only those that change

Each step has an inner fill. Changing day animates only the differences: new steps come in on scaleX from the left with back.out, staggered, and those to remove go out from the last.

The word’s weight

The day’s highest level sets the word’s wght and wdth axes: “Low” is thin and narrow, “Very high” heavy and wide. Two CSS variables written on every frame of the tween.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#e6d44cThe colour of the pollen.
GRAINSscript.js26How many grains in the air for each point of level.
WINDscript.js1How fast the wind runs: 0 still, 2 strong.
BRUSHscript.js46How wide the pointer’s brush that pushes the grains aside is, in pixels.
HOLDscript.js2.2On its own: how many seconds it stops on each day.
LOOPscript.jstrueLeft alone, a pointer goes through the days.

Try them in the Playground

When to use it

In a weather or health app, on the site of an antihistamine or a pharmacy, on the page of a park or a nursery; and wherever an amount is better understood by seeing it in the air: dust, expected snow, crowds.

On phones

The same card: days are picked with a finger, and a finger dragged inside the card pushes the grains aside. Word, rows and days shrink with the window’s height; the grains scale with the width.

With reduced motion

No wind, snaps or rolls: the grains stand still, as many as the day asks for, and steps, word and tile change at once.

Pitfalls

  • The demo’s levels are made up: real ones come from a pollen monitoring service, by species and by area, and scales change from country to country.
  • The canvas is only atmosphere, with aria-hidden: the data are in the rows and in the days’ labels, and the level is written in words, not just colour.
  • With many grains and a dense screen the canvas gets heavy: density follows the card’s width and resolution stops at two pixels per point.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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