
The elastic button
Buttons, Hover, Text
One button, one gesture, in the simple style of product interface pieces: the black «Start free trial» pill of a piece of software; on hover «14 days, no card» appears underneath, on tap the line squeezes and becomes fourteen thin ticks, one per day, and a light runs along them from the last to the first, which keeps the light and stands taller. The label becomes «Trial started».
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>
<!--
"Free trial 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 free trial button with the days as ticks</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 gesture: the fourteen days under the label become fourteen ticks, and the light runs back to the first -->
<div class="trial" data-trial>
<button class="trial__button" type="button" data-button aria-pressed="false" aria-label="Start free trial">
<span class="trial__body" data-body>
<span class="trial__label" aria-hidden="true">
<span class="trial__word" data-word="start">Start free trial</span>
<span class="trial__word" data-word="done">Trial started</span>
</span>
</span>
</button>
<div class="trial__meta" aria-hidden="true">
<span class="trial__note" data-note>14 days, no card</span>
<span class="trial__ticks" data-ticks></span>
</div>
</div>
</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.
17 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 “Free trial button” from Animorio and fit it into my siteUnder the pill there is a single grid cell holding two things: the line «14 days, no card» and a flex row of ticks, one and a half pixel wide spans made by the script, as many as DAYS. They sit on top of each other, so the line can become the ticks without anything moving.
The line leaves by taking the wdth axis from 100 to 75 and the letter spacing below zero with power2.in: it seems to gather itself. The ticks grow with scaleY from zero, origin at the bottom, with a from center stagger and back.out, which gives the extra pixel before the settle.
A loop from the last tick to the second puts two tweens per tick in the timeline, 50 milliseconds apart: it lights up in the accent colour and rises to 1.18, then goes back to grey and 1 in 0.42 seconds. So the light leaves a short trail. The first one goes to 1.62 and settles at 1.45 on an elastic spring.
The label changes when the light reaches the first tick, not on the tap: «Trial started» is read just as day one lights up. The pill’s width follows the new word, measured in its final shape.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #2f6bff | The colour of the light on the ticks. |
DAYS | script.js | 14 | How many days the trial lasts: one tick per day. |
LABEL_START | script.js | Start free trial | The label on the button. |
LABEL_DONE | script.js | Trial started | The label once the trial has started. |
NOTE | script.js | 14 days, no card | The quiet line under the button. |
SPRING | script.js | 1 | How springy the press and the ticks are: 0.4 calm, 2 very bouncy. |
SPEED | script.js | 1 | The speed of everything: 2 twice as fast, 0.5 half. |
HOLD | script.js | 2.4 | How many seconds the started trial stays when the button plays by itself. |
AUTO | script.js | true | The button plays the gesture by itself until someone touches it. |
For the button that starts the free trial of a piece of software or a subscription app: the days can be seen, and the first lit tick says that day one is today.
On the phone the pill, the line and the ticks take their size from the screen (clamp on the shorter side); there is no hover, so the «14 days, no card» line is already visible at rest; everything else is the same.
The line, the ticks and the words swap with a fade, with no springs or movement; the first tick is already lit and the pill takes its new width at once.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 4.6 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.