
The star rating
Ratings, SVG, Hover
The Regenerate button under an invented AI assistant’s answer, on black: a graphite pill with the circular arrow. On hover the arrow winds up by a quarter turn; pressed, it makes a full turn and keeps spinning while a liquid metal trail, chrome with a cool blue glint, runs along the pill’s edge and the label becomes Regenerating. Then the arrow stops with a small settle, the trail gathers into a drop of light and the 2 / 2 version counter opens beside it, with the arrows to browse the versions.
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>
<!--
"Regenerate 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>The Regenerate button with the liquid metal trail on its edge</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 Regenerate button under an AI assistant's answer: a liquid metal light runs
round the pill while the arrow spins, then the version counter opens beside it -->
<div class="fit" data-fit>
<div class="row" data-row>
<button class="btn" type="button" data-btn data-autoclic aria-label="Regenerate Mira’s answer">
<span class="btn__sheen" aria-hidden="true"></span>
<svg class="trail" data-trail aria-hidden="true">
<defs>
<linearGradient id="cromo" data-chrome gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="200" y2="60">
<stop offset="0" stop-color="#ffffff"/>
<stop offset="0.16" stop-color="#9aa3b5"/>
<stop offset="0.3" stop-color="#2b303b"/>
<stop offset="0.44" style="stop-color: var(--accento-chiaro)"/>
<stop offset="0.58" stop-color="#ffffff"/>
<stop offset="0.72" stop-color="#5f6778"/>
<stop offset="0.86" stop-color="#e9edf7"/>
<stop offset="1" stop-color="#7c8496"/>
</linearGradient>
<filter id="liquido" x="-10%" y="-40%" width="120%" height="180%">
<feTurbulence type="fractalNoise" baseFrequency="0.035 0.055" numOctaves="1" seed="7" result="n"/>
<feDisplacementMap in="SourceGraphic" in2="n" scale="2.2" xChannelSelector="R" yChannelSelector="G"/>
</filter>
<filter id="alone" x="-20%" y="-60%" width="140%" height="220%">
<feGaussianBlur stdDeviation="3.2"/>
</filter>
</defs>
<path class="trail__rim" data-rim d=""/>
<g class="trail__glow" filter="url(#alone)" data-glow></g>
<g class="trail__metal" filter="url(#liquido)" data-metal></g>
<circle class="trail__head" data-head r="2.2" cx="0" cy="0"/>
</svg>
<span class="btn__icon" aria-hidden="true">
<svg class="arrow" data-arrow viewBox="0 0 24 24">
<circle class="arrow__ring" data-ring cx="12" cy="12" r="7.25" pathLength="100"/>
<path class="arrow__tip" data-tip d="M15.67 3.11 16.5 6.2 13.41 7.03"/>
</svg>
</span>
<span class="btn__words">
<span class="btn__stem">Regenerat</span><span class="btn__end" data-end><span class="btn__suf" data-suf-e>e</span><span class="btn__suf btn__suf--ing" data-suf-ing aria-hidden="true">ing</span></span>
</span>
<kbd class="btn__key" data-key aria-hidden="true">R</kbd>
</button>
<div class="versions" data-versions aria-label="Answer versions" role="group">
<div class="versions__in" data-versions-in>
<button class="versions__btn" type="button" data-prev aria-label="Previous version">
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M9.8 3.8 5.6 8l4.2 4.2"/></svg>
</button>
<span class="versions__count" aria-live="polite">
<span class="roll" data-cur><span>1</span></span><span class="versions__sep">/</span><span class="roll" data-tot><span>1</span></span>
</span>
<button class="versions__btn" type="button" data-next aria-label="Next version">
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6.2 3.8 10.4 8l-4.2 4.2"/></svg>
</button>
</div>
</div>
</div>
</div>
<p class="sr" data-live aria-live="polite"></p>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></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.
22 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 “Regenerate button” from Animorio and fit it into my siteThe script measures the pill and writes a pill-shaped path that starts at the top centre and runs clockwise, with pathLength 1000: so every trail measure is given in thousandths of the edge, whatever the width. The path is only rewritten when the pill changes size, also halfway through the widening of Regenerating.
SVG cannot fade a stroke along its length, so the trail is seven stacked dashes that all end at the head: the longest is thin and nearly transparent, the shortest thick and solid. Each has stroke-dasharray L and 1000 minus L, and stroke-dashoffset L minus the head position, which, with the period equal to the edge, wraps round with no jump.
The strokes use a chrome linearGradient (white, steel grey, near black, a blue glint) that rotates with the head, so the reflections slide along the trail; a feDisplacementMap with a still noise makes the rim wobble as the trail passes over different parts of the noise. Underneath, three wider strokes with a feGaussianBlur make the glow, and the head position (getPointAtLength) lights the glint inside the graphite.
The arrow and the trail head read the same speed f, which GSAP takes from 0 to 1 with power2.in on press: they start together and spin together in the ticker, with the step capped at a thirtieth of a second. To stop, f goes back to zero and the arrow moves on to the next full turn with elastic.out, while the head reaches the top and the tail shortens until it gathers into a point that flares and fades.
Regenerat is fixed; the ending sits in a one-line window with e and ing stacked, and the window width goes from one to the other with back.out, so the pill widens by itself. The counter opens from zero width to its natural size; each number rolls in its own window, up going forward and down going back.
| Name | File | Default | What it changes |
|---|---|---|---|
BUSY | script.js | 2.6 | Seconds the answer takes to regenerate: the arrow spins and the trail runs along the edge. |
LAP | script.js | 1.05 | Seconds for one lap of the trail round the pill. |
SPIN | script.js | 0.8 | Seconds for one turn of the arrow while it spins. |
TRAIL | script.js | 0.34 | Length of the trail, as a share of the edge. |
WIND | script.js | 90 | Degrees the arrow winds up by on hover. |
WOBBLE | script.js | 1.6 | How much the liquid metal wobbles on the edge (0 smooth). |
MAX_VERSIONS | script.js | 5 | How many versions of the answer are kept. |
PRESS_SCALE | script.js | 0.968 | How far the pressed button sinks. |
ACCENT | script.js | #9fb4ff | The accent colour: the cool glint in the metal and the glow. |
Under the answer of an AI chat, in a text or image generator, in an app that rewrites emails or captions: the button to ask for another version, with the counter to go back to the earlier ones. Without the counter it suits any Retry or Refresh that takes a few seconds.
The same animation: if the row with the open counter does not fit the screen minus 24 pixels, the script scales it down just enough, recalculating on resize. A tap is the click; the hover quarter turn comes with focus.
Nothing spins and nothing moves: the arrow stays still, instead of the trail the whole chrome edge fades in and fades out at the end, labels and numbers swap with a fade and the counter appears without a spring; the pilot’s pointer is hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 9.6 KB; the libraries: GSAP 28 KB.
Tested on 11 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.