
The elastic button
Buttons, Hover, Text
The “Sign the petition” button of a campaign: on tap a pen signature writes itself inside the pill, which turns blue with “Signed, thank you” and its tick. Above it, the count of signatures goes up by one with only the changing digit rolling, the bar moves towards the goal with a light at its head and your avatar makes room for itself in front of the latest signers.
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>
<!--
"Sign petition 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>Sign petition 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">
<!-- the Sign the petition button of a campaign: the pen signs inside the pill, the count of
signatures goes up by one, the bar moves towards the goal and you join the last signers -->
<i class="frame" data-frame aria-hidden="true"></i>
<section class="pt" data-pt data-state="idle" aria-label="Petition">
<p class="pt__count"><strong class="pt__digits" data-digits aria-hidden="true"></strong><span class="pt__of">signed of <b data-outgoal>15,000</b></span></p>
<span class="pt__track" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" aria-label="Signatures towards the goal" data-track><i data-bar></i><i class="pt__spark" data-spark></i></span>
<div class="pt__people">
<span class="pt__faces" data-faces><i class="pt__you" data-you>You</i><i style="--c:#f2b84b">IR</i><i style="--c:#7cc6a4">MT</i><i style="--c:#e58a7b">LO</i></span>
<span class="pt__names"><span data-outnames>Ines, Mateo and Lore just signed</span></span>
</div>
<button class="pt__btn" type="button" data-sign aria-pressed="false">
<span class="pt__face pt__face--ask"><svg viewBox="0 0 20 20" aria-hidden="true"><path d="M13.200 3.300a1.900 1.900 0 0 1 2.700 0l.800.800a1.900 1.900 0 0 1 0 2.700L8 15.500l-4.200 1 .900-4.300Z"></path><path d="m11.700 4.800 3.500 3.500"></path></svg><span>Sign the petition</span></span>
<svg class="pt__ink" viewBox="0 0 280 52" aria-hidden="true"><path data-ink pathLength="1" d="M64 31c9-17 16-19 15-8-1 10-8 15-5 6 5-11 14-15 16-7 1 6-3 10 3 4 7-7 10-11 14-5 2 4 1 8 7 3 6-5 10-8 15-3 3 3 7 4 14 1 12-5 32-7 73-6"></path></svg>
<span class="pt__face pt__face--done"><svg viewBox="0 0 20 20" aria-hidden="true"><path data-tick pathLength="1" d="m4.800 10.400 3.400 3.400 7-7.800"></path></svg><span>Signed, thank you</span></span>
</button>
</section>
<span class="live" aria-live="polite" data-live></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.
21 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 “Sign petition button” from Animorio and fit it into my siteInside the button there is a signature-shaped path, drawn by taking stroke-dashoffset from one to zero. A single timeline sends the words out, writes the signature, changes the colour and brings in the answer with its tick.
The count is written one digit per column. On every change old and new digits are compared, and only the columns that change roll: from 12,847 to 12,848 a single digit moves.
The bar is the share of the goal reached, on a spring and with a light running to its head. Your avatar starts zero wide and widens at the front of the row, pushing the others.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #4d5dfb | The colour of the bar, your avatar and the signed button. |
SIGNED | script.js | 12847 | How many signatures there are before yours. |
GOAL | script.js | 15000 | The signature goal. |
SPRING | script.js | 1 | How much the button, the bar and the avatar bounce. |
On the page of a petition, a campaign or a nonprofit’s appeal; with other words it carries a waitlist (“Join the waitlist”), a public pledge, an event sign-up or a vote: anywhere a single gesture adds one person to a count everyone can see.
The block is at most 280 pixels wide and about 190 tall; the big number is sized on height too, so it fits a short window. The pill is 52 pixels tall and as wide as the block: it is thumb-sized and nothing depends on hover.
No signature writing itself: the button goes straight to “Signed, thank you” with its tick already drawn, the digit changes without rolling, the bar takes its length at once and the avatar is already in place. The demo’s pointer does not start.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.5 KB; the libraries: GSAP 28 KB.
Tested on 28 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.