Skip to content
animorio
IT
All components

Flying photo Save button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.7 KBGSAP 28 KBFreeDownload the zip

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.

The code

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>

Playground

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

Or ask your AI assistant for it

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 site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On white, the card of an invented inspiration board: the real photo of a ribbed pink ceramic vase with dried pampas plumes, on a pale table next to a cream sheepskin, with a fine print grain, and below the name of the vase, Ossory Ceramics and 318 saves. Top right on the photo sits the red Save pill with its bookmark. Pressed, it squashes and comes back with an elastic, and out of the pill comes the Save to list with three collections (Living room, Studio shelf, Gifts), each with a thumbnail of four tiles and its count. Pick Studio shelf and the row squashes, a copy of the photo comes off, narrows into a square and flies on an arc to the thumbnail, which swells, takes the photo of the vase and has its tiles settle again; the count rolls from 23 to 24. The list folds back into the pill, the bookmark disappears and a check draws itself, the label rolls from Save to Saved widening on the wdth axis and the pill turns black; below, the saves roll to 319 and a small glass label with the collection comes in at the bottom of the photo. Pressed again, everything goes back with the numbers rolling the other way. On hover the photo leans in slightly. A drawn pointer does it all by itself and starts again; it also really works with mouse, touch and keyboard (Esc closes the list).

How it works

The list coming out of the pill

The 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.

The flight of the photo

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.

The thumbnail taking the photo

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.

Rolling numbers

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.

Save turning into Saved

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.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#e5484dThe colour of the Save pill before saving.
FLIGHTscript.js0.75The seconds of the photo’s flight into the collection.
ARCscript.js70How high the photo rises on its arc, in pixels.
SPRINGscript.js1.7How much the pill, the list and the labels bounce when they settle.
PAUSEscript.js1.8The seconds the autopilot shows each state.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • The flying copy goes in the stage and not in the card: inside the card it would be cut by the round corners of the photo as soon as it leaves.
  • The clip-path square sits inside the copy: at the end of the flight the x has to be corrected by half the difference between width and side, times the scale, or the copy lands to the left of the thumbnail.
  • A rolling number changes width (23 and 24 do not, 9 and 10 do): the box keeps the larger width until the roll is over, otherwise the row jumps.
  • The flying copy narrows into a square in the middle of the photo: the real photo is cropped with the vase in the centre, or the thumbnail would get half a vase and half a wall.

Libraries

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.

Testing

Tested on 5 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All components