
Button menu
Menus, Transitions, Text
The subtitles of a video player on black, for «Quiet Harbour», a made-up series. Each line arrives faint and its words settle out of a thin blur as the voice says them; the next line pushes the first away with a small slide. The CC button opens a glass menu: the language (English, Italiano, Español) recomposes the line in the new language with the words already said in place, and the size S, M, L slides the knob and resizes the caption pill on a spring; the CC underline lights up while subtitles are on.
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>
<!--
"Video subtitles" 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>Video subtitles</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/geist@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>
<main class="stage">
<!-- the subtitles of a video player: each line arrives dim and its words settle out of a faint blur as the voice
says them; the CC menu changes the language (the line recomposes in the new one) and the text size (the
caption pill resizes on a spring); the CC underline lights up while subtitles are on -->
<section class="player" data-player aria-label="Video player">
<div class="frame" aria-hidden="true">
<div class="frame__sky"></div>
<div class="frame__sun" data-sun></div>
<div class="frame__sea"></div>
<div class="frame__line"></div>
<div class="frame__grain"></div>
</div>
<header class="top" aria-hidden="true">
<span class="top__title">Quiet Harbour</span>
<span class="top__ep">Episode 3 · The Night Ferry</span>
</header>
<div class="caps" data-caps>
<p class="cap" data-cap aria-live="polite"></p>
</div>
<div class="menu" data-menu role="dialog" aria-label="Subtitles" hidden>
<p class="menu__head">Subtitles</p>
<div class="menu__list" role="radiogroup" aria-label="Language" data-langs>
<button type="button" role="radio" aria-checked="false" data-lang="off"><span>Off</span><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8.4l3 3 6-6.6" pathLength="1"/></svg></button>
<button type="button" role="radio" aria-checked="true" data-lang="en"><span>English</span><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8.4l3 3 6-6.6" pathLength="1"/></svg></button>
<button type="button" role="radio" aria-checked="false" data-lang="it"><span>Italiano</span><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8.4l3 3 6-6.6" pathLength="1"/></svg></button>
<button type="button" role="radio" aria-checked="false" data-lang="es"><span>Español</span><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8.4l3 3 6-6.6" pathLength="1"/></svg></button>
</div>
<div class="menu__size">
<span class="menu__label">Size</span>
<div class="sizes" role="radiogroup" aria-label="Text size" data-sizes>
<span class="sizes__knob" data-knob aria-hidden="true"></span>
<button type="button" role="radio" aria-checked="false" data-size="s">S</button>
<button type="button" role="radio" aria-checked="true" data-size="m">M</button>
<button type="button" role="radio" aria-checked="false" data-size="l">L</button>
</div>
</div>
</div>
<div class="bar">
<button type="button" class="icon" data-play aria-label="Pause">
<svg viewBox="0 0 20 20" aria-hidden="true"><g data-ico-pause><rect x="5" y="4" width="3.4" height="12" rx="1.2"/><rect x="11.6" y="4" width="3.4" height="12" rx="1.2"/></g><path data-ico-play d="M6 4.2v11.6a.8.8 0 0 0 1.2.7l9.4-5.8a.8.8 0 0 0 0-1.4L7.2 3.5A.8.8 0 0 0 6 4.2z"/></svg>
</button>
<span class="time" data-time aria-hidden="true">12:04</span>
<div class="track" aria-hidden="true"><span class="track__done" data-done></span><span class="track__head" data-head></span></div>
<span class="time time--end" aria-hidden="true">41:30</span>
<button type="button" class="cc" data-cc aria-label="Subtitles" aria-expanded="false" aria-pressed="true">
<span class="cc__box">CC</span>
<span class="cc__line" data-cc-line aria-hidden="true"></span>
</button>
</div>
</section>
</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.
31 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 “Video subtitles” from Animorio and fit it into my siteA number rises with the GSAP ticker (the real time between frames, at most 100 ms). Each line has a start and a speaking time worked out from the English words, WORD_PACE seconds each: so every language speaks in the same beats, and word k of n lights up at k/(n − 1) of the time.
The words are separate spans, all at DIM opacity. When the voice reaches a word, a fromTo takes it from blur(BLUR px) and 0.12 em lower to sharp and in place in 0.42 s with power2.out.
It takes the share of words already said, the old ones blur away 0.012 s apart and the line is rebuilt in the new language with the same share lit, the words coming in staggered out of the blur.
The selector knob takes the x, width and height of the chosen button with back.out; the caption pill goes to its new font-size in em with elastic.out(1, SPRING), and the background follows by itself because it is the same box.
| Name | File | Default | What it changes |
|---|---|---|---|
WORD_PACE | script.js | 0.3 | Seconds between two spoken words. |
HOLD | script.js | 1.1 | Seconds a finished line stays before the next one. |
DIM | script.js | 0.4 | Opacity of the words not said yet. |
BLUR | script.js | 5 | Pixels of blur each word settles out of. |
SIZE_S | script.js | 0.95 | Subtitle size S, in em. |
SIZE_M | script.js | 1.25 | Subtitle size M, in em. |
SIZE_L | script.js | 1.6 | Subtitle size L, in em. |
SPRING | script.js | 0.55 | How much the pill bounces when it changes size (lower, more bounce). |
IDLE | script.js | 7 | Seconds without touches before the demo goes back to changing language and size by itself. |
In any video player on a site: streaming, courses, interviews, trailers, product videos; wherever viewers may have the sound off or speak another language, and subtitles must be readable, in the right language and at the right size.
The player is taller, the menu a little narrower and lower; sizes are in em tied to width and height, so player, subtitles and menu fit the box. A tap is the click.
No movement or blur: lines fade in, words light up without settling, the language change cross-fades, the size changes at once and the menu fades in.
GSAP 3.15.0, Geist (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.
Tested on 27 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.