Skip to content
animorio
IT
Back to the library

Travel postcard stack

Physics, ImagesGSAP, CSS onlyAdvancedCompressed weight: Demo 13 KBGSAP 28 KBFreeDownload the zip

The postcards of Casa Lumen, a made-up holiday house in Amalfi: five real photos (the sea, the lemons, the terrace, the steps, the sunset) printed with a white paper border, in a messy stack on a warm table. The top one is picked up with a finger or the mouse and flicked away: it flies with the speed of the gesture, spins with the push, slows down, bounces softly off the edges and slides back under the stack, while the card below lifts a hair and springs into first place. A tap turns it over: the stamp, the postmark landing and a line written in blue ink.

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>
<!--
  "Travel postcard 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>A stack of travel postcards to flick away</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/caveat@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <!-- the postcards of Casa Lumen, a made-up guest house in Amalfi: five real photos printed as postcards, in a messy
         stack on a warm table. The top one is picked up with a finger or the mouse and flicked away: it flies with the
         speed of the gesture, spins with the push, slows down, bounces softly off the edges and slides back under the
         stack, while the card below lifts a hair and springs into first place. A tap turns it over: the stamp, the
         postmark and a line written in blue ink -->
    <header class="head">
      <p class="brand">
        <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true"><path class="brand__sun" d="M6 15a6 6 0 0 1 12 0z" /><path d="M3 15h18M6.5 18.5h11" /></svg>
        <span class="brand__name">Casa Lumen</span>
        <span class="brand__place">Amalfi</span>
      </p>
      <p class="head__note">Postcards from the house</p>
    </header>

    <svg class="defs" aria-hidden="true" width="0" height="0">
      <defs>
        <path id="arco-alto" d="M8 30a22 22 0 0 1 44 0" />
        <path id="arco-basso" d="M10 31a20 20 0 0 0 40 0" />
      </defs>
    </svg>

    <div class="table" data-table>
      <article class="card" data-card data-name="The sea at nine" aria-label="Postcard: the sea at nine">
        <i class="card__shade" data-shade></i>
        <div class="card__flip" data-flip>
          <div class="card__front">
            <div class="card__photo"><img src="mare.webp" alt="Swimmers in clear turquoise water, seen from above" width="1000" height="506" decoding="async" draggable="false"><i class="card__sheen"></i></div>
            <span class="card__label">Amalfi, the sea</span>
          </div>
          <div class="card__back">
            <p class="back__printed">Post card</p>
            <div class="back__left"><p class="back__note" data-ink><span>Swam before breakfast.</span><span>The water is glass.</span><span class="back__sign">Mila</span></p></div>
            <div class="back__right">
              <span class="stamp" data-stamp><img src="mare.webp" alt="" width="1000" height="506" draggable="false"><b>1,25</b></span>
              <svg class="postmark" data-postmark viewBox="0 0 120 60" aria-hidden="true"><circle cx="30" cy="30" r="26" /><circle cx="30" cy="30" r="21.5" /><text><textPath href="#arco-alto" startOffset="50%">AMALFI</textPath></text><text x="30" y="33.5">09 AUG</text><text><textPath href="#arco-basso" startOffset="50%">2026</textPath></text><path d="M58 18c8-4 16 4 24 0s16-4 24 0 8 2 12 0M58 26c8-4 16 4 24 0s16-4 24 0 8 2 12 0M58 34c8-4 16 4 24 0s16-4 24 0 8 2 12 0M58 42c8-4 16 4 24 0s16-4 24 0 8 2 12 0" /></svg>
              <p class="address"><span>Ada Weller</span><span>14 Linden Row</span><span>Bristol</span></p>
            </div>
          </div>
        </div>
      </article>

      <article class="card" data-card data-name="Lemons by the gate" aria-label="Postcard: lemons by the gate">
        <i class="card__shade" data-shade></i>
        <div class="card__flip" data-flip>
          <div class="card__front">
            <div class="card__photo"><img src="limoni.webp" alt="Ripe lemons on a sunlit tree" width="1000" height="750" decoding="async" draggable="false"><i class="card__sheen"></i></div>
            <span class="card__label">Amalfi, the lemons</span>
          </div>
          <div class="card__back">
            <p class="back__printed">Post card</p>
            <div class="back__left"><p class="back__note" data-ink><span>They pick the lemons at six.</span><span>We had them in everything.</span><span class="back__sign">Mila</span></p></div>
            <div class="back__right">
              <span class="stamp" data-stamp><img src="limoni.webp" alt="" width="1000" height="750" draggable="false"><b>1,25</b></span>
              <svg class="postmark" data-postmark viewBox="0 0 120 60" aria-hidden="true"><circle cx="30" cy="30" r="26" /><circle cx="30" cy="30" r="21.5" /><text><textPath href="#arco-alto" startOffset="50%">AMALFI</textPath></text><text x="30" y="33.5">10 AUG</text><text><textPath href="#arco-basso" startOffset="50%">2026</textPath></text><path d="M58 18c8-4 16 4 24 0s16-4 24 0 8 2 12 0M58 26c8-4 16 4 24 0s16-4 24 0 8 2 12 0M58 34c8-4 16 4 24 0s16-4 24 0 8 2 12 0M58 42c8-4 16 4 24 0s16-4 24 0 8 2 12 0" /></svg>
              <p class="address"><span>Ada Weller</span><span>14 Linden Row</span><span>Bristol</span></p>
            </div>
          </div>
        </div>
      </article>

      <article class="card" data-card data-name="The terrace after lunch" aria-label="Postcard: the terrace after lunch">
        <i class="card__shade" data-shade></i>
        <div class="card__flip" data-flip>
          <div class="card__front">
            <div class="card__photo"><img src="terrazza.webp" alt="Two deck chairs on a white terrace above the sea, bougainvillea on the wall" width="1000" height="667" decoding="async" draggable="false"><i class="card__sheen"></i></div>
            <span class="card__label">Amalfi, the terrace</span>
          </div>
          <div class="card__back">
            <p class="back__printed">Post card</p>
            <div class="back__left"><p class="back__note" data-ink><span>Lunch ran into dinner</span><span>on the terrace again.</span><span class="back__sign">Mila</span></p></div>
            <div class="back__right">
              <span class="stamp" data-stamp><img src="terrazza.webp" alt="" width="1000" height="667" draggable="false"><b>1,25</b></span>
              <svg class="postmark" data-postmark viewBox="0 0 120 60" aria-hidden="true"><circle cx="30" cy="30" r="26" /><circle cx="30" cy="30" r="21.5" /><text><textPath href="#arco-alto" startOffset="50%">AMALFI</textPath></text><text x="30" y="33.5">12 AUG</text><text><textPath href="#arco-basso" startOffset="50%">2026</textPath></text><path d="M58 18c8-4 16 4 24 0s16-4 24 0 8 2 12 0M58 26c8-4 16 4 24 0s16-4 24 0 8 2 12 0M58 34c8-4 16 4 24 0s16-4 24 0 8 2 12 0M58 42c8-4 16 4 24 0s16-4 24 0 8 2 12 0" /></svg>
              <p class="address"><span>Ada Weller</span><span>14 Linden Row</span><span>Bristol</span></p>
            </div>
          </div>
        </div>
      </article>

      <article class="card" data-card data-name="The steps to the beach" aria-label="Postcard: the steps to the beach">
        <i class="card__shade" data-shade></i>
        <div class="card__flip" data-flip>
          <div class="card__front">
            <div class="card__photo"><img src="scalinata.webp" alt="Stone steps going down to the beach between the rocks" width="768" height="512" decoding="async" draggable="false"><i class="card__sheen"></i></div>
            <span class="card__label">Amalfi, the steps</span>
          </div>
          <div class="card__back">
            <p class="back__printed">Post card</p>
            <div class="back__left"><p class="back__note" data-ink><span>Ninety-two steps down</span><span>to the beach. Worth it.</span><span class="back__sign">Mila</span></p></div>
            <div class="back__right">
              <span class="stamp" data-stamp><img src="scalinata.webp" alt="" width="768" height="512" draggable="false"><b>1,25</b></span>
              <svg class="postmark" data-postmark viewBox="0 0 120 60" aria-hidden="true"><circle cx="30" cy="30" r="26" /><circle cx="30" cy="30" r="21.5" /><text><textPath href="#arco-alto" startOffset="50%">AMALFI</textPath></text><text x="30" y="33.5">14 AUG</text><text><textPath href="#arco-basso" startOffset="50%">2026</textPath></text><path d="M58 18c8-4 16 4 24 0s16-4 24 0 8 2 12 0M58 26c8-4 16 4 24 0s16-4 24 0 8 2 12 0M58 34c8-4 16 4 24 0s16-4 24 0 8 2 12 0M58 42c8-4 16 4 24 0s16-4 24 0 8 2 12 0" /></svg>
              <p class="address"><span>Ada Weller</span><span>14 Linden Row</span><span>Bristol</span></p>
            </div>
          </div>
        </div>
      </article>

      <article class="card" data-card data-name="Sunset from room four" aria-label="Postcard: sunset from room four">
        <i class="card__shade" data-shade></i>
        <div class="card__flip" data-flip>
          <div class="card__front">
            <div class="card__photo"><img src="tramonto.webp" alt="The sun setting behind the hills over the bay, a boat on the water" width="960" height="640" decoding="async" draggable="false"><i class="card__sheen"></i></div>
            <span class="card__label">Amalfi, at dusk</span>
          </div>
          <div class="card__back">
            <p class="back__printed">Post card</p>
            <div class="back__left"><p class="back__note" data-ink><span>Room four, the last light.</span><span>Wish you were here.</span><span class="back__sign">Mila</span></p></div>
            <div class="back__right">
              <span class="stamp" data-stamp><img src="tramonto.webp" alt="" width="960" height="640" draggable="false"><b>1,25</b></span>
              <svg class="postmark" data-postmark viewBox="0 0 120 60" aria-hidden="true"><circle cx="30" cy="30" r="26" /><circle cx="30" cy="30" r="21.5" /><text><textPath href="#arco-alto" startOffset="50%">AMALFI</textPath></text><text x="30" y="33.5">16 AUG</text><text><textPath href="#arco-basso" startOffset="50%">2026</textPath></text><path d="M58 18c8-4 16 4 24 0s16-4 24 0 8 2 12 0M58 26c8-4 16 4 24 0s16-4 24 0 8 2 12 0M58 34c8-4 16 4 24 0s16-4 24 0 8 2 12 0M58 42c8-4 16 4 24 0s16-4 24 0 8 2 12 0" /></svg>
              <p class="address"><span>Ada Weller</span><span>14 Linden Row</span><span>Bristol</span></p>
            </div>
          </div>
        </div>
      </article>
    </div>

    <footer class="foot">
      <p class="caption" data-caption aria-hidden="true"></p>
      <p class="hint">
        <span>Flick to send</span>
        <i class="hint__rule" aria-hidden="true"></i>
        <span>Tap to turn over</span>
      </p>
    </footer>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true">
      <path d="M5 3.2 18.6 13l-6.1 1 3.4 6.4-2.6 1.4-3.4-6.5L5 19.2z" />
    </svg>
    <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>

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.

83 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 “Travel postcard 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 cream table, with a soft light from above and a fine grain, lies a messy stack of five postcards of Casa Lumen, a made-up holiday house in Amalfi. Every postcard is a real photo printed with a white paper border, grain and slightly rounded corners, with the name of the place in small type on the photo: swimmers in turquoise water seen from above, ripe lemons in the sun, the white terrace with two deck chairs and bougainvillea over the sea, the stone steps going down to the beach, the sunset behind the hills with a boat. Under the stack is the name of the top card. Pick up the top one with a finger or the mouse: it lifts, its shadow grows and softens, it leans in 3D with the speed of the hand and turns around the point where it is held, and the one below lifts a hair. Flicked, it flies with the speed of the gesture, spins with the push, slows down with friction, bounces softly off the edges and slides back under the stack turning to its place; meanwhile the new top card straightens on a spring and the name under the stack changes. Let go gently, it goes back to its place. A tap turns the postcard over: on the back the words Post card, a perforated stamp with its photo, the round Amalfi postmark with the date landing with a small bounce, the address in handwriting and a line the pen writes in blue from left to right, with the signature. Left alone, a drawn pointer picks up and flicks the postcards in every direction and turns one over.

How it works

Two layers for every postcard

Every postcard is a .card moved by the script (position, rotation, rotateX and rotateY lean, scale) with a .card__flip inside that turns over with rotateY: the two faces have backface-visibility hidden. The table has perspective: 1400px, so the lean and the turn are real CSS 3D, with no libraries. The shadow is a third, empty element, .card__shade: it does not turn with the card and narrows with the cosine of the turn.

Springs and the flick

A single loop on GSAP's ticker updates every postcard with hand-made springs (STIFFNESS and DAMPING) in two half steps per frame. While held, the card follows the hand on a stiff spring and turns around the point where it was grabbed: the rotation comes from the hand's speed crossed with that point. On release the speed of the last 100 ms decides: above 600 pixels per second, or pulled past 42% of its width, it flies.

The flight, the friction, the edges

In flight the speed loses a factor exp(-FRICTION·t) every moment and the rotation a little more; at the edges of the table it bounces with BOUNCE and picks up some extra spin from its sideways speed. Once slow it goes under the stack (lowest z-index) and back to its place on a softer spring, without unwinding the turns it made in the air.

Real photos and paper

The photos are img tags with object-fit cover inside a paper border: swap them in the HTML without touching the script. A 160-pixel grain painted once on a canvas lies on the table, the paper and the print; a soft gloss moves with the lean. The postmark lands with back.out and the pen line is written by opening a clip-path from the left with the --pen variable.

Values to change

NameFileDefaultWhat it changes
THROWscript.js1How strongly a flick sends the card across the table.
FRICTIONscript.js2.6How quickly a flung card slows down on the table.
BOUNCEscript.js0.42How much it bounces off the edges (0 = it stops dead).
SPINscript.js1How much the card turns with the push.
TILTscript.js1How much it leans in 3D while held.
STIFFNESSscript.js240The spring of the stack: higher settles quicker.
DAMPINGscript.js20Lower lets the cards pass their place and come back.
GRAINscript.js0.07How much grain lies on the table, the paper and the photos.
SPEEDscript.js12 = the walk on its own twice as fast, 0.5 = half.
LOOPscript.jstrueThe drawn pointer goes through the stack again and again.

Try them in the Playground

When to use it

For the page of a hotel, a holiday home, a bed and breakfast or a travel agency: the photos of the place to leaf through with a finger like real postcards, with a message on the back. It also suits a travel photography portfolio or guest reviews written on the back. Swap the photos in the five img tags of the HTML (the webp files in the folder), the words on the back next to them, the colours in :root.

On phones

The same thing with a finger: the postcard is at most 84% of the screen wide and 66% of its height, so it fits the box even when it is short; dragging does not scroll the page (touch-action: none on the table) and the edges it bounces off are measured again at every resize.

With reduced motion

No movement: the postcards stay still in the stack; the flick is a fade (the top one fades out and back in at the bottom) and turning over is a fade too.

Pitfalls

  • The shadow cannot live on the faces: turning over, the back face would show it reversed and its direction would turn with the card. It sits in a separate empty element, with its direction corrected for the rotation (sine and cosine) so it always falls downwards.
  • A postcard that spun twice in the air must not unwind on its way back: its target moves by the nearest multiple of 360 degrees, removed on arrival.
  • If the hand stops before letting go, the last speeds are stale: after 80 ms without movement the flick is zero and the card goes back to its place.
  • The images have draggable false and the table user-select none: otherwise the browser drags the photo instead of the postcard.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Caveat (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 13 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 animations