
The star rating
Ratings, SVG, Hover
The button that casts to the TV in a streaming app. Pressed, the pill widens, the icon’s waves search one after the other, then the name of the TV it found appears; once connected the pill lights up, the screen in the icon fills in and a ring leaves the edge. One more press and it stops.
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>
<!--
"Cast 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>Cast 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">
<!-- a Cast button: the waves of the icon search one after the other, the TV is found by name,
and the pill stays lit with the screen filled in while it is casting; one more press stops it -->
<button class="cast" type="button" data-cast aria-pressed="false">
<span class="cast__ring" data-ring aria-hidden="true"></span>
<span class="cast__in" data-in>
<svg class="cast__icon" viewBox="0 0 24 24" aria-hidden="true">
<path class="cast__glass" data-glass d="M4.200 5.200h15.600v13.600h-6.500A10.300 10.300 0 0 0 4.200 9.300Z"></path>
<path class="cast__screen" d="M3 8V6.500A2.500 2.500 0 0 1 5.500 4h13A2.500 2.500 0 0 1 21 6.500v11a2.500 2.500 0 0 1-2.500 2.500H14"></path>
<path class="cast__wave" data-wave d="M3 11.500a8.500 8.500 0 0 1 8.500 8.500"></path>
<path class="cast__wave" data-wave d="M3 15.500a4.500 4.500 0 0 1 4.500 4.500"></path>
<circle class="cast__dot" data-wave cx="3.600" cy="19.400" r="1.300"></circle>
</svg>
<span class="cast__text">
<span class="cast__roll cast__label" data-labelbox><span data-label>Cast</span></span>
<span class="cast__roll cast__sub" data-subbox><span data-sub></span></span>
</span>
</span>
<span class="cast__say" data-say aria-live="polite"></span>
</button>
<span class="cast__measure" data-measure aria-hidden="true"></span>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></path></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.
11 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 “Cast button” from Animorio and fit it into my siteIdle, searching, found, casting: one function sets label, width, colours and icon for each state, and the timed steps are delayed calls that are cancelled if you press first.
A hidden twin in the same type measures each state’s label; the pill gets there on an elastic spring, so when the TV’s name changes the size is already right.
Dot and two arcs are three paths: a looping timeline lights them from nearest to farthest and dims them again, slightly offset. Once connected they stay lit and the screen fills in.
The button has aria-pressed and a hidden aria-live region says each step in words: searching, found, casting, stopped.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #4f7dff | The colour of the pill while it is casting. |
SEARCH | script.js | 1.6 | How many seconds it searches before finding the TV. |
CONNECT | script.js | 1 | How many seconds it takes to connect once found. |
STRETCH | script.js | 1 | How elastic the pill is when its width changes: 0.3 = stiff, 2 = very elastic. |
LOOP | script.js | true | Left alone, the demo’s pointer casts and then stops. |
In the player of a streaming, music or podcast app, on a video course page, in a photo app that sends pictures to the TV. The same sequence (search, find by name, stay lit) suits Bluetooth headphones, a printer, a speaker.
The same button, 58 pixels tall: you press it with a thumb. The pill never gets wider than the screen.
The pill changes size, label and colour at once, with no springs or waves, and finds the TV right away. The demo does not move by itself.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.1 KB; the libraries: GSAP 28 KB.
Tested on 20 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.