Skip to content
animorio
IT
All components

Minute rain forecast

Weather, Hover, PhysicsGSAP, Canvas, CSS onlyAdvancedCompressed weight: Demo 12 KBGSAP 28 KBFreeDownload the zip

The next-hour rain widget of a made-up weather app, Pluvo, in dark glass on black, like a premium app: sixty thin bars that fill up from the left, the line of now and a glass handle to drag on a real spring. The time and the millimetres roll, the line goes from Rain in 12 min to Stops in 22 min, and when the rain is heavy drops condense on the widget’s glass: it mists up, the drops grow, merge and slide down leaving a clear trail. At the end, Dry by 10:52, with the sun coming out from behind the cloud and the light turning amber.

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>
<!--
  "Minute rain 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>The minute by minute rain forecast with the chart that fills up</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" data-stage>
    <div class="widget" data-widget>
      <!-- the light behind the glass: blue with the rain, amber when it is dry -->
      <span class="widget__glow" data-glow aria-hidden="true"></span>
      <span class="widget__shadow" aria-hidden="true"></span>

      <article class="card" data-card aria-label="Rain in the next hour">
        <span class="card__grain" aria-hidden="true"></span>
        <span class="card__spot" aria-hidden="true"></span>
        <!-- the mist and the drops that condense on the glass when the rain is heavy -->
        <canvas class="card__wet" data-wet aria-hidden="true"></canvas>

        <header class="head">
          <span class="brand">
            <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M5.6 14.6h8.1a3.3 3.3 0 0 0 .3-6.6 4.6 4.6 0 0 0-8.8 1.2 2.7 2.7 0 0 0 .4 5.4Z"/></svg>
            Pluvo
          </span>
          <span class="place" data-place>Canal Row</span>
        </header>

        <div class="hero">
          <svg class="icon" viewBox="0 0 48 48" aria-hidden="true" data-icon>
            <g class="icon__sun" data-sun>
              <circle cx="31" cy="15" r="6.2"/>
              <g class="icon__rays" data-rays>
                <path d="M31 4.6v2.6M31 22.8v2.6M20.6 15h2.6M38.8 15h2.6M23.6 7.6l1.9 1.9M36.5 20.5l1.9 1.9M23.6 22.4l1.9-1.9M36.5 9.5l1.9-1.9"/>
              </g>
            </g>
            <path class="icon__cloud" data-cloud d="M13.5 32.5h18.2a7 7 0 0 0 .7-14 9.6 9.6 0 0 0-18.5 2.6 5.7 5.7 0 0 0-.4 11.4Z"/>
            <g class="icon__rain" data-rain>
              <path d="M16.5 37.2l-1.6 4.6"/>
              <path d="M23.5 37.2l-1.6 4.6"/>
              <path d="M30.5 37.2l-1.6 4.6"/>
            </g>
          </svg>
          <h2 class="title" aria-live="polite">
            <span class="title__line" data-line="before">Rain in <span class="roll" data-roll="before"></span> min</span>
            <span class="title__line" data-line="during" aria-hidden="true">Stops in <span class="roll" data-roll="during"></span> min</span>
            <span class="title__line" data-line="after" aria-hidden="true">Dry by <span data-dry>10:52</span></span>
          </h2>
        </div>

        <div class="read">
          <span class="read__time roll" data-time></span>
          <span class="read__mm"><span class="roll" data-mm></span><span class="read__unit">mm/h</span></span>
          <span class="read__word"><span class="word" data-word>Dry</span></span>
        </div>

        <div class="chart" data-chart>
          <span class="guide guide--heavy" data-guide="heavy"><span>Heavy</span></span>
          <span class="guide guide--light" data-guide="light"><span>Light</span></span>
          <span class="now" aria-hidden="true"><span>Now</span></span>
          <div class="bars" data-bars aria-hidden="true"></div>
          <div class="cursor" data-cursor>
            <span class="cursor__line"></span>
            <span class="cursor__knob" data-knob role="slider" tabindex="0" aria-label="Minute of the forecast" aria-valuemin="0" aria-valuemax="59" aria-valuenow="0" aria-valuetext="Now, dry">
              <span class="cursor__grip" data-grip></span>
            </span>
          </div>
        </div>

        <div class="axis" aria-hidden="true">
          <span data-tick="0">Now</span><span data-tick="20">10:20</span><span data-tick="40">10:40</span><span data-tick="60">11:00</span>
        </div>
      </article>
    </div>

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

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 “Minute rain 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 a black background there is a dark glass widget with round corners, a 1px edge that catches the light and a soft blue light behind it. At the top the app name, Pluvo, with its little cloud, and the place, Canal Row. Below, an icon drawn in SVG and the big line Rain in 12 min; further down the time, 10:00, the millimetres per hour and a word saying what the rain is like (Dry, Light, Moderate, Heavy). Then the chart: sixty thin bars, one for each minute of the next hour, grey and low while it is dry and blue, taller and violet at the top, when it rains; two dashed lines read Light and Heavy, a thin line on the left reads Now and below are the times, from Now to 11:00. On arrival the widget rises with a small bounce, the bars fill up from left to right one after another and the glass handle pops in on an elastic. Dragging the handle (or touching the chart) a white line runs on a spring, the bars under it rise a little and the ones already passed dim; the time and the millimetres roll digit by digit and the line changes with a rising fade: Rain in 4 min, Stops in 22 min. With the rain the icon drops its three drops, faster when it is heavy. When the rain is heavy the glass mists up and drops are born on it: they grow, touch and become one, and the biggest slide down in jerks leaving a clear trail in the mist. Leaving the rain the drops evaporate and the mist pulls back. At the end of the hour the line becomes Dry by 10:52, the sun comes out from behind the cloud with its rays opening on an elastic and the widget’s light turns amber. A drawn pointer does the round by itself: it grabs the handle, brings it into the heavy rain, stops, goes to the end, lets go and the handle goes back to now.

How it works

An hour of rain in sixty numbers

The millimetres per hour of each minute come from a curve: zero until the start, then a sine on a bent time (it rises fast, falls slowly), a second wave near the end and two small wobbles, rescaled so the strongest minute is worth PEAK. Each bar’s height is the value to the power 0.75, so light rain still shows, and the Light and Heavy lines sit on the same scale.

The cursor on a spring

The finger or the autopilot only change the target minute; every frame a spring with SPRING and DAMPING pulls the line towards it, with the time step capped at 1/30 s. The spring’s speed tilts the handle by a few degrees, pressing squashes it and letting go brings it back on an elastic; the nearby bars rise with a Gaussian bell and the ones already passed dim.

The rolling digits

Each digit is a column from 0 to 9 inside a window faded at the top and bottom: GSAP moves it with yPercent and back.out, a little longer when the jump is big. The tens digit of the minutes, when it is zero, shrinks to zero width, so Rain in 9 min closes up without a gap. The three lines share one grid cell and swap with a rising fade.

Condensation on the glass

A canvas under the words does two things. The mist is a second, off-screen canvas that every frame gets a pale veil (stronger at the bottom) and loses a little with destination-out: it finds its own balance. Drops are born at random, grow while the rain is heavy, merge by adding their areas and, past a certain size, slide down in jerks wiping the mist along the way and leaving droplets behind. Each drop is a shadow, a body with a radial gradient, an arc of blue light at the bottom and a white highlight at the top.

Dry

Past the end of the rain the line becomes Dry by with the computed time, the sun comes in with back.out and the rays turn on an elastic, and the widget’s --acc variable moves from blue to amber: the glow behind the glass, the edge, the brand’s little cloud and the millimetres follow it.

Values to change

NameFileDefaultWhat it changes
NOWscript.js"10:00"The time now: the chart’s and the reading’s times start from here.
START_INscript.js12How many minutes until the rain starts.
LENGTHscript.js40How many minutes the rain lasts.
PEAKscript.js6.2The millimetres per hour in the strongest minute.
HEAVYscript.js4From how many millimetres per hour the rain is heavy and the glass gets wet.
SPRINGscript.js240The stiffness of the cursor’s spring: higher is quicker.
DAMPINGscript.js24The spring’s damping: lower overshoots the minute more.
CONDENSATIONscript.js1How much the glass mists up and how many drops form in heavy rain.
ROLLscript.js0.5The seconds the digits take to roll to the new number.
PLACEscript.js"Canal Row"The place written at the top right.

Try them in the Playground

When to use it

On the home screen of a weather app, in a phone widget, in a smart home dashboard, in a delivery, outdoor events or hotel app that tells people whether to go out now: at a glance you see when it starts and when it stops, and dragging reads any minute.

On phones

The same animation with adapted sizes: the widget is sized on the window’s width and height and stays whole in the frame, the chart gets shorter with the height and is read by dragging a finger, which does not scroll the page.

With reduced motion

No entrance, no spring and no drawn pointer: the line jumps to the chosen minute, the digits and the lines change without rolling with a fade, the icon’s drops do not fall and the ones on the glass appear and fade without sliding.

Pitfalls

  • A window with overflow: hidden inside a flex row aligned on the baseline takes its bottom edge as its baseline: the rolling digits sat higher than the words. The rows with digits are aligned on the centre.
  • The mist cannot be redrawn from scratch every frame, or the drops’ trails would vanish at once: it lives on a separate canvas that fills and empties slowly, and the sliding drops erase it with destination-out.
  • Merging two drops while walking the list means removing the smaller one and stepping back once, or the next drop is skipped and two drops stay on top of each other.
  • When the page is still the loop only stops once the spring has arrived, there are no drops or mist and the condensation has reached its value: otherwise the last drops stayed on the glass forever.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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