Skip to content
animorio
IT
Back to the library

Similar photos stack

Images, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.9 KBGSAP 28 KBFreeDownload the zip

The similar photos check of a photo app: five shots of the same sunset over a pier sit in a pile; pressing Review sends each one flying to its place in a row, the best one opens up large and each photo shows its flaw underneath (blurry, tilted, too dark, washed out). Passing over a photo shows it large; Keep best sends the other four into the bin, which lifts its lid and counts, and the freed space is written at the bottom.

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>
<!--
  "Similar photos stack" 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 similar photos that gather around the best shot</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>
  <!-- the five shots of the same scene: one real photo, each copy gets its own flaw in CSS -->

  <main class="palco">
    <section class="app" data-app aria-label="Similar shots in a photo library">
      <header class="testa">
        <span class="testa__icona" aria-hidden="true">
          <svg viewBox="0 0 24 24"><rect x="6.5" y="3.5" width="13" height="13" rx="3"/><path d="M4.5 7.5v9a3 3 0 0 0 3 3h9"/></svg>
        </span>
        <span class="testa__testi">
          <strong>Similar shots</strong>
          <span>5 photos · Pier at dusk, 18:42</span>
        </span>
        <span class="cestino" data-cestino aria-label="Recently deleted">
          <svg viewBox="0 0 24 24" aria-hidden="true">
            <g class="cestino__coperchio" data-coperchio><path d="M4.5 6.5h15"/><path d="M9.5 6.5V5a1.5 1.5 0 0 1 1.5-1.5h2A1.5 1.5 0 0 1 14.5 5v1.5"/></g>
            <path d="M6.5 6.5l.9 12a2 2 0 0 0 2 1.9h5.2a2 2 0 0 0 2-1.9l.9-12"/>
            <path d="M10.2 10.5v6M13.8 10.5v6"/>
          </svg>
          <span class="cestino__numero" data-numero>0</span>
        </span>
      </header>

      <div class="zona" data-zona>
        <figure class="grande" data-grande>
          <div class="grande__strato" data-strato="a"><img class="scatto" src="pontile.webp" width="960" height="720" alt="A wooden boardwalk running down to the sea at sunset" decoding="async"></div>
          <div class="grande__strato" data-strato="b"><img class="scatto" src="pontile.webp" width="960" height="720" alt="A wooden boardwalk running down to the sea at sunset" decoding="async"></div>
          <div class="grande__luce" data-luce aria-hidden="true"></div>
          <figcaption class="etichetta" data-etichetta>
            <svg class="etichetta__segno" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6.2"/><path d="M5.2 8.2l1.9 1.9 3.8-4"/></svg>
            <span class="scritta" data-etichetta-testo>Best shot</span>
          </figcaption>
        </figure>

        <div class="fila" data-fila>
          <div class="posto" data-posto><span class="posto__nome">Blurry</span></div>
          <div class="posto" data-posto><span class="posto__nome">Tilted</span></div>
          <div class="posto" data-posto><span class="posto__nome posto__nome--meglio">Best</span></div>
          <div class="posto" data-posto><span class="posto__nome">Too dark</span></div>
          <div class="posto" data-posto><span class="posto__nome">Washed out</span></div>
        </div>

        <!-- the five prints that fly from the pile to their places -->
        <button class="carta" data-carta data-difetto="mosso" aria-label="Blurry shot"><img class="scatto" src="pontile.webp" width="960" height="720" alt="" decoding="async"></button>
        <button class="carta" data-carta data-difetto="storto" aria-label="Tilted shot"><img class="scatto" src="pontile.webp" width="960" height="720" alt="" decoding="async"></button>
        <button class="carta" data-carta data-difetto="buono" aria-label="Best shot"><img class="scatto" src="pontile.webp" width="960" height="720" alt="" decoding="async"></button>
        <button class="carta" data-carta data-difetto="scuro" aria-label="Too dark shot"><img class="scatto" src="pontile.webp" width="960" height="720" alt="" decoding="async"></button>
        <button class="carta" data-carta data-difetto="chiaro" aria-label="Washed out shot"><img class="scatto" src="pontile.webp" width="960" height="720" alt="" decoding="async"></button>
      </div>

      <button class="azione" data-azione type="button"><span class="scritta" data-azione-testo>Review 5 shots</span></button>

      <footer class="piede">
        <span class="scritta" data-stato>4 to delete · 18.6 MB</span>
        <span class="spazio" aria-hidden="true"><span class="spazio__pieno" data-spazio></span></span>
      </footer>
    </section>

    <svg class="puntatore" data-puntatore viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2v15.4l4.1-3.9 2.7 6 2.6-1.2-2.7-5.9h5.6z"/></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 “Similar photos stack” 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 a warm white background sits the card of a photo app, «Similar shots, 5 photos, Pier at dusk», with the bin at the top right. Five shots of the same sunset over a pier, from a real photo, sit in a crooked pile, the best one on top, barely breathing. Review sends them flying one after another to their places in the row, with a spring that overshoots; meanwhile the best one opens up large with the «Best shot» label and under each thumbnail its flaw appears: blurry, tilted, too dark, washed out. Passing over a thumbnail shows it large and the label changes (the old one leaves first, then the new one comes in). «Keep best, delete 4» lifts the bin’s lid, the four photos rise a little and drop into it shrinking, the number on the bin counts up to 4, the lid closes with a bounce and at the bottom you read «Freed 18.6 MB», with the storage bar getting shorter. A drawn pointer does the round by itself.

How it works

One scene, five shots

The sunset is a single real photo, the same img in every frame; each shot has its flaw in CSS on the photo inside the frame: blur, rotation, brightness and contrast. The browser downloads it once, so five photos cost as much as one.

Photos that fly to size

The five photos are absolute buttons in the same area as the row: GSAP animates x, y, width and height to the rectangle of their place, measured with getBoundingClientRect, so the photo changes proportion without stretching (the photo uses object-fit: cover).

The large one on two layers

The large preview has two layers: the new photo comes in over the old one with a fade and a slight zoom, while the label changes text by leaving first and coming back after.

The bin

The lid is an SVG group turning around its hinge with svgOrigin; the photos fly into it with power3.in and, on each arrival, the number bounces and the bin jolts by a pixel and a half.

Values to change

NameFileDefaultWhat it changes
VOLOscript.js0.85The seconds of each photo’s flight from the pile to its place.
SPARGIscript.js0.07The delay between one photo and the next.
MOLLAscript.js1.6How far each photo overshoots before it stops.
PILAscript.js7How crooked the photos in the pile are, in degrees.
MOSSOscript.js2.4How blurred the blurry shot is, in pixels.
SOSTAscript.js1.1The seconds on each photo in the drawn pointer’s round.

Try them in the Playground

When to use it

For a photo or storage app that helps tidy up (duplicate shots, bursts, screenshots), for a cloud service showing the space freed, or for the page presenting a «smart clean up» feature of an app.

On phones

The card takes the width of the box and the large preview is also sized on height (at most 40% of the screen); a tap on a thumbnail shows it large, the buttons are the same.

With reduced motion

The photos go from the pile to the row already in place, the preview and the labels fade in, the bin does not open and the deleted photos disappear; the drawn pointer is hidden.

Pitfalls

  • The photos must live in the same area as the row and the preview: the places are measured against that area, and on resize they are put back to size.
  • The flaw goes on the photo inside the frame, not on the frame: if the tilted shot’s rotation were on the button, GSAP would wipe it while animating its rotation.
  • Two labels in the same spot never cross-fade: the old one leaves, then the new one comes in.
  • With a real photo the crop matters: object-position keeps the sun and the boardwalk inside even in the square thumbnails, and the tilted shot is scaled up (1.2) so the rotation does not uncover the corners.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 6.9 KB; the libraries: GSAP 28 KB.

Testing

Tested on 8 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 animations