
The elastic button
Buttons, Hover, Text
The unsaved changes bar of a settings page, in the style of real product interface pieces: as soon as you change a field a dark bar rises from the bottom on a spring, with Discard and Save changes, and the count of changes rolls. If you try to leave, the bar shakes and asks you to choose first; Save works for a moment, the bar turns green with «Saved» and a check and slides away; Discard puts every value back with a small flash.
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>
<!--
"Unsaved changes bar" 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 unsaved changes bar that rises from the bottom</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 settings page of a small app: change a field and a dark bar rises from the bottom with Discard and
Save changes; the count of changes rolls, trying to leave makes the bar shake, Save turns it green and it
slides away, Discard puts every field back with a small flash -->
<section class="screen" data-screen aria-label="Profile settings">
<header class="top">
<a class="back" href="#" data-back aria-label="Back to workspace">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M14.5 6 8.5 12l6 6"/></svg>
<span>Workspace</span>
</a>
<span class="brand"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 5h6v6H5zM13 13h6v6h-6zM13 5l6 6M5 19l6-6"/></svg><span data-app>Ketterly</span></span>
</header>
<div class="head">
<h1 class="h1">Profile</h1>
<p class="lead">How your name and time show up to the team.</p>
</div>
<form class="form" data-form autocomplete="off" onsubmit="return false">
<label class="field" data-field="name">
<span class="field__label">Display name</span>
<span class="field__box"><input class="field__input" type="text" value="Mira Holt" data-input="name" spellcheck="false"></span>
</label>
<label class="field" data-field="email">
<span class="field__label">Email</span>
<span class="field__box"><input class="field__input" type="email" value="mira@ketterly.app" data-input="email" spellcheck="false"></span>
</label>
<div class="field" data-field="zone">
<span class="field__label">Time zone</span>
<button class="field__box select" type="button" data-select aria-haspopup="listbox" aria-expanded="false">
<span class="select__val"><span class="swap" data-zone><span>GMT+1 · Berlin</span></span></span>
<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="m7 10 5 5 5-5"/></svg>
</button>
<ul class="menu" role="listbox" data-menu>
<li role="option" data-opt="GMT+0 · London">GMT+0 · London</li>
<li role="option" data-opt="GMT+1 · Berlin">GMT+1 · Berlin</li>
<li role="option" data-opt="GMT−5 · New York">GMT−5 · New York</li>
</ul>
</div>
<div class="field field--row" data-field="digest">
<span class="field__txt"><span class="field__label">Weekly digest</span><span class="field__hint">A short email every Monday</span></span>
<button class="toggle" type="button" role="switch" aria-checked="true" data-toggle><span class="toggle__knob"></span></button>
</div>
</form>
<div class="bar" role="status" aria-live="polite" data-bar>
<span class="bar__txt">
<span class="bar__title"><span class="swap" data-title><span>Unsaved changes</span></span></span>
<span class="bar__sub"><span class="swap" data-sub><span><span class="num" data-num><span>1</span></span> <span data-word>change</span></span></span></span>
</span>
<span class="bar__actions" data-actions>
<button class="discard" type="button" data-discard>Discard</button>
<button class="save" type="button" data-save>
<svg class="spin" viewBox="0 0 24 24" aria-hidden="true" data-spin><circle cx="12" cy="12" r="8"/></svg>
<span class="save__label"><span class="swap" data-save-label><span>Save changes</span></span></span>
</button>
</span>
<svg class="done" viewBox="0 0 24 24" aria-hidden="true" data-done><path d="M6 12.5l4 4 8-9"/></svg>
</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.
34 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 “Unsaved changes bar” from Animorio and fit it into my siteThe script keeps two copies of the values, the saved ones and the form’s, and compares them on every input: the number of different items is the bar’s count, and every different field gets the is-edited class, which gives it an accent edge with a faint halo, never a dot.
The bar is absolute at the bottom of the window: it starts at yPercent 170 and rises to 0 with back.out(1.6) while widening from 0.9 to 1; the two buttons arrive a moment later from six pixels lower, one after the other. With no changes it goes down with back.in.
Every changing text sits inside a mask: the old one rises and fades in 0.22 seconds, the new one comes from below 0.16 seconds later with back.out, so two texts are never readable together. If only the number changes, only the digit rolls.
With changes open, the back link does not leave: the bar runs x keyframes (-8, 7, -5, 3, -1, 0), Save swells to 1.08 and back, and for a second and a half the title says «Save or discard?».
Save spins a spinner for a moment, then the form values become the saved ones, the bar turns green in a single colour tween, the check draws itself with strokeDashoffset and the bar slides down. Discard puts the values back, lights an accent veil on the field that fades in half a second and sends the bar down.
| Name | File | Default | What it changes |
|---|---|---|---|
APP | script.js | Ketterly | The name of the invented app, written at the top right. |
ACCENT | script.js | #5b5bf0 | The colour of the edited fields and of the Discard flash. |
SAVED | script.js | #1f9d55 | The colour of the bar when it says Saved. |
RISE | script.js | 0.65 | The seconds the bar takes to rise from the bottom on its spring. |
SAVE_TIME | script.js | 0.9 | The seconds Save stays on «Saving» before saying Saved. |
HOLD | script.js | 1.3 | The seconds «Saved» stays before sliding away. |
TYPE | script.js | 0.085 | The seconds between letters when the pointer types. |
For an app’s settings or profile page, an admin panel, a product or post editor: anywhere changes are not saved automatically and the reminder has to be gentle, without a blocking dialog.
The window takes the width of the box and a height in vh, fields and gaps tighten with the height, the bar stays as wide as the window minus the margins and below 380 pixels the buttons get narrower. A tap does what a click does.
No springs, shakes or rolls: the bar fades in and out, texts change in place, the toggle snaps without a bounce and there is no Discard flash. The drawn pointer stays hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.2 KB; the libraries: GSAP 28 KB.
Tested on 28 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.