
The elastic button
Buttons, Hover, Text
A parking fine in a city app: the discounted amount counts up, the full one is struck through, five segments tell how many days the discount has left and give their date on hover; paying, the button fills, spins and the whole card turns from amber to green.
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>
<!--
"Parking fine card" 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>Parking fine card</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 city app's parking fine: the early payment discount runs out day by day on five segments,
hovering a segment tells its date, and paying turns the whole card green -->
<section class="mf" data-mf aria-label="Parking fine">
<header class="mf__head">
<span class="mf__sign" aria-hidden="true">
<svg viewBox="0 0 24 24"><path d="M9 17.500V6.500h3.900a3.300 3.300 0 0 1 0 6.600H9"></path></svg>
</span>
<span class="mf__who">
<b>Parking fine</b>
<span>Corso Lume, <span data-issued></span></span>
</span>
<span class="mf__state"><span class="mf__state-word"><span data-state>Due</span></span></span>
</header>
<div class="mf__car">
<span class="mf__plate" aria-label="Plate GX 482 KT"><i aria-hidden="true"></i><span>GX 482 KT</span></span>
<span class="mf__why">Zone B, no permit</span>
</div>
<div class="mf__amount">
<b class="mf__num" data-num>€0.00</b>
<span class="mf__full"><span data-full></span><i class="mf__strike" data-strike></i></span>
<span class="mf__off" data-off></span>
</div>
<div class="mf__window">
<div class="mf__row">
<span>Early payment discount</span>
<span class="mf__left"><span data-left></span></span>
</div>
<div class="mf__days" data-days role="img" aria-label="Five days of discount">
<span class="mf__tip" data-tip aria-hidden="true"><b data-tip-day></b><span data-tip-note></span></span>
</div>
</div>
<button class="mf__pay" type="button" data-pay>
<span class="mf__fill" data-fill></span>
<span class="mf__wash" data-wash></span>
<svg class="mf__icon" viewBox="0 0 20 20" aria-hidden="true">
<g data-cardicon><rect x="2.500" y="4.500" width="15" height="11" rx="2.400"></rect><path d="M2.500 8.300h15M5.500 12.300h3"></path></g>
<circle class="mf__spin" data-spin cx="10" cy="10" r="6.400" pathLength="1"></circle>
<path class="mf__tick" data-tick pathLength="1" d="M5.200 10.300 8.500 13.400 14.900 6.700"></path>
</svg>
<span class="mf__label"><span data-label></span></span>
</button>
</section>
<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.
24 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 “Parking fine card” from Animorio and fit it into my siteThe days gone are a single number, from 0 to 5: each segment fills its own share of it with scaleX, and the hours-left label is worked out from the same number.
The sign, the pill, the segments, the button and the shadow all read --tone. GSAP animates the variable from amber to green and the card changes colour all at once.
The glass label centres on the segment under the pointer, but its position is clamped between the card’s edges: on the last day it never sticks out.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #e8871e | The colour of the fine to pay. |
PAID | script.js | #1d9a5b | The colour of the paid fine. |
AMOUNT | script.js | 42 | The fine’s full amount, in euros. |
DISCOUNT | script.js | 30 | The discount for paying within the five days, in percent. |
HOURS_LEFT | script.js | 38 | The hours the discount has left (1 to 120). |
URGENT | script.js | 12 | Below how many hours the time left turns red. |
HOLD | script.js | 3.5 | After a payment made by hand, the seconds before the card is due again. |
LOOP | script.js | true | Left alone, a pointer runs along the days and pays. |
In a council’s or local police app, on a public payments portal, in a parking or car sharing app; and wherever something must be paid with a discount that runs out: a bill, a tax, an early renewal.
The same card: tapping a segment shows its date, the button is pressed with a thumb. The amount and the spacing are also sized on the window’s height.
Amount, strike-through and days are already in place. The date label appears without moving and paying changes colours and labels without motion.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.4 KB; the libraries: GSAP 28 KB.
Tested on 19 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.