
The inchworm menu
Menus, Hover, Transitions
The reading settings of Leaflet, a made-up reading app: the text size slider between a small «A» and a large «A», six notches from 13 to 26 points, the knob that swells when you grab it and springs onto the nearest notch, the dark bubble with the points that follows it and rolls, and below it a preview paragraph that changes size and really rewraps, line by line. «Default» goes back to 17. On white, with a single ink-blue accent.
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>
<!--
"Text size slider" 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>Text size slider</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/newsreader@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage">
<!-- the reading settings of Leaflet, a made-up reading app: a text size slider with six notches, a bubble that
follows the knob with the size in points, and a preview paragraph that really reflows at the new size -->
<section class="card" data-card aria-label="Leaflet reading settings">
<header class="head">
<div>
<p class="brand">Leaflet · Reading</p>
<h1 class="title">Text size</h1>
</div>
<button class="reset" type="button" data-reset aria-label="Back to the default size">
<span class="reset__bg" data-reset-bg aria-hidden="true"></span>
<span class="reset__txt">Default</span>
</button>
</header>
<div class="slider" data-slider>
<span class="glyph glyph--s" aria-hidden="true">A</span>
<div class="rail" data-rail role="slider" tabindex="0" aria-label="Text size" aria-valuemin="13" aria-valuemax="26" aria-valuenow="17" aria-valuetext="17 points">
<span class="track" aria-hidden="true"></span>
<span class="fill" data-fill aria-hidden="true"></span>
<span class="ticks" data-ticks aria-hidden="true"></span>
<span class="knob-pos" data-knobpos aria-hidden="true">
<span class="bubble-pos">
<span class="bubble" data-bubble><span class="roll" data-val></span><span class="unit">pt</span></span>
</span>
<span class="knob" data-knob><span class="knob__dot"></span></span>
</span>
</div>
<span class="glyph glyph--l" aria-hidden="true">A</span>
</div>
<div class="preview" aria-label="Preview">
<p class="preview__txt" data-preview>The ferry left at seven, and by the time the island had shrunk to a pencil line on the water, Mara had read the first letter twice. It was short, and it smelled faintly of salt.</p>
</div>
<p class="sr" aria-live="polite" data-live></p>
</section>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.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.
25 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Text size slider” from Animorio and fit it into my siteThe state is a single number, from 0 to the number of notches minus one, halfway between two notches too: dragging writes it directly, the release spring takes it to the nearest integer with GSAP, and one function draws knob, blue stretch and notches from that number.
The paragraph’s size is a CSS variable, --pt, that GSAP slides to the new value: it is the real font-size that changes, not a scale, so the browser redoes the line breaks on every frame. The preview window has a fixed height and a fade at the bottom, so the card does not grow.
The bubble sits in a zero-width positioner, centred with flex on the knob’s point; GSAP only moves the bubble inside it (the nod, the lift when grabbed), so its centre always stays on the knob’s centre.
| Name | File | Default | What it changes |
|---|---|---|---|
MIN_PT | script.js | 13 | The smallest text size, in points. |
MAX_PT | script.js | 26 | The largest text size, in points. |
STEPS | script.js | 6 | How many notches the slider has. |
DEFAULT_PT | script.js | 17 | The size the Default button goes back to. |
SPRING | script.js | 0.5 | How springy the snap onto a notch is (lower = more bounce). |
GRAB_SCALE | script.js | 1.18 | How much the knob swells while you hold it. |
TEXT_TIME | script.js | 0.45 | Seconds the preview takes to reach the new size. |
IDLE | script.js | 6 | Seconds after your last touch before the demo plays by itself again. |
In the settings of a reading app, an ebook, a newspaper or a long-form blog, and in accessibility panels: readers see straight away how the text will look, before closing the settings.
Everything is in em and the size depends on both the width and the height of the window, so the card fits whole in the phone box. The rail is as tall as a fingertip and can be tapped anywhere; dragging uses pointer events, so it works with a finger as with a mouse.
No springs, swelling or rolling: the knob goes straight to the notch, the digits and the preview text change at once and the demo does not play by itself.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Newsreader (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.0 KB; the libraries: GSAP 28 KB.
Tested on 2 December 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.
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.