Skip to content
animorio
IT
Back to the library

Words that melt into each other

As you scroll, each word melts into the next: the outlines stick together like drops while the font width slides from one to the other.

Text, Scroll, SVGGSAPEasyFree

Scroll inside the preview

The code

A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN.

<!doctype html>
<html lang="it">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Parole che si fondono</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/standard.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- il filtro "goo": sfoca le lettere e poi taglia la trasparenza, così i bordi si incollano come gocce -->
  <svg class="filtri" aria-hidden="true" focusable="false">
    <filter id="goo" x="-10%" y="-30%" width="120%" height="160%">
      <feGaussianBlur class="goo-sfoca" in="SourceGraphic" stdDeviation="0" result="sfocato" />
      <feColorMatrix in="sfocato" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 22 -10" result="goo" />
      <feComposite in="SourceGraphic" in2="goo" operator="atop" />
    </filter>
  </svg>

  <main class="corsa">
    <div class="palco">
      <p class="sopra">Ogni progetto passa di qui</p>
      <!-- data-w: larghezza del font (asse wdth) che ogni parola vuole avere -->
      <h1 class="parole">
        <span class="sr">idea, sketch, design, live</span>
        <span class="parola" data-w="76" style="--c: #0f4f4c" aria-hidden="true">idea</span>
        <span class="parola" data-w="96" style="--c: #146662" aria-hidden="true">sketch</span>
        <span class="parola" data-w="112" style="--c: #d9602a" aria-hidden="true">design</span>
        <span class="parola" data-w="125" style="--c: #ff8a3d" aria-hidden="true">live</span>
      </h1>
    </div>
  </main>

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

What it does

A chain of words shares the same spot. As you scroll, the visible word melts into the next one: halfway through, the letters blur and stick together, then sharpen into the new shape. Meanwhile the font widens or narrows, because each word has its own width.

How it works

One cell for all

The words are spans in the same grid cell (grid-area: 1 / 1), so they sit exactly on top of each other.

The goo filter

The container has an SVG filter: feGaussianBlur blurs, feColorMatrix with the alpha row '0 0 0 22 -10' cuts the transparency sharply, feComposite puts the real colours back. Two blurred shapes close together become a single drop.

The melt

Scroll moves a value from 0 to 1. Divided by the number of steps, it tells which word is leaving, which one is arriving and how far the melt has gone.

A bell-shaped blur

The blur follows sin(π · melt): zero at the start, strongest halfway, zero at the end. It is proportional to the font size, so the effect looks the same on every screen.

Filter off at rest

When the blur is close to zero the filter is removed entirely: letters stay sharp and the browser stops recomputing the filter every frame.

Values to change

NameFileDefaultWhat it changes
data-windex.html76 → 125The font width (wdth axis) of each word. Long words look good narrow, short words wide.
--cindex.html#0f4f4c …Each word's colour: during the melt the two colours blend.
GOCCIAscript.js0.05How much the letters blur halfway through. Higher values make the words more liquid.
PAUSAscript.js0.18How long each word holds still before melting.
.corsa heightstyle.css420vhThe scroll length: the taller it is, the slower the melts.

When to use it

To tell a transformation in a few words: a process, a before and after, a promise. It works with short words and a solid colour.

On phones

Identical: scrolling with a finger drives the melt. The font size scales with the screen, and the blur with the font size.

With reduced motion

No melting: the words appear side by side, all readable, without a pinned scene.

Pitfalls

  • The goo filter eats thin strokes: use a heavy font weight (800-900).
  • The filter region (x, y, width, height) must be larger than the text, or the blur gets clipped at the edges.
  • Safari recomputes SVG filters every frame: turning it off at rest is not a detail, it is what keeps it smooth.

Libraries

GSAP 3.15.0, ScrollTrigger 3.15.0, Mona Sans (font variabile) 5.3.0.

Weight: 6.1 KB of our own files.

Testing

Tested on 26 September 2026

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

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