
The star rating
Ratings, SVG, Hover
One button, one sign, in the simple style of product interface pieces: after the sign-in code is sent the pill waits, grey, «Resend in 0:09», with the seconds counting down on thin vertical rollers and a ring drawing itself around. When the ring closes it grows an arrowhead and becomes the resend arrow, the pill turns black and says «Resend code». On tap the arrow spins once and unwinds into a check: «Code sent».
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>
<!--
"Resend code 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 Resend code button with the countdown that closes into an arrow</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>
<!-- one button, one sign: the countdown ring closes, grows an arrowhead and becomes the resend icon -->
<button class="resend" type="button" data-resend aria-disabled="true" aria-live="polite" aria-label="Resend code in 9 seconds">
<span class="resend__body" data-body>
<svg class="resend__icon" viewBox="0 0 24 24" aria-hidden="true">
<g data-turn>
<path class="resend__track" d="M12 4A8 8 0 1 1 5.07 8"/>
<path class="resend__ring" data-ring d="M12 4A8 8 0 1 1 5.07 8"/>
<path class="resend__head" data-head d="M2.2 8.6 5.07 8 5.8 10.85"/>
</g>
<path class="resend__check" data-check d="M7.4 12.3l3.1 3.1 6.1-6.7"/>
</svg>
<span class="resend__label" aria-hidden="true">
<span class="resend__word resend__word--wait" data-word="wait"><span class="resend__lead" data-lead>Resend in</span> <span class="resend__time"><span class="resend__min" data-min>0</span>:<span class="resend__slot" data-slot="tens"></span><span class="resend__slot" data-slot="ones"></span></span></span>
<span class="resend__word" data-word="ready">Resend code</span>
<span class="resend__word" data-word="sent">Code sent</span>
</span>
</span>
</button>
</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.
20 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 “Resend code button” from Animorio and fit it into my siteThe icon is an SVG of four paths: a 300 degree arc, the same arc underneath as a thin track, the arrowhead and the check. The countdown draws the arc with strokeDashoffset, from its length to zero, as much as the time that has passed; at zero the arrowhead scales from 0 to 1 around the arc’s tail (svgOrigin) with back.out, and the arc with its head is already the resend arrow.
Each digit of the seconds is a column 9, 8, 7 … 0, 9 inside a 0.62 em slot with hidden overflow and a soft mask top and bottom. Counting down the roller always moves forward by one cell; from 0 to 9 it goes to the last 9 and then jumps, unseen, to the first. Every step uses back.out, so it goes a pixel too far and comes back.
The countdown is a single linear tween of a number from WAIT to zero, WAIT real seconds long: onUpdate draws the ring continuously and turns the rollers only when the whole second changes. SPEED changes the springs, never the length of the wait.
Grey with a hairline border while it waits, black with a shadow when it is ready: GSAP moves colour, text and shadow together. The words swap as in the Mute button: the old ones rise and leave, the new ones come in narrow (wdth 75) and open up, and the pill follows the width of the new words measured at their final shape.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #2f6bff | The colour of the ring, the arrow and the check. |
WAIT | script.js | 9 | How many seconds before the code can be sent again (apps often use 30). |
LABEL_WAIT | script.js | Resend in | The words before the seconds. |
LABEL_READY | script.js | Resend code | The words once it can be tapped. |
LABEL_SENT | script.js | Code sent | The words after the tap. |
SPRING | script.js | 1 | How springy the press, the digits and the pill are: 0.4 calm, 2 very bouncy. |
SPEED | script.js | 1 | The speed of the movements: 2 twice as fast, 0.5 half (the countdown keeps real seconds). |
HOLD | script.js | 1.6 | How many seconds «Resend code» waits before the button taps itself. |
AUTO | script.js | true | The button plays the whole round by itself until someone touches it. |
On the verification code screen of a sign-in, a sign-up or a payment: whoever is waiting sees how long is left without reading a notice, and understands by themselves when they can ask for a new code.
On the phone the pill and the icon take their size from the screen (clamp on the shorter side); there is no hover, everything else is the same.
The digits change in place with no roll, the ring still draws because it is the time passing, the arrowhead, the check and the words fade in; no springs, no spin, no shake.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.0 KB; the libraries: GSAP 28 KB.
Tested on 31 October 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.