Skip to content
animorio
IT
Back to the library

Accessibility panel

Text, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.9 KBGSAP 28 KBFreeDownload the zip

The accessibility panel of Fernreach Library, a made-up public library, next to a piece of the page that changes live: text size and spacing on two stepped sliders, high contrast and a more readable typeface on two switches, and Reset. On every change the words spring from where they were to their new place on a measured spring, line after line; the contrast fades, the readable typeface comes in word by word out of a blur and a label over the knob says the value. Minimal style.

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>
<!--
  "Accessibility 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>Fernreach Library, accessibility</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/instrument-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/atkinson-hyperlegible-next@5.3.0/index.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/geist-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- The accessibility panel of Fernreach Library, a made-up public library. Next to it, a sample of the page changes
       live: text size, spacing, high contrast and a more readable typeface. Every change re-settles the words line by
       line on a measured spring; a small label over each knob says the value. -->
  <main class="scena">
    <article class="foglio" data-foglio aria-live="polite">
      <p class="marca">
        <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 19V7.5L12 4l8 3.5V19" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/><path d="M8.5 19v-6h7v6M3 19.2h18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>
        Fernreach Library
      </p>
      <h1 class="titolo" data-testo>Holiday hours and quiet desks</h1>
      <p class="testo" data-testo>Both branches open at nine and close at four, except on public holidays. Drop boxes stay open, so books, prints and board games can go back any day. Quiet desks need a booking: pick a desk, bring your card and the door will open for you, with no queue.</p>
      <span class="velo" aria-hidden="true"></span>
    </article>

    <aside class="pannello" aria-label="Accessibility settings" data-pannello>
      <header class="pannello__testa">
        <svg class="pannello__icona" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9.2" fill="none" stroke="currentColor" stroke-width="1.5"/><circle cx="12" cy="7.4" r="1.5" fill="currentColor"/><path d="M7.6 10.2 12 11l4.4-.8M12 11v3.4l-2.2 4.2M12 14.4l2.2 4.2" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
        <span>Accessibility</span>
      </header>

      <div class="riga" data-cursore="size">
        <span class="riga__nome">Text size</span>
        <div class="binario" role="slider" tabindex="0" aria-label="Text size" aria-valuemin="0" aria-valuemax="3" aria-valuenow="0" aria-valuetext="100%" data-binario>
          <span class="binario__pieno" data-pieno></span>
          <span class="tacca"></span><span class="tacca"></span><span class="tacca"></span><span class="tacca"></span>
          <span class="manopola" data-manopola><span class="manopola__disco"></span></span>
          <span class="valore" data-valore><span class="valore__testo" data-valore-testo>100%</span></span>
        </div>
      </div>

      <div class="riga" data-cursore="spacing">
        <span class="riga__nome">Spacing</span>
        <div class="binario" role="slider" tabindex="0" aria-label="Spacing" aria-valuemin="0" aria-valuemax="2" aria-valuenow="0" aria-valuetext="Normal" data-binario>
          <span class="binario__pieno" data-pieno></span>
          <span class="tacca"></span><span class="tacca"></span><span class="tacca"></span>
          <span class="manopola" data-manopola><span class="manopola__disco"></span></span>
          <span class="valore" data-valore><span class="valore__testo" data-valore-testo>Normal</span></span>
        </div>
      </div>

      <div class="riga riga--interruttore">
        <span class="riga__nome">High contrast</span>
        <button class="interruttore" type="button" role="switch" aria-checked="false" aria-label="High contrast" data-interruttore="contrast"><span class="interruttore__manopola" data-pomello></span></button>
      </div>

      <div class="riga riga--interruttore">
        <span class="riga__nome">Readable font <small>Hyperlegible</small></span>
        <button class="interruttore" type="button" role="switch" aria-checked="false" aria-label="Readable font" data-interruttore="readable"><span class="interruttore__manopola" data-pomello></span></button>
      </div>

      <button class="reimposta" type="button" data-reimposta>
        <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M4.2 9.6a5.9 5.9 0 1 1 1.9 4.6" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/><path d="M3.6 5.6v4.2h4.2" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>
        <span>Reset</span>
      </button>
    </aside>
  </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.

24 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Accessibility 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

On the left a piece of the Fernreach Library page: the brand, the title «Holiday hours and quiet desks» and a paragraph about opening times. On the right the Accessibility panel: Text size with four notches from 100% to 150%, Spacing with Normal, Wide and Wider, the High contrast and Readable font switches, and Reset. Moving a slider, the knob slides to its notch on a spring, the filled part of the track follows and the black label over the knob rolls to the new value. The paragraph takes the new size and spacing at once, but every word starts from where it was and lands in its new place with a small bounce, line after line. High contrast fades the paper to white, the text to black and lights a border; Readable font switches to the Atkinson Hyperlegible typeface, with the words coming in out of a blur. Reset puts everything back. When nobody touches it, the panel takes a tour on its own.

How it works

Word by word

The title and the paragraph are split into words, each an inline-block span, with the spaces left as text so the text wraps as before.

Before and after (FLIP)

On every change the words are measured, the CSS variables change (size, letter spacing, line height, word spacing) and the words are measured again. Each word starts from the difference, in x, y and scale, and goes back to zero with back.out.

Line after line

The lines are the distinct tops of the words after the change: each word waits its line number times LINE_STAGGER.

Contrast and typeface

GSAP fades the colour variables of the sheet; the readable typeface is a class that changes the family, and the words come in from blur(3px) and opacity 0.3.

Knobs in the centre

Knob and label move with the same x; the label steps back by half its measured width, so a longer word never moves the centre.

Values to change

NameFileDefaultWhat it changes
SPRING_TIMEscript.js0.75Seconds a word takes to settle in its new place.
SPRING_OVERSHOOTscript.js1.3How far the words and knobs go past their place before settling: 0 is none.
LINE_STAGGERscript.js0.03Seconds between one line of the paragraph and the next.
KNOB_TIMEscript.js0.5Seconds a knob takes to slide to its notch.
COLOUR_TIMEscript.js0.6Seconds the contrast takes to fade.
SIZE_STEPSscript.js4Notches of the text size slider.
BIGGEST_SIZEscript.js1.5The text size at the last notch (1.5 = 150%).
AUTOPLAY_PAUSEscript.js1.6Seconds between the steps of the tour on its own.

Try them in the Playground

When to use it

For the accessibility or reading settings panel of a public website, a library, a council, a newspaper or a long blog: readers pick size, spacing, contrast and typeface and see the result at once on the real text.

On phones

On a phone the panel goes under the piece of page, in two columns: the two sliders on top, the two switches below; the panel title and Reset go and sizes follow the height too, so everything fits the screen. Sliders and switches work with a finger.

With reduced motion

No movement: the knobs jump straight to their notch, the paragraph changes with a fade, the contrast fades quickly and nothing bounces.

Pitfalls

  • The value label does not share the knob’s cell: it is out of the flow and centred with its measured width, so a longer word widens nothing and never moves the centre.
  • Measure after gsap.set(x: 0, y: 0, scale: 1): a transform left over from a change halfway through would skew the landing point.
  • The readable typeface loads later: on document.fonts.ready the page is measured again without animating.

Libraries

GSAP 3.15.0, Instrument Sans (font variabile) 5.3.0, Atkinson Hyperlegible Next (font variabile) 5.3.0, Geist Mono (font variabile) 5.3.0.

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

Testing

Tested on 27 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 animations