Skip to content
animorio
IT
Back to the library

Audiobook player

Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 9.6 KBGSAP 28 KBFreeDownload the zip

The now-playing card of Quire Audio, a made-up audiobook app: the typographic cover of The Salt Keeper inside two thin rings, the whole book with its chapter ticks and the arc of Chapter 4 · The Lighthouse moving on, with the minutes left in the gap. The 15 s and 30 s keys turn their arrow a quarter, play turns into pause, the sleep timer’s moon lights up and the rest of the chapter turns to dashes, the bookmark settles and leaves a tick on the arc. 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>
<!--
  "Audiobook player" 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 Salt Keeper, Quire Audio</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/fraunces@5.3.0/full.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- the now-playing card of a made-up audiobook app, Quire Audio: a typographic cover inside a thin ring, the outer
       hairline is the whole book with a tick between chapters, the inner arc is the chapter that plays; the minutes
       left in the chapter, the 15 s back and 30 s forward keys, play and pause, the sleep timer at the end of the
       chapter and the bookmark -->
  <main class="pagina">
    <article class="card" data-card aria-label="Now playing: The Salt Keeper">
      <header class="testa">
        <span class="testa__cap">Chapter 4</span>
        <span class="testa__sep" aria-hidden="true">·</span>
        <span class="testa__nome">The Lighthouse</span>
      </header>

      <div class="disco" data-disco>
        <svg class="anelli" viewBox="0 0 200 200" aria-hidden="true">
          <path class="libro" data-libro d=""/>
          <path class="libro libro--letto" data-libro-letto d=""/>
          <path class="libro libro--capitolo" data-libro-cap d=""/>
          <g class="tacche" data-tacche></g>
          <path class="traccia" data-traccia d=""/>
          <path class="resto" data-resto d="" stroke-dasharray="0 6.4"/>
          <path class="corso" data-corso d=""/>
          <line class="fine" data-fine x1="0" y1="0" x2="0" y2="0"/>
          <line class="segno" data-segno x1="0" y1="0" x2="0" y2="0"/>
          <circle class="testina" data-testina cx="100" cy="14" r="4.2"/>
        </svg>

        <div class="copertina-posto" data-posto>
          <div class="copertina" data-copertina>
            <svg class="copertina__segno" viewBox="0 0 100 136" aria-hidden="true">
              <defs>
                <linearGradient id="fascio" x1="0" y1="0" x2="1" y2="0">
                  <stop offset="0" stop-color="#f3eadb" stop-opacity="0.5"/>
                  <stop offset="1" stop-color="#f3eadb" stop-opacity="0"/>
                </linearGradient>
              </defs>
              <g data-fascio><path d="M70 40 L104 26 L104 54 Z" fill="url(#fascio)"/></g>
              <line class="orizzonte" x1="12" y1="54" x2="88" y2="54"/>
              <circle class="faro" cx="70" cy="40" r="5.2"/>
            </svg>
            <p class="copertina__autore">Maren Holt</p>
            <p class="copertina__titolo" data-titolo>The Salt<br>Keeper</p>
            <p class="copertina__piede">A novel</p>
            <span class="copertina__luce" data-luce aria-hidden="true"></span>
          </div>
        </div>

        <p class="resta" aria-live="polite">
          <span class="resta__min"><span class="resta__finestra"><span class="resta__num" data-min>13</span></span> min</span>
          <span class="resta__di">left in chapter</span>
        </p>
      </div>

      <div class="libro-info">
        <h1 class="titolo">The Salt Keeper</h1>
        <div class="stato" aria-live="polite" data-stato>
          <span class="stato__riga" data-riga="voce">Read by Ines Varga</span>
          <span class="stato__riga" data-riga="sonno"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10.6 2.6a5.6 5.6 0 1 0 2.8 9.4 4.6 4.6 0 0 1-2.8-9.4z"/></svg>Sleep timer · End of chapter</span>
          <span class="stato__riga" data-riga="segno"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.6 2.6h6.8v11l-3.4-2.5-3.4 2.5z"/></svg><span data-segno-testo>Bookmark at 31:08</span></span>
        </div>
      </div>

      <div class="tasti">
        <button class="tasto tasto--sonno" type="button" aria-pressed="false" aria-label="Sleep timer: end of chapter" data-sonno>
          <svg viewBox="0 0 24 24" aria-hidden="true"><path class="luna" data-luna d="M14.6 5.2a7.2 7.2 0 1 0 4.3 11.8 6 6 0 0 1-4.3-11.8z"/></svg>
        </button>
        <button class="tasto tasto--salto" type="button" aria-label="Back 15 seconds" data-salto="-15">
          <span class="giro" data-giro><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5.07 8A8 8 0 1 0 12 4"/><path d="M15 1.4L12 4L15 6.6"/></svg></span>
          <span class="salto__num">15</span>
        </button>
        <button class="tasto tasto--play" type="button" aria-label="Play" aria-pressed="false" data-play>
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <path data-meta="a" d="M8.4 5.6L13 8.4L13 15.6L8.4 18.4Z"/>
            <path data-meta="b" d="M13 8.4L18.6 12L18.6 12L13 15.6Z"/>
          </svg>
        </button>
        <button class="tasto tasto--salto" type="button" aria-label="Forward 30 seconds" data-salto="30">
          <span class="giro" data-giro><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18.93 8A8 8 0 1 1 12 4"/><path d="M9 1.4L12 4L9 6.6"/></svg></span>
          <span class="salto__num">30</span>
        </button>
        <button class="tasto tasto--segno" type="button" aria-pressed="false" aria-label="Add bookmark" data-segnalibro>
          <svg viewBox="0 0 24 24" aria-hidden="true"><path class="nastro" data-nastro d="M7 4.6h10v15.2l-5-3.7-5 3.7z"/></svg>
        </button>
      </div>
    </article>
  </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.

33 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 “Audiobook player” 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 warm white ground, the card of Quire Audio, a made-up audiobook app. At the top «Chapter 4 · The Lighthouse»; in the middle the cover of The Salt Keeper by Maren Holt, type only: the author’s name wide and spaced out, the title in soft Fraunces and one abstract mark, an orange disc over a horizon line with a beam of light. Around it two rings open at the bottom: the outer one, a hairline, is the whole book, with a tick between one chapter and the next and the fourth chapter drawn in ink; the inner one is the chapter that plays, with the playhead and, in the gap at the bottom, the minutes left. Below, the book’s title and «Read by Ines Varga», then the keys: the moon, back 15, play, forward 30 and the bookmark. Play turns into pause by moving the four corners of two shapes, the title on the cover gains weight and the beam starts sweeping slowly round the disc. The 15 and 30 keys turn their arrow a quarter about its own centre and spring back, the number inside steps the same way, and the arc runs to the new place. When a minute runs out, the number rolls down to the next. The moon sets the «End of chapter» sleep timer: it lights up orange with half a turn, the rest of the chapter turns into orange dashes flowing towards the end, the end tick takes the colour and the line under the title rolls to «Sleep timer · End of chapter». The bookmark fills, drops a few pixels and settles, leaves an orange tick on the arc and the line says «Bookmark at 31:08». With the mouse over it the cover leans towards the pointer and a soft light runs across it. Left alone, the card runs through it by itself.

How it works

The computed arcs

The rings are SVG paths rewritten every frame: a function arc(r, a, b) gives the A command between two angles, counted from twelve o’clock, from -140 to 140 degrees, so the gap stays at the bottom. The outer ring uses the place in the book (the chapters before plus the one playing), the inner the place in the chapter; the playhead is a circle put at the end point. gsap.ticker moves the time on, SPEED times faster.

Play turning into pause

The play triangle is cut into two four-point shapes, like the two pause bars: GSAP goes from one d attribute to the other number by number, with no plugin, because the two paths hold the same count of values. The cover title has two CSS variables, --w and --o, inside font-variation-settings: GSAP takes them from 330 to WEIGHT.

The timer’s dashes

The rest of the chapter is a second arc over the track, with stroke-dasharray as an attribute (not in the CSS, which would win): from «0 6.4» to «3.4 3» the dashes are born, and a stroke-dashoffset falling without end makes them flow towards the end of the chapter. The skip arrow is an HTML span turning with transformOrigin 50% 50%, about its true centre.

Values to change

NameFileDefaultWhat it changes
SPEEDscript.js4Seconds of the book per second on screen (1 = real time).
JUMPscript.js0.6Seconds the arc takes to run to the new place after a skip.
MORPHscript.js0.36Seconds play takes to turn into pause.
TURNscript.js90Degrees the round arrow turns at a skip.
WEIGHTscript.js560Weight of the cover title while the book plays (330 when paused).
BEAMscript.js3.2Seconds the lamp’s beam takes to sweep across the cover.
TILTscript.js7Degrees the cover leans towards the pointer.
NOTEscript.js2.6Seconds the bookmark note stays under the title.
AUTOscript.js0.9Seconds before the card plays by itself.

Try them in the Playground

When to use it

For an audiobook app or a publisher’s site, a platform of read-aloud courses, a podcast in long chapters: wherever it matters to know how much is left in the chapter and to stop there at night.

On phones

The same animations. The rings and the cover are sized on the height too (at most 46% of the screen), the card stays at most as wide as the screen minus a margin; the cover leans only with a mouse.

With reduced motion

No turns, bounces or moving beam: the rings are already drawn, play and pause swap at once, skips put the arc in its new place at once, the moon and the bookmark take their colour and the line under the title crossfades.

Pitfalls

  • stroke-dasharray written in the CSS beats the attribute: GSAP changed the attribute and the dashes never showed. It goes only as an attribute in the HTML.
  • During a skip the time must not move on with the ticker too, or the tween and the ticker fight over the place and the arc shakes: a flag holds the ticker until the skip lands.
  • The turning arrow is an HTML span with transformOrigin 50% 50%; svgOrigin on the whole svg would move the pivot and the arrow would swing round.
  • GSAP rounds the px it reads from the CSS (autoRound): turned off at the top, because the dashes’ stroke-dashoffset moves by fractions.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Fraunces (font variabile) 5.3.0.

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

Testing

Tested on 21 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