
The elastic button
Buttons, Hover, Text
The reading settings of an invented app, on white, in the style of product interfaces: the text size slider snaps to five steps, a pill picks serif or sans, three swatches change the page tone from paper to sepia to night. Above, the article preview recomposes at every change: words rewrap as they grow, the typeface fades out and back in, the page colours glide to the new tone and a small label tells how many letters fit on a line.
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>
<!--
"Reading settings picker" 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 reading settings that recompose the article</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" data-stage>
<!-- the reading settings of an article: text size snaps to five steps, the typeface switches between serif and
sans, the page tone goes from paper to sepia to night; the article above recomposes itself at every change -->
<section class="card" data-card aria-label="Reading settings">
<header class="head">
<div class="mark" aria-hidden="true">
<svg viewBox="0 0 24 24"><path d="M5 18.5c4-1 7-4.4 8.2-9.6.4-1.7.6-3.4.6-4.4-4.6 1.2-8 5.6-8.8 11.4M5 18.5l9-9"></path></svg>
</div>
<div class="head__text">
<p class="head__title" data-app>Leafline</p>
<p class="head__meta">Reading settings</p>
</div>
<button class="done" type="button" data-reset>Reset</button>
</header>
<div class="page" data-page>
<div class="page__in" data-text>
<p class="page__kicker">Essay · <span data-read>6 min read</span></p>
<h2 class="page__title">The quiet hour</h2>
<p class="page__body">Before the first train, the street belongs to the bakers and the birds. Windows stay dark, the
kettle is the loudest thing in the house, and a page read now seems to stay with you for the rest of the day.
Nobody asks anything of you yet, and the light comes in slowly, one roof at a time.</p>
</div>
<span class="page__fade" aria-hidden="true"></span>
<p class="page__measure" data-measure>About 58 characters a line</p>
</div>
<div class="ctl">
<div class="ctl__head"><span class="ctl__label">Text size</span><span class="ctl__value"><span class="roll" data-size-label>17 px</span></span></div>
<div class="size">
<span class="size__a size__a--s" aria-hidden="true">A</span>
<div class="slider" data-slider role="slider" tabindex="0" aria-label="Text size" aria-valuemin="15" aria-valuemax="23" aria-valuenow="17">
<div class="rail"><span class="rail__fill" data-fill></span></div>
<div class="notches" data-notches></div>
<span class="knob" data-knob></span>
</div>
<span class="size__a size__a--l" aria-hidden="true">A</span>
</div>
</div>
<div class="ctl">
<div class="ctl__head"><span class="ctl__label">Typeface</span></div>
<div class="seg" data-seg role="radiogroup" aria-label="Typeface">
<span class="seg__pill" data-pill></span>
<button class="seg__opt is-on" type="button" role="radio" aria-checked="true" data-face="serif"><span class="seg__aa seg__aa--serif">Aa</span> Serif</button>
<button class="seg__opt" type="button" role="radio" aria-checked="false" data-face="sans"><span class="seg__aa">Aa</span> Sans</button>
</div>
</div>
<div class="ctl">
<div class="ctl__head"><span class="ctl__label">Page</span><span class="ctl__value"><span class="roll" data-tone-label>Paper</span></span></div>
<div class="tones" role="radiogroup" aria-label="Page tone" data-tones>
<button class="tone is-on" type="button" role="radio" aria-checked="true" data-tone="paper" aria-label="Paper"><span class="tone__aa">Aa</span><svg class="tone__tick" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 12.5l4 4 8-9"></path></svg></button>
<button class="tone" type="button" role="radio" aria-checked="false" data-tone="sepia" aria-label="Sepia"><span class="tone__aa">Aa</span><svg class="tone__tick" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 12.5l4 4 8-9"></path></svg></button>
<button class="tone" type="button" role="radio" aria-checked="false" data-tone="night" aria-label="Night"><span class="tone__aa">Aa</span><svg class="tone__tick" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 12.5l4 4 8-9"></path></svg></button>
</div>
</div>
</section>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
</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.
49 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 “Reading settings picker” from Animorio and fit it into my siteThe handle lives on a 0 to 1 position: while held it follows the finger smoothly, let go it moves with back.out to the nearest notch. The article instead changes size as soon as the finger passes another notch, so the text answers at once.
Text size is a font-size tweened by GSAP on the whole block: title and paragraph are in em, so they grow together and the browser rewraps the words on every frame. The preview window keeps a fixed height and a fade at the bottom, so the card never jumps.
The typeface change is a short timeline: the text blurs and drops three pixels, halfway through the font-family changes, then it comes back sharp with back.out. The pill stretches towards the new choice before sliding, and closes again with an elastic.
The three tones are CSS variables; GSAP brings the preview’s background, ink and greys to the new values, the bottom fade and the letters-per-line tag included, so nothing keeps the old colour.
| Name | File | Default | What it changes |
|---|---|---|---|
APP | script.js | Leafline | The reading app’s name, at the top of the card. |
START | script.js | 17 | The starting text size, one of the five. |
ACCENT | script.js | #3b5bfd | The single accent colour: the slider and the tone choice. |
SPRING | script.js | 0.55 | The seconds of the handle’s and the pill’s spring. |
RECOMPOSE | script.js | 0.5 | The seconds the article takes to recompose at each change. |
PAUSE | script.js | 8 | The seconds of quiet after a real touch before the pilot starts again. |
In the settings of a reading app, a blog or an online magazine, a book or document reader: wherever readers want to choose size, typeface and page colour and see the effect at once.
The card takes the width of the box minus the margins; the preview keeps a height in vh, the slider measures its real width and the finger drags it like a mouse, without scrolling the page.
No springs or rolls: the handle goes straight to the notch, the article changes size, typeface and tone at once, the labels change in place. The autopilot does not start.
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 8.1 KB; the libraries: GSAP 28 KB.
Tested on 27 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.