
The inchworm menu
Menus, Hover, Transitions
The now playing card of Lullwave, a made-up podcast app, on black: the cover with the sea at night, the episode title, the time bar and the controls. The moon button springs open a drawer with the sleep timer choices (15, 30, 45 minutes, end of episode); pick one and the moon makes half a turn and two stars pop out, a lilac ring draws itself around the cover and then wears away with the time, and the button counts down. In the last seconds the episode fades out: the card darkens, the light goes out, the button turns from pause to play and «Sleep well» appears with the time it stopped at. For the demo the timer runs 120 times faster.
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>
<!--
"Podcast sleep timer card" 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 podcast card with the sleep timer that fades the episode out</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" data-stage>
<!-- the now playing card of Lullwave, a made-up podcast app: the moon button opens the sleep timer, a ring around
the cover runs down, and in the last seconds the episode fades out, the card dims and it says goodnight -->
<article class="card" data-card aria-label="Now playing">
<span class="card__glow" data-glow aria-hidden="true"></span>
<span class="card__grain" aria-hidden="true"></span>
<span class="card__dim" data-dim aria-hidden="true"></span>
<header class="head">
<div class="cover" data-cover>
<span class="cover__art" data-art aria-hidden="true">
<span class="cover__moon"></span>
<span class="cover__tide"></span>
<span class="cover__tide cover__tide--2"></span>
</span>
<svg class="ring" data-ring viewBox="0 0 84 84" aria-hidden="true">
<rect class="ring__track" x="2" y="2" width="80" height="80" rx="19" pathLength="100"></rect>
<rect class="ring__run" data-ring-run x="2" y="2" width="80" height="80" rx="19" pathLength="100"></rect>
</svg>
</div>
<div class="titles">
<span class="show" data-show>The Slow Hour</span>
<span class="episode" data-episode>Tides at night</span>
<span class="meta"><span data-epno>Ep. 112</span><span class="dot-sep">·</span><span data-left>27 min left</span></span>
</div>
</header>
<div class="scrub" aria-hidden="true">
<div class="scrub__bar"><span class="scrub__fill" data-fill></span><span class="scrub__knob" data-knob></span></div>
<div class="scrub__times"><span data-now>18:42</span><span data-total>46:10</span></div>
</div>
<div class="controls">
<button class="ctl ctl--small" type="button" data-back aria-label="Back 15 seconds">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M11 5.2A7.4 7.4 0 1 1 4.8 11"/><path d="M11 2.2v6l-3.6-3z" class="fill"/><text x="12.6" y="16" text-anchor="middle">15</text></svg>
</button>
<button class="ctl ctl--play" type="button" data-play aria-label="Pause" aria-pressed="true">
<span class="ctl__in">
<svg class="i-pause" viewBox="0 0 24 24" aria-hidden="true"><rect x="7" y="5.5" width="3.4" height="13" rx="1.2"/><rect x="13.6" y="5.5" width="3.4" height="13" rx="1.2"/></svg>
<svg class="i-play" viewBox="0 0 24 24" aria-hidden="true"><path d="M8.5 5.9v12.2a1 1 0 0 0 1.5.86l9.9-6.1a1 1 0 0 0 0-1.72L10 5.04a1 1 0 0 0-1.5.86z"/></svg>
</span>
</button>
<button class="ctl ctl--small" type="button" data-fwd aria-label="Forward 30 seconds">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M13 5.2A7.4 7.4 0 1 0 19.2 11"/><path d="M13 2.2v6l3.6-3z" class="fill"/><text x="11.4" y="16" text-anchor="middle">30</text></svg>
</button>
<button class="sleep" type="button" data-sleep aria-label="Sleep timer" aria-expanded="false">
<span class="sleep__in">
<svg class="moon" data-moon viewBox="0 0 24 24" aria-hidden="true">
<path d="M19.2 14.6A7.6 7.6 0 0 1 9.4 4.8a7.6 7.6 0 1 0 9.8 9.8z"/>
<path class="star" data-star d="M17.6 3.6l.5 1.3 1.3.5-1.3.5-.5 1.3-.5-1.3-1.3-.5 1.3-.5z"/>
<path class="star star--2" data-star d="M20.6 8.4l.3.8.8.3-.8.3-.3.8-.3-.8-.8-.3.8-.3z"/>
</svg>
<span class="sleep__time" data-sleep-time>Off</span>
</span>
</button>
</div>
<div class="drawer" data-drawer aria-hidden="true">
<div class="drawer__in">
<span class="drawer__label">Stop playing in</span>
<div class="chips" role="group" aria-label="Sleep timer">
<button class="chip" type="button" data-chip="15" tabindex="-1">15 min</button>
<button class="chip" type="button" data-chip="30" tabindex="-1">30 min</button>
<button class="chip" type="button" data-chip="45" tabindex="-1">45 min</button>
<button class="chip" type="button" data-chip="end" tabindex="-1">End of episode</button>
</div>
</div>
</div>
<div class="night" data-night aria-live="polite">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M19.2 14.6A7.6 7.6 0 0 1 9.4 4.8a7.6 7.6 0 1 0 9.8 9.8z"/></svg>
<span data-night-text>Sleep well. Paused at 33:42</span>
</div>
</article>
<svg class="pointer" data-pointer viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2l13.6 8.1-6 1.3 3.4 6.6-2.4 1.2-3.4-6.6-4.2 4.4z"/></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.
35 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 “Podcast sleep timer card” from Animorio and fit it into my siteThe episode time and the timer advance in the same GSAP ticker, with the frame dt: with the timer off time runs at real speed, with the timer on both run TIMER_SPEED times faster, so the demo lasts a few seconds. The paint function writes the minutes, the bar, the knob and the timer state from a single source.
The ring around the cover is an SVG rect with pathLength=100 and round corners: stroke-dashoffset goes from 0 to 100 in proportion to the time left, so there is no need to measure the perimeter. When the timer starts it draws itself from empty to full in 0.7 seconds with power3.out.
The drawer has height 0 and its content has the real height: GSAP takes the height to the measured value with back.out, and the four choices come in from below with a 0.05 stagger. On resize the height is measured again if the drawer is open.
In the last FADE_SECONDS real seconds a dark veil over the card rises to 0.55, the light and the cover go down; at zero the button turns from pause to play with a spin and back.out, and the goodnight pill rises with the moon settling in elastic.out.
| Name | File | Default | What it changes |
|---|---|---|---|
SHOW | script.js | The Slow Hour | The podcast name, above the title. |
EPISODE | script.js | Tides at night | The episode title. |
START_AT | script.js | 1122 | At which second of the episode the card opens. |
LENGTH | script.js | 2770 | How many seconds the episode lasts. |
TIMER_SPEED | script.js | 120 | How many times faster time runs with the timer on, for the demo only (1 = real time). |
FADE_SECONDS | script.js | 2.4 | In the last how many real seconds the episode fades and the card goes dark. |
SPRING | script.js | 0.55 | How long the spring of the drawer and the choices lasts. |
IDLE | script.js | 1.2 | After how many seconds the drawn pointer starts. |
LOOP | script.js | true | Left alone, it goes round again. |
--accento | style.css | #b9a7ff | The lilac of the ring, the lit moon and the choices. |
In the player of a podcast, audiobook, meditation or sleep sounds app, in a music app with a «stop after» feature, in the card that stays at the bottom while you browse.
The card is at most 88% of the screen wide and, with the drawer open, stays under 400 pixels tall; the controls are real buttons big enough for a thumb, and the finger does what the mouse does.
No springs, spins or movement: the drawer opens at once with the choices fading in, the play and pause symbols swap with a fade, goodnight appears without rising and the drawn pointer is hidden. The ring and the minutes stay, because they are information.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.7 KB; the libraries: GSAP 28 KB.
Tested on 14 November 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.