
The elastic button
Buttons, Hover, Text
A notes app’s notice when the connection drops and comes back, on white, in the style of real product interface pieces: a dark pill comes down from the top with a crossed-out cloud and «You’re offline», every word you write flies as a small mark into the counter of pending changes, and when the network returns the bar over the cloud melts, the changes fly up into the cloud one by one, the counter falls to zero and the pill turns into «Synced» with a check and goes back up.
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>
<!--
"Offline notes notice" 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 offline notes notice with the changes that fly into the cloud</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 offline notice of a notes app: while you write, the connection drops and a dark pill comes down from the
top with a crossed-out cloud; every word you write offline is a change kept on the device and the counter
climbs. When the network returns the bar over the cloud melts, the changes fly up into it one by one, the
counter falls to zero and the pill turns into «Synced» with a check, then goes back up with a small settle -->
<div class="deck" data-deck>
<div class="slot">
<button class="pill" type="button" data-pill aria-label="Offline notice: press to try to reconnect">
<span class="pill__sheen" aria-hidden="true"><span class="pill__sweep" data-sweep></span></span>
<span class="cloud" data-cloud aria-hidden="true">
<svg viewBox="0 0 24 24">
<path class="cloud__shape" data-shape d="M7.4 18.6h9.4a4.1 4.1 0 0 0 .55-8.16 5.6 5.6 0 0 0-10.7 1.18A3.5 3.5 0 0 0 7.4 18.6z"/>
<g class="cloud__cut" data-cut>
<line x1="4.4" y1="4.4" x2="19.6" y2="19.6"/>
</g>
<g class="cloud__bar" data-bar>
<line x1="4.4" y1="4.4" x2="7.44" y2="7.44"/>
<line x1="7.44" y1="7.44" x2="10.48" y2="10.48"/>
<line x1="10.48" y1="10.48" x2="13.52" y2="13.52"/>
<line x1="13.52" y1="13.52" x2="16.56" y2="16.56"/>
<line x1="16.56" y1="16.56" x2="19.6" y2="19.6"/>
</g>
<path class="cloud__up" data-up d="M12 16v-5.2M9.9 12.8 12 10.7l2.1 2.1"/>
<path class="cloud__tick" data-tick d="M9.2 13.9l2 2 3.9-4.2"/>
</svg>
</span>
<span class="pill__words" data-words>
<span class="pill__title" data-title><span>You’re offline</span></span>
<span class="pill__sub" data-sub><span>Changes saved on this device</span></span>
</span>
<span class="badge" data-badge>
<span class="badge__in">
<span class="badge__num" data-num><span>0</span></span>
<span class="badge__label">pending</span>
</span>
</span>
</button>
</div>
<article class="note" data-note aria-label="Note">
<header class="note__head">
<span class="note__name">Sunday market</span>
<span class="note__when" data-when>Edited just now</span>
</header>
<p class="note__body"><span data-text></span><span class="note__caret" data-caret aria-hidden="true"></span></p>
<span class="note__rule" aria-hidden="true"></span>
<footer class="note__foot">
<span>Marginal</span>
<span data-words-count>0 words</span>
</footer>
</article>
</div>
<div class="flight" data-flight aria-hidden="true"></div>
<p class="sr" aria-live="polite" data-live></p>
</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 “Offline notes notice” from Animorio and fit it into my siteThe pill sits in a fixed slot over the note, so the note never jumps. It starts at yPercent -160 and comes down to 0 with back.out(1.5); halfway a scaleY of 0.965 for nine hundredths and an elastic make it settle as if it touched.
The direction is a timeline of calls, one per letter, with a slightly uneven rhythm and a pause on commas. When a letter ends a word a mark is born in the .flight layer: it follows a quadratic Bézier curve from the caret to the counter, recomputed every frame on the target’s real position, rotated along the tangent.
The new digit comes from below, absolutely positioned, while the old one rises and fades, then goes back to normal; the box gives an elastic hop of 1.1 going up and 0.94 going down. At zero its measured width goes to zero and the pill narrows with it.
The cloud’s bar is five pieces of line, over a wide cut in the pill’s colour that separates it from the cloud. When the network returns the pieces drop a few pixels, stretch in scaleY and narrow in scaleX while they fade, staggered from the middle: they look like they drip.
Title and line below roll like the digit; the words column tweens to the width of the new lines, measured while they are still absolutely positioned, so the pill changes size without a jolt.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #3f7cff | The colour of the cloud coming back, the marks going up and the check. |
TYPE_SPEED | script.js | 15 | The letters per second written in the note. |
OFFLINE_FOR | script.js | 1.3 | The seconds offline after the last word, before the network returns. |
FLY | script.js | 0.6 | The flight time of each change, in seconds. |
GAP | script.js | 0.2 | The seconds between one change and the next as they go up into the cloud. |
HOLD | script.js | 1.6 | The seconds «Synced» stays before going back up. |
LOOP | script.js | true | Start the loop again from the top. |
For a notes or writing app, a document editor or any app that saves on the device and syncs later: it says gently that the network dropped, that nothing is lost, and shows the changes leaving when it returns.
Pill and note take the width of the box, heights are in vh with clamp and the words column can shrink; the marks fly in the layer over the page and the page never scrolls sideways. A tap on the pill does what a click does.
No springs, flights or rolls: the pill fades in and out, the counter and the words change in place, the bar fades, the arrow and the check appear without drawing themselves.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.1 KB; the libraries: GSAP 28 KB.
Tested on 11 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.