Skip to content
animorio
IT
All components

Article reading panel

Pickers, Hover, TextGSAP, CSS onlyMediumCompressed weight: Demo 5.8 KBGSAP 28 KBFreeDownload the zip

The reading settings of a blog or a reading app: a piece of the article on top, and below a slider between a small A and a big A and three page themes, Paper, Sepia and Night. The text grows on a spring as the slider moves, and the new theme spreads over the card as a circle starting from the colour you chose.

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>
<!--
  "Article reading panel" 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>Article reading panel with text size and page theme</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>
  <main class="stage">
    <!-- the reading settings of a blog or a reading app: a piece of the article on top, and under it the text size on
         a slider between a small and a big A, and three page themes; the text grows on a spring as the slider moves,
         and a new theme spreads over the card as a circle from the swatch you chose -->
    <section class="panel" data-panel data-theme="paper" aria-label="Reading settings">
      <span class="panel__wash" data-wash aria-hidden="true"></span>

      <div class="page" aria-hidden="true">
        <p class="page__kicker">Field notes</p>
        <div class="page__text" data-text>
          <p class="page__title">On slow mornings</p>
          <p class="page__body">The kettle takes its time and so do we. Light comes round the corner of the building at nine, crosses the table, and for a while nothing on the list feels urgent. It is the best hour to read something long.</p>
        </div>
      </div>

      <div class="tools">
        <div class="size">
          <span class="size__a size__a--s" aria-hidden="true">A</span>
          <span class="size__track">
            <span class="size__ticks" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></span>
            <span class="size__fill" data-fill aria-hidden="true"></span>
            <span class="size__thumb" data-thumb aria-hidden="true"><span data-thumb-in></span></span>
            <input type="range" min="0" max="4" step="1" value="1" data-size aria-label="Text size">
          </span>
          <span class="size__a size__a--l" aria-hidden="true">A</span>
        </div>

        <div class="themes" data-themes role="radiogroup" aria-label="Page theme">
          <span class="themes__pill" data-pill aria-hidden="true"></span>
          <button type="button" role="radio" aria-checked="true" data-theme-btn="paper"><i class="sw sw--paper"></i>Paper</button>
          <button type="button" role="radio" aria-checked="false" data-theme-btn="sepia"><i class="sw sw--sepia"></i>Sepia</button>
          <button type="button" role="radio" aria-checked="false" data-theme-btn="night"><i class="sw sw--night"></i>Night</button>
        </div>
      </div>
    </section>
    <p class="sr" data-live aria-live="polite"></p>

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

23 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 “Article reading panel” 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

In the middle, on white, a paper-coloured card with soft corners. At the top a piece of an article: a kicker, the title ‘On slow mornings’ and a few lines of text fading towards the bottom. Under a thin line, two controls. The first is the text size: a small A, a line with five notches and a white knob, a big A; the part already covered is orange. Moving the knob by one notch, it snaps with a small bounce and swells for a moment, and the article’s title and text grow on a spring, slightly overshooting the size and settling, with the lines wrapping by themselves. The second is three themes, each with its colour disc: Paper, Sepia, Night; a light pill marks the chosen one. Tapping Sepia the pill slides on a spring and from the sepia disc a circle spreads until it covers the whole card, while the words turn brown; with Night the circle is almost black and the words turn light. Left alone, a pointer drags the knob two notches, tries Sepia and Night and puts everything back.

How it works

A real slider, dressed

Underneath there is an input of type range, invisible but real: it works with a finger, the mouse and the arrow keys. On top, the knob and the filled part are two elements GSAP moves by reading the input’s value.

The text on a spring

The text size is a CSS variable, --fs, which the title and the paragraph depend on. At every change GSAP animates a number from the old size to the new one with elastic.out and writes it into the variable: the text slightly overshoots and comes back.

The theme’s circle

Inside the card there is a veil of the new colour, clipped with a circular clip-path: the centre is the disc of the theme tapped, the radius goes from zero to the distance to the farthest corner. When it has covered everything, the card takes the theme and the veil goes back to zero.

The words change first

The text colour switches to the new theme’s at the start of the circle, with a 450 millisecond transition: so the words stay readable while the background changes underneath.

The themes’ pill

It is an absolute element that takes the position and width of the chosen button and goes there with elastic.out; the three buttons are a radio group, with arrow keys to move between them.

Values to change

NameFileDefaultWhat it changes
SMALLscript.js14The smallest text size, in pixels.
BIGscript.js22The biggest text size, in pixels.
STARTscript.js1Which notch it starts from: 0 to 4.
THEMEscript.jspaperThe theme at the start: paper, sepia or night.
ACCENTscript.js#e2643aThe colour of the slider’s filled part.
SPRINGscript.js0.7How long the spring of the text changing size lasts, in seconds.
SPREADscript.js0.7In how many seconds the new theme covers the card.
LOOPscript.jstrueLeft alone, a pointer tries the sizes and the themes.

Try them in the Playground

When to use it

For a blog, an online magazine, a web newsletter, an ebook or read-later app: the panel that opens from the ‘Aa’ button. It helps people who read for long and those who need bigger type.

On phones

The same card, as wide as the screen: the slider is dragged with a finger and the three themes share the row.

With reduced motion

No springs and no circle: the text goes straight to the new size, the knob and the pill go straight to their place and the theme changes with just the fade of the colours.

Pitfalls

  • The piece of article has a fixed height and fades at the bottom: if it grew with the text, the controls under your finger would move at every notch.
  • The theme’s circle is in pixels worked out from the card’s size: if the card is enlarged with zoom, sizes read from the screen must be divided by the zoom.
  • Two animations on the same object (the knob’s position and the text size) must both be stopped before starting again, or the old one overwrites the new.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 5.8 KB; the libraries: GSAP 28 KB.

Testing

Tested on 14 November 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