
The elastic button
Buttons, Hover, Text
The “Make an offer” button of a second-hand marketplace, doing the whole negotiation by itself: it opens into the price to propose, with plus and minus keys, ready-made discounts and the bar saying how likely the offer is to be accepted; then it closes while the offer leaves, comes back with the seller’s counter-offer and, once accepted, becomes the deal with its price.
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>
<!--
"Make an offer 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>Make an offer 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 Make an offer button of a second-hand marketplace: it opens into the price to propose,
the offer leaves, the seller's counter-offer comes back and the deal is closed -->
<i class="frame" data-frame aria-hidden="true"></i>
<div class="of" data-of data-state="idle">
<button class="of__face of__idle" type="button" data-face="idle" data-open>
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M10.800 2.500H16a1.500 1.500 0 0 1 1.500 1.500v5.200a1.500 1.500 0 0 1-.440 1.060l-6.500 6.500a1.500 1.500 0 0 1-2.120 0l-5.200-5.200a1.500 1.500 0 0 1 0-2.120l6.500-6.500a1.500 1.500 0 0 1 1.060-.440Z"></path><circle cx="13.500" cy="6.500" r="1.200"></circle></svg>
<span>Make an offer</span>
</button>
<div class="of__face of__panel" data-face="panel" role="group" aria-label="Your offer">
<div class="of__row"><span class="of__label">Your offer</span><button class="of__close" type="button" data-close aria-label="Close"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="m2.500 2.500 7 7m0-7-7 7"></path></svg></button></div>
<div class="of__amount">
<button class="of__step" type="button" data-step="-1" aria-label="Lower the offer"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M2.500 6h7"></path></svg></button>
<span class="of__price"><i>$</i><span class="of__digits"><b data-outoffer>200</b></span></span>
<button class="of__step" type="button" data-step="1" aria-label="Raise the offer"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M2.500 6h7M6 2.500v7"></path></svg></button>
</div>
<p class="of__listed">Listed at <b>$200</b></p>
<div class="of__chips" role="group" aria-label="Quick offers">
<button type="button" data-pct="5" aria-pressed="false">5% off</button>
<button type="button" data-pct="10" aria-pressed="false">10% off</button>
<button type="button" data-pct="15" aria-pressed="false">15% off</button>
</div>
<div class="of__meter"><span class="of__track"><i data-fill></i></span><span class="of__chance"><span data-outchance>Very likely to be accepted</span></span></div>
<button class="of__send" type="button" data-send><span>Send offer</span></button>
</div>
<div class="of__face of__sent" data-face="sent" aria-hidden="true">
<svg viewBox="0 0 20 20" aria-hidden="true"><path class="of__plane" d="M17.500 2.500 8.800 11.200M17.500 2.500l-5.300 15-3.400-6.300-6.300-3.400Z"></path><path class="of__check" pathLength="1" d="m4.500 10.500 3.600 3.600 7.400-8.200"></path></svg>
<span class="of__senttext"><span data-outsent>Sending offer</span></span>
<i class="of__wire" data-wire></i>
</div>
<div class="of__face of__counter" data-face="counter" role="group" aria-label="Counter-offer">
<span class="of__who"><span class="of__label">Seller countered</span><strong><span>$<b data-outcounter>190</b></span><s>$<b data-outmine>175</b></s></strong></span>
<button class="of__no" type="button" data-decline aria-label="Decline"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="m2.500 2.500 7 7m0-7-7 7"></path></svg></button>
<button class="of__yes" type="button" data-accept>Accept</button>
</div>
<button class="of__face of__deal" type="button" data-face="deal" data-reset>
<svg viewBox="0 0 20 20" aria-hidden="true"><path class="of__check" pathLength="1" d="m4.500 10.500 3.600 3.600 7.400-8.200"></path></svg>
<span>Deal at $<b data-outdeal>190</b></span>
</button>
</div>
<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.
31 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 “Make an offer button” from Animorio and fit it into my siteThe button is a single shell with five faces laid on top of each other: button, offer, sending, counter-offer, deal. On every step the shell takes the width, height and colour of the new face on a spring, the old one goes out and the new one comes on.
The offer moves in fixed steps between half the price and the full price. The likelihood is a single number, worked out from the discount: it lengthens the bar, fades it and picks the line of text.
After sending, a GSAP delay brings the answer: within five per cent of the price it is a yes, otherwise a counter-offer halfway, with the figure counting from yours to theirs.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #f0563a | The colour of sending, of the bar and of the deal. |
PRICE | script.js | 200 | The listed price, in dollars. |
STEP | script.js | 5 | How much the offer changes on every tap of plus and minus. |
SPRING | script.js | 1 | How much the button bounces as it changes shape. |
REPLY | script.js | 1.4 | How many seconds the seller’s answer takes. |
On a listing page in a second-hand marketplace, for pre-owned clothing, cars, musical instruments or furniture; in any shop where the price can be negotiated. The same shell carries a price proposal for a quote or a rental.
Open, the card is at most 284 pixels wide and about 250 tall, and narrows with the screen. The plus and minus keys are 38 pixel circles, the discounts 30 tall and “Send offer” 42 tall and as wide as the card: everything is thumb-sized and nothing depends on hover.
The button changes size at once and the faces cross-fade; the price and the words change without rolling, the bar takes its length immediately, the tick is already drawn and the counter-offer figure is already its own. 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 7.3 KB; the libraries: GSAP 28 KB.
Tested on 27 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.