
Melting words
Text, Scroll, SVG
Scroll inside the preview
A scroll animation for a city guide: the metro map card of Halvern, a made-up city, in the Wayline app. As you scroll, the four coloured lines draw one after the other at 45 degrees as on real diagrams, led by a white head; behind it the station ticks pop in and the interchanges open as white rings, and the line's chip fills in the header. When a line is done, its station of the moment lights up with its name in bold and a ring of its colour closing around it, and a small real photo of the neighbourhood rises from the station on a thin stem: the stone bridge, the street market, the street of shops, the boats at the quay. Below, the card's footer rolls to the station with its line and the minutes from the centre.
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>
<!--
"Metro map scroll" 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>Wayline, the Halvern metro map</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 metro map card of a made-up city guide, Wayline, for a made-up city, Halvern. On scroll the four lines draw
one after the other at 45 degrees, their stations ticking in behind the drawing head; when a line is done its
station of the moment lights up with its name and a small photo of the neighbourhood rises from it -->
<section class="corsa" data-corsa>
<div class="palco">
<article class="card" data-card>
<header class="testa">
<span class="marchio">
<svg viewBox="0 0 20 20" aria-hidden="true">
<rect x="1" y="1" width="18" height="18" rx="5.5"/>
<path d="M5 13.5h3.2l3.6-3.6H15"/>
<circle cx="8.2" cy="13.5" r="1.25"/>
</svg>
<span class="marchio-nome">Wayline</span>
<span class="marchio-citta">Halvern</span>
</span>
<ul class="linee" data-linee aria-label="Lines"></ul>
</header>
<div class="mappa" data-mappa>
<svg class="rete" data-rete viewBox="0 0 400 300" preserveAspectRatio="xMidYMid meet" aria-label="Halvern metro map">
<defs>
<pattern id="isolati" width="16" height="16" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
<path d="M0 0h16M0 0v16" fill="none" stroke="#1e1c18" stroke-opacity="0.045" stroke-width="0.4"/>
</pattern>
</defs>
<g class="fondo" data-fondo>
<rect class="isolati" x="-40" y="-40" width="480" height="380" fill="url(#isolati)"/>
<path class="mare" d="M412 52 L392 72 L392 312 L412 312 Z"/>
<rect class="parco" x="104" y="80" width="40" height="40" rx="7"/>
<path class="fiume" d="M70 312 L70 245 L100 215 L100 190 L150 140 L150 60 L200 10 L200 -12"/>
<path class="fiume-luce" d="M70 312 L70 245 L100 215 L100 190 L150 140 L150 60 L200 10 L200 -12"/>
<text class="nome-acqua" x="160" y="44" transform="rotate(-45 160 44)">River Aven</text>
<text class="nome-parco" x="124" y="103">Aven Park</text>
</g>
<g data-casse></g>
<g data-tracce></g>
<g data-fermate></g>
<g data-teste></g>
</svg>
<div class="cartoline" data-cartoline></div>
<p class="invito" data-invito>
<span>Scroll to ride the lines</span>
<svg viewBox="0 0 12 12" aria-hidden="true"><path d="M6 2v8M2.8 6.8 6 10l3.2-3.2"/></svg>
</p>
<span class="grana" aria-hidden="true"></span>
</div>
<footer class="piede" data-piede></footer>
</article>
<p class="nota">Halvern, its metro and Wayline are made up.</p>
</div>
</section>
<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="https://cdn.jsdelivr.net/npm/lenis@1.3.26/dist/lenis.min.js"></script>
<script src="script.js"></script>
</body>
</html>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.
24 values to change
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 “Metro map scroll” from Animorio and fit it into my siteEach line is a list of points on a 400 by 300 map, and between two points it only goes across, up and down or at 45 degrees, as on real metro diagrams. The script turns it into a path, measures its length by adding up the segments and, for every stop, works out how far along the line it sits by projecting it onto the right segment.
Every line has a value p from 0 to 1: stroke-dasharray is as long as the line and the stroke-dashoffset, changed as an attribute, is the length times 1 − p. The white head is placed at that fraction of the line, and every stop gets the class su when p passes it: the tick and the interchange ring open with a springy CSS transition, so scrolling back closes them on their own.
A single paused timeline, four steps long plus a pause: in each step the line draws in the first half, then the station ring, the photo card and the footer. ScrollTrigger drives it from top top to bottom bottom of a section five screens tall, with Lenis for smooth scrolling; its onUpdate redraws the lines and lights the name of the station of the moment.
The station's place on the page comes from the SVG's matrix (getScreenCTM): the card sits there, above the station if there is room and below if not, moved sideways just enough to stay inside the map. It is measured again on every resize, because the demo's window changes size while you look at it; GSAP only moves the sheet inside, with its origin on the station.
| Name | File | Default | What it changes |
|---|---|---|---|
DRAW | script.js | 0.5 | How much of each step drawing the line takes; the rest is the station and a pause. |
STROKE | script.js | 4.6 | The width of the lines, in map units. |
CARD | script.js | 0.27 | The width of the photo card, as a share of the map. |
RISE | script.js | 14 | How many pixels the photo card rises from the station. |
RIDE | script.js | 1 | How much scroll the section takes: 2 is twice as long. |
SMOOTH | script.js | 1.1 | Seconds the smooth scroll takes to catch up with the wheel. |
WATER | script.js | 1 | 1 lets the thread of light drift along the river, 0 keeps it still. |
For a city guide, the site of a tourist office, a hotel or an event that wants to show how to get there: when a map should tell, one line at a time, the places to see and how far away they are.
The same animation with adapted sizes: the card takes almost the whole screen, the line chips keep only their coloured bar, the whole map shrinks to fit and the photo card has a minimum width, moved sideways so it never leaves the map. You scroll with your finger.
No movement: every line fades in whole, the ticks and rings are already in place, the photo card and the footer change with a fade; no smooth scroll and the river stays still.
GSAP 3.15.0, ScrollTrigger 3.15.0, Lenis 1.3.26, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 12 KB; the libraries: GSAP + ScrollTrigger 45 KB, Lenis 5.3 KB.
Tested on 6 November 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.