Skip to content
animorio
IT
Back to the library

Drip transition

Transitions, HoverGSAP, Canvas, CSS onlyMediumCompressed weight: Demo 8.4 KBGSAP 28 KBFreeDownload the zip

A minimal page transition with a single gesture: the colour waiting along the top edge, like paint on the lip of a tin, runs down the page. On the click the drip above the link starts first and the others follow, later the further away they are, each with a round bead at its tip; one or two drops let go and fall ahead. Once the page is covered the colour slides off the bottom, a few strands hold on to the top edge, thin out and snap, and only then the new title drops into its lines and settles.

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>
<!--
  "Drip transition" 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>Treacle</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>
  <!-- two pages of an invented colour studio; the link lets the colour waiting at the top edge run down the page in
       drips, cover it, and slide off the bottom, leaving the new page behind it -->
  <main class="sito" data-site>

    <section class="pagina pagina--chiara" data-page="a" aria-label="Index">
      <header class="testa">
        <p class="marchio">Treacle</p>
        <p class="nota">Colour studio</p>
      </header>
      <div class="eroe">
        <p class="occhiello" data-in>Index</p>
        <h1 class="titolo">
          <span class="riga"><span class="riga__dentro" data-line>Let the colour</span></span>
          <span class="riga"><span class="riga__dentro" data-line>take its time.</span></span>
        </h1>
        <a class="pillola" href="#work" data-go="b" data-autoclic data-in>
          <span class="pillola__scritta">See the work</span>
          <span class="pillola__freccia" data-arrow><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2.5 8h10.5M9 3.8 13.2 8 9 12.2" /></svg></span>
        </a>
      </div>
      <footer class="piede">
        <p class="nota">Click the link: the colour runs from above it</p>
      </footer>
    </section>

    <section class="pagina pagina--scura" data-page="b" aria-label="Work" hidden>
      <header class="testa">
        <p class="marchio">Treacle</p>
        <p class="nota">Work</p>
      </header>
      <div class="eroe">
        <p class="occhiello" data-in>Work</p>
        <h1 class="titolo">
          <span class="riga"><span class="riga__dentro" data-line>Mixed slowly,</span></span>
          <span class="riga"><span class="riga__dentro" data-line>set by hand.</span></span>
        </h1>
        <a class="pillola" href="#index" data-go="a" data-autoclic data-in>
          <span class="pillola__freccia pillola__freccia--indietro" data-arrow><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M13.5 8H3M7 3.8 2.8 8 7 12.2" /></svg></span>
          <span class="pillola__scritta">Back to index</span>
        </a>
      </div>
      <footer class="piede">
        <p class="nota">Small batches, one colour at a time</p>
      </footer>
    </section>

    <canvas class="colata" aria-hidden="true" data-pour></canvas>
  </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.

31 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 “Drip transition” 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

Two pages of an invented colour studio, Treacle: one on warm white, with the headline ‘Let the colour take its time.’, and one almost black, ‘Mixed slowly, set by hand.’. All along the top edge of the screen there is a thin band of cobalt blue, three pixels, breathing a little, like paint on the lip of a tin. With the pointer on the link the band sags right above it into a small belly, which goes one pixel too far and settles, with a round bead at its tip. On the click the link’s arrow turns to point down on a spring and the link gives under the press. The drip above the link starts first; the others, about ten on a wide screen and six on a phone, start later the further away they are. Each one comes down slowly while it swells and then gravity takes it; it has a narrow neck and a round bead at its tip, wider than the neck, with a thin glint, that grows as it runs. Two drops let go: for a moment a thread still holds them, then they fall ahead, stretched by their speed, and the drip they came from pulls back a little and swells again. Behind the drips the sheet of colour comes down, uneven, until the page is covered and the old page, pulled down by a hair, disappears beneath it. The colour stays for a beat and then slides off the bottom: the top edge of the mass comes down with a line of light under it, three strands hold on to the edge of the screen and pull it up into a point, thin out and snap; the upper piece springs back into the band with a bead at its tip, the lower one snaps into the mass, and there the edge wobbles and settles. Only once the colour has left the middle of the page does the new headline come in: its lines drop into their slots from above, land with a small squash and settle on a spring. The way back is the same gesture, from the link on the other page.

How it works

A sheet on a canvas

The two pages are real HTML, one above the other; the colour is drawn on a canvas on top of them, which lets clicks through. A single number, from 0 to 2, says where we are: up to 1 the colour runs and covers, between 1 and 2 it slides off. GSAP animates that number, the ticker draws.

The edge as a function

The lower edge of the colour is measured every three pixels from right to left: it is the lowest of the front of the sheet and the neck of each drip, a flattened bell (a smoothstep between 0.5 and 1.65 times its width) that gives a straight neck and a soft join with the sheet. The round tip is a separate ellipse in the same colour: together they make one shape.

First it swells, then it falls

The tip of each drip comes down with q²(0.25 + 0.75q): slow at first, while the bead grows, then it speeds up as if under gravity. Each delay is its distance from the link times SPREAD, with a little chance; the front of the sheet starts later, with a power of 2.4, and passes the bottom edge when the number reaches 1.

The drops that let go

Two drips release a drop halfway down: from there the drop falls on its own, with its own speed and acceleration, stretched vertically as fast as it goes. For nine hundredths of a second a thread still ties it to the tip, and the drip pulls back with an exponential and swells again.

The strands that hold on

As the colour comes down, each strand runs from the edge of the screen to the edge of the mass, thins the more it stretches and pulls the mass up into a bell. Past its length it snaps: the upper piece springs back with a bead and a small shiver, the lower one snaps in, and the bell turns into a damped wobble, a cosine times an exponential.

The headline afterwards

The new headline only starts once the colour has passed the middle: each line drops into its slot with power2.in, arriving fast, squashes for eight hundredths of a second and comes back with elastic.out. The link’s arrow is a span that GSAP turns, with an svg inside that the CSS moves on hover, so the two transforms do not cancel each other.

Values to change

NameFileDefaultWhat it changes
FILLscript.js1.2How many seconds the colour takes to run down and cover the page.
RELEASEscript.js1How many seconds it takes to slide off the bottom and free the new page.
DRIPSscript.js11How many drips on a screen 1000 pixels wide (fewer on narrow ones).
SPREADscript.js0.32How much later the far drips start than the one above the link (0 = all together).
BULBscript.js1.25How much the bead at the tip of each drip swells, compared with its neck.
STRANDSscript.js3How many strands hold on to the top edge as the colour slides off.
DROPSscript.js2How many drops let go and fall ahead.
SPEEDscript.js12 = twice as fast, 0.5 = half as fast.

Try them in the Playground

When to use it

For moving between the pages of a colour studio, a paint maker, an ink workshop or a pastry shop that works with caramel, and for any portfolio that wants a page change with a single gesture, slow and thick.

On phones

The same transition with adapted sizes: there are six drips, wider, and the headline is as big as the box allows in width and height. Without a pointer the band does not sag on hover.

With reduced motion

The colour stays still along the top edge: the old page fades out and the new one fades in, with no drips and no movement.

Pitfalls

  • The neck and the tip have to be drawn as two shapes in the same colour, one over the other: a single function y(x) cannot make a bead wider than its neck.
  • The link’s arrow turns with GSAP and moves on hover with CSS: on the same element, GSAP’s inline transform cancels the hover one. It needs a span for GSAP and the svg inside for the CSS.
  • The drips are stored as shares of the screen, not in pixels: so if the window changes size halfway through, the colour is redrawn right.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 31 October 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