
The elastic button
Buttons, Hover, Text
The card a flight app uses to ask for notification permission, on white, in the style of real product interface pieces: at the top two sample alerts drop in one after the other on a spring and stack, below three switches choose which alerts to get. Allow swings the bell, the alerts fly into it and «You’re all set» appears with a 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>
<!--
"Notifications prompt" 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 notifications prompt with a preview sliding down</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>
<!-- the notifications permission card of a flight app: two sample alerts drop in and stack,
three small switches choose which alerts, Allow swings the bell and gathers the alerts into it -->
<section class="ask" data-card aria-label="Kestrow notifications">
<div class="preview" data-preview aria-hidden="true">
<div class="preview__time">9:41</div>
<article class="note" data-note>
<span class="note__icon"><svg viewBox="0 0 24 24"><path d="M3.5 13.2 9 12l3.4-6.3c.4-.8 1.6-.6 1.6.3l-.2 5.2 5.2-1.1c1.1-.2 1.9.9 1.3 1.8l-.5.7-5.8 1.4-.3 5.4c0 .8-1 1.1-1.5.5l-2.3-4.2-4.9 1.2c-.9.2-1.5-.9-.9-1.6Z"/></svg></span>
<div class="note__body">
<p class="note__top"><b>Kestrow</b><span>now</span></p>
<p class="note__title">Gate changed to B12</p>
<p class="note__text">KS 204 to Lisbon now boards at 14:40.</p>
</div>
</article>
<article class="note" data-note>
<span class="note__icon"><svg viewBox="0 0 24 24"><path d="M3.5 13.2 9 12l3.4-6.3c.4-.8 1.6-.6 1.6.3l-.2 5.2 5.2-1.1c1.1-.2 1.9.9 1.3 1.8l-.5.7-5.8 1.4-.3 5.4c0 .8-1 1.1-1.5.5l-2.3-4.2-4.9 1.2c-.9.2-1.5-.9-.9-1.6Z"/></svg></span>
<div class="note__body">
<p class="note__top"><b>Kestrow</b><span>now</span></p>
<p class="note__title">Boarding in 20 minutes</p>
<p class="note__text">Head to gate B12, seat 14A is waiting.</p>
</div>
</article>
</div>
<div class="lower" data-lower>
<div class="form" data-form>
<header class="head">
<span class="bell" data-bell>
<svg viewBox="0 0 24 24" aria-hidden="true"><g data-bell-swing><path d="M6.2 16.2V11a5.8 5.8 0 0 1 11.6 0v5.2l1.4 1.8H4.8Z"/><path class="bell__clap" data-clapper d="M10 20.2a2.1 2.1 0 0 0 4 0"/></g></svg>
</span>
<div>
<h1 class="head__title">Turn on notifications</h1>
<p class="head__sub">Get gate changes and boarding times the moment they happen.</p>
</div>
</header>
<ul class="opts">
<li><span>Gate changes</span><button class="switch is-on" data-switch role="switch" aria-checked="true" aria-label="Gate changes"><i></i></button></li>
<li><span>Boarding times</span><button class="switch is-on" data-switch role="switch" aria-checked="true" aria-label="Boarding times"><i></i></button></li>
<li><span>Price drops</span><button class="switch" data-switch role="switch" aria-checked="false" aria-label="Price drops"><i></i></button></li>
</ul>
<div class="acts">
<button class="btn btn--ghost" data-later>Not now</button>
<button class="btn btn--solid" data-allow><span data-allow-label>Allow</span></button>
</div>
</div>
<div class="done" data-done aria-live="polite">
<svg class="done__check" viewBox="0 0 40 40" aria-hidden="true"><circle cx="20" cy="20" r="17" data-ring></circle><path d="m12.5 20.6 5 5 10-11" data-tick></path></svg>
<p class="done__title" data-done-title>You’re all set</p>
<p class="done__sub" data-done-sub>We’ll only send the 2 alerts you chose.</p>
</div>
</div>
</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.
31 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 “Notifications prompt” from Animorio and fit it into my siteThe sample alerts are absolute and in the same spot: the first drops with yPercent from -130 to 0 and back.out, squashes to 97% of its height and comes back with elastic; when the second arrives, sitting above it in the DOM, the first moves down a few pixels, shrinks to 0.94 and dims, so it reads as a stack.
The switch moves its knob 14 pixels with back.out while widening it by 28% towards where it is going, with the origin on the right side; then it brings it back to 1 with elastic. The track colour changes with a CSS transition.
On Allow the script measures the centre of the bell and of each alert, and sends them there with relative x and y, shrinking them to 6% and turning them a little. At each arrival the bell jolts to 1.14 and comes back with elastic, while the bell group swings from a pivot at the top and the clapper rocks on its own.
The circle and the check are paths with a strokeDasharray as long as themselves: they draw one after the other. The line below counts the switches that are on at that moment, so it says how many alerts will really come.
A timeline with repeatRefresh drops the alerts, takes the drawn pointer to Price drops reading its position every time, turns it on and presses Allow. At the first real touch it stops, and it starts again after eight quiet seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
APP | script.js | Kestrow | The name of the app asking for permission, written on the sample alerts. |
ACCENT | script.js | #2f6bff | The colour of the icon, the switches that are on and the check. |
DROP | script.js | 0.75 | The seconds a sample alert takes to drop and land on its spring. |
STACK_GAP | script.js | 12 | How many pixels the first alert moves down when the other lands on top of it. |
SWING | script.js | 16 | How many degrees the bell swings when Allow is pressed. |
HOLD | script.js | 2.4 | The seconds «You’re all set» stays before the autopilot starts again. |
For an app’s onboarding, the permission ask before the system one, the notification settings of a dashboard, a travel, delivery or booking app that wants to alert at the right moment.
The card takes the full width minus the margins, the lock screen and the switch rows shorten with the window height, measured in vh, so everything fits in the box; the buttons stay at least 36 pixels tall for a finger. A tap does what a click does.
No drops, swings or flights: the alerts appear already stacked with a fade, the switches change without a spring, and Allow fades the alerts out and shows «You’re all set» with the check already drawn. The drawn pointer stays hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.5 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.