
The inchworm menu
Menus, Hover, Transitions
The end of an episode of Low Tide, a made-up series, in a video player on black. While the credits roll, the screen shrinks into the corner and the «Up next» card arrives with the drawn thumbnail of Salt Lines: the «Next episode» pill fills with white from the left over eight seconds as a countdown, the seconds rolling and the label widening on the width axis. Resting the mouse on it pauses the countdown and swells the pill, a click grows the thumbnail until it fills the player, and «Watch credits» sends the pill away on a spring and brings the credits back full screen.
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>
<!--
"Next episode button" 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>Next episode button</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 end of an episode in a video player: the credits shrink into the corner, the Next episode pill fills as a
countdown and plays the next one; hovering pauses it, Watch credits sends it away and brings the credits back -->
<section class="player" data-player aria-label="Video player">
<div class="screen" data-screen>
<div class="screen__glow" aria-hidden="true"></div>
<div class="credits" aria-hidden="true">
<div class="credits__roll" data-roll>
<p class="credits__show">Low Tide</p>
<p class="credits__ep">The Harbour Light</p>
<p><span>Directed by</span>Mara Quell</p>
<p><span>Written by</span>Tomas Ide & June Hart</p>
<p><span>Director of photography</span>Ilse Varn</p>
<p><span>Edited by</span>Rhea Moss</p>
<p><span>Music by</span>Oskar Bly</p>
<p><span>Production design</span>Noor Calder</p>
<p><span>Sound</span>Elio Brandt</p>
<p><span>Casting</span>Wren Okafor</p>
<p class="credits__show">Low Tide</p>
<p class="credits__ep">The Harbour Light</p>
<p><span>Directed by</span>Mara Quell</p>
<p><span>Written by</span>Tomas Ide & June Hart</p>
<p><span>Director of photography</span>Ilse Varn</p>
<p><span>Edited by</span>Rhea Moss</p>
<p><span>Music by</span>Oskar Bly</p>
<p><span>Production design</span>Noor Calder</p>
<p><span>Sound</span>Elio Brandt</p>
<p><span>Casting</span>Wren Okafor</p>
</div>
</div>
</div>
<div class="scene" data-scene aria-hidden="true">
<svg class="art" viewBox="0 0 160 90" preserveAspectRatio="xMidYMid slice"><use href="#art"/></svg>
<div class="scene__title" data-scene-title>
<span class="scene__kicker">Now playing</span>
<span class="scene__name">Salt Lines</span>
</div>
</div>
<div class="bar" aria-hidden="true"><span class="bar__done" data-bar></span></div>
<div class="next" data-next>
<div class="next__info">
<span class="thumb" data-thumb aria-hidden="true">
<svg class="art" viewBox="0 0 160 90" preserveAspectRatio="xMidYMid slice"><use href="#art"/></svg>
</span>
<span class="next__text">
<span class="next__kicker">Up next · 44 min</span>
<span class="next__title">Salt Lines</span>
</span>
</div>
<div class="next__actions">
<button class="pill" type="button" data-pill>
<span class="pill__face" data-face>
<span class="pill__fill" aria-hidden="true"></span>
<span class="pill__label">
<svg class="play" viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 3.2v9.6L12.6 8 4.5 3.2Z"/></svg>
<span class="pill__word">Next episode</span>
<span class="pill__sec"><span class="roll" data-sec><span class="roll__line">8</span></span></span>
</span>
<span class="pill__label pill__label--on" aria-hidden="true">
<svg class="play" viewBox="0 0 16 16"><path d="M4.5 3.2v9.6L12.6 8 4.5 3.2Z"/></svg>
<span class="pill__word">Next episode</span>
<span class="pill__sec"><span class="roll" data-sec-on><span class="roll__line">8</span></span></span>
</span>
</span>
</button>
<button class="ghost" type="button" data-credits>Watch credits</button>
</div>
</div>
<p class="sr" aria-live="polite" data-live></p>
</section>
<svg width="0" height="0" style="position:absolute" aria-hidden="true">
<defs>
<linearGradient id="sky" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#0b1424"/>
<stop offset=".62" stop-color="#1d3150"/>
<stop offset="1" stop-color="#5c7fb8"/>
</linearGradient>
<linearGradient id="sea" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#16243d"/>
<stop offset="1" stop-color="#060a12"/>
</linearGradient>
<radialGradient id="halo" cx=".5" cy=".5" r=".5">
<stop offset="0" stop-color="#8fb8ff" stop-opacity=".55"/>
<stop offset="1" stop-color="#8fb8ff" stop-opacity="0"/>
</radialGradient>
<g id="art">
<rect width="160" height="90" fill="url(#sky)"/>
<circle cx="112" cy="34" r="22" fill="url(#halo)"/>
<circle cx="112" cy="34" r="7.5" fill="#dbe7ff"/>
<rect y="56" width="160" height="34" fill="url(#sea)"/>
<path d="M0 56h160" stroke="#8fb8ff" stroke-opacity=".55" stroke-width=".5"/>
<path d="M104 60h16M100 65h24M96 71h32M92 78h40" stroke="#dbe7ff" stroke-opacity=".28" stroke-width=".7" stroke-linecap="round"/>
<path d="M22 56V40l3-2 3 2v16" fill="#05080f"/>
<path d="M23.5 41h3" stroke="#f2d38a" stroke-width="1.4"/>
</g>
</defs>
</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.
59 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Next episode button” from Animorio and fit it into my siteGSAP takes a number from 0 to 1 over COUNT seconds with ease none and writes it to the CSS variable --p: the white fill is a scaleX(var(--p)), the dark label is a copy of the light one clipped with clip-path, the label widens with font-stretch and the shadow grows with the same number. The seconds are Math.ceil(COUNT × (1 − p)) and only roll when they change.
pointerenter pauses the countdown tween and swells the pill to HOVER_SCALE on a spring; pointerleave resumes it from where it was. Mouse only: on a phone the tap is already the click.
On click the thumbnail is measured inside the player with getBoundingClientRect and the next episode’s scene, the same drawing, starts from there: left, top, width and height grow to cover the whole player in GROW seconds with expo.inOut, and the corner radius goes from the thumbnail’s to the player’s.
Watch credits kills the countdown, squeezes the pill sideways, sends it off with back.in and brings the credits screen back to scale 1 on an elastic.out(1, SPRING) spring.
| Name | File | Default | What it changes |
|---|---|---|---|
COUNT | script.js | 8 | Seconds of the countdown before the next episode plays by itself. |
SHRINK | script.js | 0.56 | How small the credits get while the card is on screen. |
CREDITS_SPEED | script.js | 34 | Seconds the credits take to roll once. |
GROW | script.js | 0.75 | Seconds the thumbnail takes to grow into the whole player. |
HOVER_SCALE | script.js | 1.035 | How much the pill swells with the mouse on it. |
SPRING | script.js | 0.55 | How springy the credits are going back full screen (lower = more bounce). |
At the end of a video on a streaming, course or video podcast site, in a playlist or a series of lessons: wherever the next piece starts by itself and the viewer must be able to stop it, skip ahead or put it off.
The player is taller and the card takes the full width under the shrunk credits; sizes are in em tied to both width and height, so everything fits the box. A tap is the click, without the mouse pause.
No movement or springs: the credits dim instead of shrinking, the card fades in, the seconds change without rolling and the next episode fades in.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.9 KB; the libraries: GSAP 28 KB.
Tested on 26 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.
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.