Skip to content
animorio
IT
All components

Reading settings picker

Pickers, HoverGSAP, CSS onlyMediumCompressed weight: Demo 8.1 KBGSAP 28 KBFreeDownload the zip

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.

The code

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>

Playground

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

Or ask your AI assistant for it

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 site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a very light grey background sits the white reading settings card of Leafline, an invented app for reading articles: the black mark with a pen, «Reading settings» and the Reset button. Below, the preview of an article, «The quiet hour», on light paper, with the line «Essay · 6 min read» and a small tag telling how many letters fit on a line. Then three controls. Text size: a small A, a slider with five notches and a large A; the handle grows when held, moves freely and, let go, snaps to the nearest notch with a spring, while the «17 px» figure rolls and the article grows or shrinks, words rewrapping, the reading time changing and the tag swelling for a moment. Typeface: a pill between Serif and Sans that slides with a spring and stretches a little towards where it goes; the article blurs, changes typeface and comes back. Page: three swatches, Paper, Sepia and Night, with «Aa» inside; the chosen one gets a blue ring and a drawn tick, and the paper, ink and greys of the preview glide to the new tone. A drawn pointer tries everything by itself and puts it all back; it also really works, with mouse, finger and arrow keys.

How it works

One handle, two behaviours

The 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.

The article recomposing

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.

Swapping the typeface

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 page tones

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.

Values to change

NameFileDefaultWhat it changes
APPscript.jsLeaflineThe reading app’s name, at the top of the card.
STARTscript.js17The starting text size, one of the five.
ACCENTscript.js#3b5bfdThe single accent colour: the slider and the tone choice.
SPRINGscript.js0.55The seconds of the handle’s and the pill’s spring.
RECOMPOSEscript.js0.5The seconds the article takes to recompose at each change.
PAUSEscript.js8The seconds of quiet after a real touch before the pilot starts again.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • Title and paragraph are in em: tweening a single size on the block makes them grow together and stay in proportion.
  • The pill is measured with offsetWidth, not getBoundingClientRect: on large screens the card is scaled up and the screen measure would be wrong.
  • The letters-per-line count is redone on every frame of the size tween, so the tag follows the text while it grows.

Libraries

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.

Testing

Tested on 27 October 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All components