
Melting words
Text, Scroll, SVG
Scroll inside the preview
As you scroll, each card stops at the top and the next climbs over it: the one below shrinks, tilts and darkens, and each drawing traces itself.
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>
<!--
"Stacking cards" 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>Stacking cards</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>
<main>
<section class="apertura">
<p class="sopra">How an animation is born</p>
<p class="grande">Scroll: each card stops at the top, the next one slides over it and the one below shrinks and tilts.</p>
</section>
<section class="pila">
<div class="pila__carte">
<span class="ancora" aria-hidden="true"></span>
<article class="carta c1" style="--i: 0">
<div class="carta__testo">
<h2 class="carta__titolo">The sketch</h2>
<p>It starts on paper: what has to happen, in what order, for whoever is watching.</p>
<ul class="etichette"><li>the story</li><li>the moments</li><li>the gesture</li></ul>
</div>
<svg class="disegno" viewBox="0 0 244 180" aria-hidden="true">
<path class="tratto" d="M22 132 C 60 60, 100 150, 140 90 S 200 40, 222 70" />
<path class="tratto" d="M168 28 l30 30 -86 86 -34 6 6 -34 z" />
<path class="tratto" d="M144 52 l30 30" />
<path class="tratto compare" d="M60 40 l12 16 -12 16 -12 -16 z" />
</svg>
<span class="carta__velo" aria-hidden="true"></span>
</article>
<span class="ancora" aria-hidden="true"></span>
<article class="carta c2" style="--i: 1">
<div class="carta__testo">
<h2 class="carta__titolo">The timing</h2>
<p>Every gesture has a length and a place on the timeline: nothing happens all at once.</p>
<ul class="etichette"><li>durations</li><li>staggers</li><li>pauses</li></ul>
</div>
<svg class="disegno" viewBox="0 0 244 180" aria-hidden="true">
<path class="tratto" d="M20 110 H224" />
<path class="tratto" d="M20 100 v20 M71 104 v12 M122 100 v20 M173 104 v12 M224 100 v20" />
<path class="tratto compare" d="M46 66 l12 16 -12 16 -12 -16 z" />
<path class="tratto compare" d="M122 50 l14 18 -14 18 -14 -18 z" />
<path class="tratto compare" d="M198 66 l12 16 -12 16 -12 -16 z" />
<path class="tratto" d="M46 150 H198" />
</svg>
<span class="carta__velo" aria-hidden="true"></span>
</article>
<span class="ancora" aria-hidden="true"></span>
<article class="carta c3" style="--i: 2">
<div class="carta__testo">
<h2 class="carta__titolo">The curve</h2>
<p>Real motion never goes straight: it starts slow, speeds up, brakes. The curve decides the character.</p>
<ul class="etichette"><li>easing</li><li>springs</li><li>bounces</li></ul>
</div>
<svg class="disegno" viewBox="0 0 244 180" aria-hidden="true">
<path class="tratto" d="M24 150 C 120 150, 110 36, 220 34" />
<path class="tratto" d="M24 150 L96 150 M220 34 L150 34" />
<path class="tratto compare" d="M90 144 h12 v12 h-12 z" />
<path class="tratto compare" d="M144 28 h12 v12 h-12 z" />
<path class="tratto" d="M24 20 V150 H230" />
</svg>
<span class="carta__velo" aria-hidden="true"></span>
</article>
<span class="ancora" aria-hidden="true"></span>
<article class="carta c4" style="--i: 3">
<div class="carta__testo">
<h2 class="carta__titolo">The launch</h2>
<p>Try it on a phone, try it with reduced motion, then publish it and watch who comes by.</p>
<ul class="etichette"><li>tests</li><li>the phone</li><li>the release</li></ul>
</div>
<svg class="disegno" viewBox="0 0 244 180" aria-hidden="true">
<path class="tratto" d="M20 30 h204 v126 h-204 z" />
<path class="tratto" d="M20 54 H224" />
<path class="tratto" d="M36 42 h40" />
<path class="tratto compare riempi" d="M104 78 l48 28 -48 28 z" />
</svg>
<span class="carta__velo" aria-hidden="true"></span>
</article>
</div>
<div class="pila__coda" aria-hidden="true"></div>
</section>
<section class="coda">
<p class="grande">Four cards, one stack. Scroll back up and do it again.</p>
</section>
</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>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
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 “Stacking cards” from Animorio and fit it into my siteThe cards are position: sticky with top = offset + index × step (16 pixels): each stops just below the previous one and leaves its edge visible.
Before every card there is a zero-height span. Triggers attach to it and not to the card, because a sticky card changes position while it is stuck and ScrollTrigger’s maths would go wrong.
With scrub, while the next card rises from the bottom to its step, the one below goes to scale 0.93, rotates ±1.4 degrees (one direction per card) and a dark veil rises over it up to 0.38.
Every SVG stroke takes its length with getTotalLength and starts with stroke-dashoffset equal to that length; when the card arrives the offset goes to zero and the stroke draws. Small pieces pop out with back.out.
| Name | File | Default | What it changes |
|---|---|---|---|
--alto / --scalino | style.css | 12vh / 16px | Where the first card stops and how much each one sticks out from the previous. |
PICCOLA | script.js | 0.93 | The scale of the covered card. |
STORTA | script.js | 1.4 | The degrees of rotation of the covered card. |
BUIO | script.js | 0.38 | How much the covered card darkens. |
For a three-to-six step process, a method, the phases of a job: the pile makes each step feel like it rests on the previous one. With more than six cards the run gets long.
The cards stack text over drawing, with the same minimum height for all, and the step shrinks to 10 pixels.
The cards stay sticky but do not shrink or tilt; the drawings are already traced.
GSAP 3.15.0, ScrollTrigger (GSAP) 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 4.1 KB; the libraries: GSAP + ScrollTrigger 45 KB.
Tested on 21 October 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.