
Melting words
Text, Scroll, SVG
Scroll inside the preview
A minimal scroll animation: the vernier of a caliper, the fine scale that reads tenths of a millimetre. Scrolling slides the main scale over the still vernier, and where two ticks meet they reach for each other and take the accent, so the meeting point runs along the vernier like a wave. Above it, the reading to a tenth; when the scroll stops the scale settles on the nearest tenth, one pixel past and back.
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>
<!--
"Scroll vernier" 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>The vernier that reads the scroll</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>
<!-- a vernier scale, the fine reading of a caliper. Scrolling slides the main scale along the fixed vernier; where a
vernier tick meets a main tick the two reach for each other and take the accent, so the meeting point runs along
the vernier like a wave. The reading above shows it to a tenth. When the scroll stops the scale settles on the
nearest tenth, one pixel past and back, and the pair that meets gives a small knock. The scale can be pulled
sideways with the pointer: let go, it springs back to where the scroll wants it -->
<main class="pagina">
<section class="corsa" data-corsa aria-label="Vernier scale">
<div class="palco">
<div class="pezzo" data-pezzo>
<p class="lettura" aria-live="off">
<span class="lettura__intero" data-intero>0</span><span class="lettura__punto">.</span><span class="lettura__decimo"><span data-decimo>0</span></span><span class="lettura__unita">mm</span>
</p>
<svg class="scala" data-scala aria-hidden="true">
<g data-principale></g>
<line class="scala__bordo" data-bordo-p></line>
<line class="scala__bordo scala__bordo--nonio" data-bordo-n></line>
<g data-nonio></g>
</svg>
<p class="nota" data-nota>Vernier, 0.1 mm</p>
</div>
<p class="scendi" data-scendi>Scroll</p>
</div>
</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="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.
17 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 “Scroll vernier” from Animorio and fit it into my siteThe vernier has ten divisions, each nine tenths of a millimetre long. With the scale moved by v millimetres, vernier tick j falls at v + 0.9·j on the scale: it is aligned when that number is whole, and the j that manages it is the tenth.
For every tick the script measures how many pixels separate it from the nearest tick of the other scale, and its glow is a Gaussian bell of that distance (0.07 millimetres wide). The neighbour, a tenth away, stays almost dark; every tick chases its glow on a small spring.
ScrollTrigger only gives the progress. The scale chases the wanted reading on a spring (stiffness 140, damping below critical), integrated in steps of 1/120 of a second in the GSAP ticker: that is where the pixel past comes from.
If the progress has not changed for 0.16 seconds, the wanted reading is rounded to the tenth and the spring takes the scale there. Once it is still, a knock value goes from 1 to 0 and stretches the aligned pair for a moment.
While dragging, the movement in pixels over the width of a millimetre is added to the wanted reading, with a resistance that grows; on release it goes back to zero and the same spring brings the scale back to where the scroll wants it. touch-action: pan-y keeps the page scrolling vertically.
| Name | File | Default | What it changes |
|---|---|---|---|
LENGTH | script.js | 34.7 | The reading at the end of the scroll, in millimetres. |
DIVISIONS | script.js | 10 | Divisions of the vernier: 10 reads tenths, 20 reads twentieths. |
REACH | script.js | 1 | How far the meeting ticks reach for each other (0 = they only change colour). |
STIFFNESS | script.js | 140 | The spring that carries the scale: higher is quicker. |
BOUNCE | script.js | 0.3 | How far the scale goes past before it settles (0 = not at all). |
SNAP | script.js | true | When the scroll stops, the scale settles on the nearest division. |
SMOOTH | script.js | 1.1 | Seconds of the smooth scroll; 0 for the browser’s own. |
For the page of a precision product, a machine shop or an engineering studio, to show a part’s tolerances or the care of a tool brand; and as a quiet scroll indicator in a technical article.
The same animation with adapted sizes: the millimetre is as wide as the box allows, in width and height, and the scale can be pulled sideways with a finger while the page scrolls vertically.
No movement: the scale is already at 34.7 mm, with the aligned pair in orange, and it appears in a fade.
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 6.4 KB; the libraries: GSAP + ScrollTrigger 45 KB, Lenis 5.3 KB.
Tested on 1 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.