
The elastic button
Buttons, Hover, Text
The Save button of an inspiration board, on white, in the style of real product interface pieces: a red pill on the photo of a vase. Pressed, the list of collections opens; pick one and a copy of the photo shrinks and flies on an arc into its thumbnail, the count rolls by one, the list folds back into the pill and the pill turns black, Saved, with a check that draws 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>
<!--
"Flying photo Save 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 Save button that drops the photo into a collection</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">
<!-- one gesture: save. The red Save pill on a moodboard pin opens a small list of collections; picking one sends a
copy of the photo flying on an arc into that collection's thumbnail, the count rolls by one, the list folds back
into the pill and the pill turns black, Saved, with a check that draws itself -->
<article class="card" data-card>
<div class="photo" data-photo>
<img class="art" data-art src="vaso.webp" width="760" height="640" alt="A ribbed blush clay vase with dried pampas grass on a pale table" decoding="async">
<span class="grain" aria-hidden="true"></span>
<button class="save" type="button" data-save aria-haspopup="true" aria-expanded="false">
<span class="save__bg" data-save-bg aria-hidden="true"></span>
<span class="save__ico" aria-hidden="true">
<svg viewBox="0 0 24 24">
<path class="pin" data-pin d="M7 3.8h10a1 1 0 0 1 1 1v15.4l-6-3.9-6 3.9V4.8a1 1 0 0 1 1-1Z"></path>
<path class="tick" data-tick d="M6.2 12.4l3.9 3.8 7.7-8.2"></path>
</svg>
</span>
<span class="labels" data-labels>
<span class="lab" data-lab="save">Save</span>
<span class="lab" data-lab="saved">Saved</span>
</span>
</button>
<span class="where" data-where aria-hidden="true">
<span class="where__thumb" data-where-thumb></span>
<span class="where__name">Studio shelf</span>
</span>
</div>
<div class="meta">
<div>
<h1 class="meta__title">Ribbed clay vase</h1>
<p class="meta__by">Ossory Ceramics</p>
</div>
<p class="meta__saves"><span class="roll" data-saves>318</span> saves</p>
</div>
<div class="panel" data-panel role="menu" aria-label="Save to a collection">
<p class="panel__head">Save to</p>
<button class="row" type="button" role="menuitem" data-row="0">
<span class="thumb thumb--a" data-thumb><i></i><i></i><i></i><i></i></span>
<span class="row__name">Living room</span>
<span class="row__n"><span class="roll" data-count>12</span></span>
</button>
<button class="row" type="button" role="menuitem" data-row="1">
<span class="thumb thumb--b" data-thumb><i></i><i></i><i></i><i></i></span>
<span class="row__name">Studio shelf</span>
<span class="row__n"><span class="roll" data-count>23</span></span>
</button>
<button class="row" type="button" role="menuitem" data-row="2">
<span class="thumb thumb--c" data-thumb><i></i><i></i><i></i><i></i></span>
<span class="row__name">Gifts</span>
<span class="row__n"><span class="roll" data-count>8</span></span>
</button>
</div>
</article>
<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.
23 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 “Flying photo Save button” from Animorio and fit it into my siteThe list is always in the card, hidden, with its transform origin under the pill: it opens from scale 0.6 and a little blur with back.out, and the rows come in one after another. Meanwhile the pill dips for a moment in scaleY, as if the list had come out of it.
When a collection is picked the photo’s image is cloned into an element above the page, as big as the photo. A clip-path narrows it into a square with round corners, and GSAP keyframes take it from the photo to the thumbnail with a middle point raised by ARC pixels, a small rotation and the scale going down to the thumbnail’s.
When the copy arrives, the first of the four tiles takes the same photo as its background, centred on the vase, the thumbnail swells and comes back with an elastic and the tiles settle one after another. Removing the save brings the tile back to its colour.
Every number sits in a box with a soft mask above and below: the old value leaves at the top, the new one comes in from below with back.out; removing the save they go the other way. The box keeps the width of the wider number until the roll is over.
The two labels sit on top of each other: the outgoing one rises and narrows on the wdth axis, the incoming one arrives narrow and widens, and the pill width follows the measured one. The bookmark fades out and the check draws itself with its dash.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #e5484d | The colour of the Save pill before saving. |
FLIGHT | script.js | 0.75 | The seconds of the photo’s flight into the collection. |
ARC | script.js | 70 | How high the photo rises on its arc, in pixels. |
SPRING | script.js | 1.7 | How much the pill, the list and the labels bounce when they settle. |
PAUSE | script.js | 1.8 | The seconds the autopilot shows each state. |
For an inspiration board, a shop with a wishlist split into collections, a recipe or interiors site, a photo archive: wherever saving something to a specific place should feel like a real gesture.
The card is at most 88% of the screen wide and the photo at most 56% of the height tall; the list rows shrink with 9.4% of the height, so the open list stays inside the card and everything fits in the box. A tap does what a click does.
No flight, bounces or rolls: the list fades in and out, the numbers change in place, the thumbnail takes the photo without swelling, the check is already there 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.7 KB; the libraries: GSAP 28 KB.
Tested on 5 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.