
The elastic button
Buttons, Hover, Text
The «Notify me if it drops» button under the headphones of an invented shop, on white, in the style of clean product pieces: pressed, it opens into a small card with a price to drag, rolling digits and a mark for the lowest price of the last thirty days that pulls the handle in; Set alert closes it back into «Alert at $199», with the bell swinging and the check drawing itself.
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>
<!--
"Price drop alert 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 Notify me button for a price drop</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>
<!-- a product card of an invented shop: the Notify me button opens into a small card with a target price to drag,
a mark for the lowest price of the last 30 days, and closes back into the pill with the alert set -->
<section class="product" data-wrap aria-label="Verra Arc headphones">
<div class="product__row">
<div class="product__pic" aria-hidden="true">
<svg viewBox="0 0 64 64">
<path class="ph-band" d="M14 36V30a18 18 0 0 1 36 0v6"></path>
<path class="ph-band ph-band--in" d="M18 34v-4a14 14 0 0 1 28 0v4"></path>
<rect class="ph-cup" x="9" y="33" width="11" height="17" rx="5.5"></rect>
<rect class="ph-cup" x="44" y="33" width="11" height="17" rx="5.5"></rect>
<path class="ph-shine" d="M12 37v8"></path>
<path class="ph-shine" d="M47 37v8"></path>
</svg>
</div>
<div class="product__text">
<p class="product__brand">Verra</p>
<p class="product__name">Arc wireless headphones</p>
<p class="product__price"><span data-now>$249</span><span class="product__note">Lowest in 30 days: $219</span></p>
</div>
</div>
<div class="slot" data-slot>
<div class="alert" data-alert>
<!-- the pill -->
<button class="pill" data-pill type="button" aria-expanded="false">
<span class="pill__bell" data-bell>
<svg viewBox="0 0 24 24" aria-hidden="true">
<g data-bell-body>
<path d="M6.5 16.5V11a5.5 5.5 0 0 1 11 0v5.5l1.6 1.8H4.9Z"></path>
<path d="M10.2 20.4a2 2 0 0 0 3.6 0"></path>
</g>
<path class="pill__check" data-check d="M15.4 6.2l2 2 3.4-3.8"></path>
</svg>
</span>
<span class="pill__label" data-label><span data-label-in>Notify me if it drops</span></span>
</button>
<!-- the panel -->
<div class="panel" data-panel aria-hidden="true">
<div class="panel__head">
<p class="panel__ask">Alert me when it’s</p>
<p class="panel__price" aria-live="polite"><span class="panel__cur">$</span><span class="digits" data-digits></span></p>
</div>
<div class="track" data-track role="slider" tabindex="-1" aria-label="Target price" aria-valuemin="149" aria-valuemax="249">
<div class="track__rail"></div>
<div class="track__fill" data-fill></div>
<div class="track__low" data-low><span class="track__tick"></span><span class="track__tag">30-day low</span></div>
<div class="track__thumb" data-thumb></div>
</div>
<div class="panel__foot">
<p class="panel__save" data-save>Save $0</p>
<div class="panel__btns">
<button class="textbtn" data-cancel type="button">Cancel</button>
<button class="setbtn" data-set type="button">Set alert</button>
</div>
</div>
</div>
</div>
</div>
<p class="product__foot" data-foot>Free returns within 30 days.</p>
</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.
25 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 “Price drop alert button” from Animorio and fit it into my siteThe pill and the card are the same element, absolutely positioned inside a 172-pixel slot: on opening GSAP takes width, height and radius from the pill’s size to the card’s with back.out, and the page below never moves.
Each digit of the price is a column 0.62 em wide holding a strip from 0 to 9: to show a digit the strip rises 10 per cent for every unit, with a short back.out. Only the column that really changes moves, so while dragging it is mostly the units that roll.
When the value gets within three dollars of the thirty-day low, it is set to that exact price: the handle makes a scale snap with elastic.out and the mark takes the accent colour, as if it held a small magnet.
With the alert set, the pill closes to the width of its new label, measured first on an invisible copy; the bell swings with rotation keyframes that die down around the hook at the top, and the check draws itself with strokeDashoffset.
A timeline with repeatRefresh reads every time where the pill, the handle and the buttons are; it drags a fake value that passes the mark and goes down to the chosen price, and calls the same functions as real gestures. At the first real touch it stops, and it starts again after eight quiet seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
PRICE | script.js | 249 | The product’s price today, in dollars. |
LOW | script.js | 219 | The lowest price of the last thirty days: the mark on the slider. |
TARGET | script.js | 199 | The price the autopilot sets the alert at. |
ACCENT | script.js | #128a5c | The colour of the drop band, the check and the alert’s border. |
ROLL | script.js | 0.42 | The seconds a digit of the price takes to roll to the new one. |
PAUSE | script.js | 1.2 | The seconds the autopilot waits between one gesture and the next. |
For the product page of an online shop, a price comparison app, a wish list, flight or concert tickets that change price: anywhere people want to wait for the right moment to buy.
The card takes 92 per cent of the width up to 352 pixels and the open card stays 172 pixels tall, so everything fits in the box; the handle is 22 pixels wide but the whole 40-pixel slider band catches the finger. A tap does what a click does.
No springs and no rolling: the card opens and closes with a fade, the digits change in place, the handle does not snap, the bell does not swing, the check appears without drawing and the drawn pointer stays hidden.
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 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.