Skip to content
animorio
IT
Back to the library

Travel journal gallery

Images, Transitions, HoverGSAPMediumCompressed weight: Demo 9.5 KBGSAP + Flip 37 KBFreeDownload the zip

The gallery of Saltway, a made-up travel journal: six real photos of places (the sea at dusk, golden hills, a hillside town, the dunes, Big Sur, a city bay) in a tidy grid on warm white paper. Click a photo and it grows in the middle while the others move with Flip into a thin row of thumbnails under it, like a frame; the caption (place, month, one line) rises line by line. The arrows slide the big photo and the lit thumbnail follows on a spring; Esc or “Grid” go back to the grid with the opposite gesture.

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 journal gallery" 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>Travel journal gallery that frames the chosen photo</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 gallery of Saltway, a made-up travel journal: six real photos in a tidy grid on warm white paper.
       Pick one and the others move (GSAP Flip) into a thin row of thumbnails under it, while the chosen one grows
       in the middle and its caption rises line by line. The arrows slide to the next photo and the lit thumbnail
       follows on a spring; Esc or "Grid" put everything back with the opposite gesture. -->
  <main class="palco" data-palco>
    <header class="testa">
      <p class="marchio">
        <svg class="marchio__segno" viewBox="0 0 24 24" aria-hidden="true"><path d="M3.5 17.5c3-4.6 6-6.9 8.5-6.9s5.5 2.3 8.5 6.9" /><path d="M8 17.5c1.4-2 2.7-3 4-3s2.6 1 4 3" /></svg>
        Saltway
      </p>
      <p class="testa__nota" data-nota>Field notes, autumn edition</p>
      <button class="tasto tasto--griglia" type="button" data-torna aria-label="Back to the grid" tabindex="-1">
        <span class="tasto__fondo"></span>
        <svg viewBox="0 0 16 16" aria-hidden="true"><rect x="2" y="2" width="5" height="5" rx="1.2" /><rect x="9" y="2" width="5" height="5" rx="1.2" /><rect x="2" y="9" width="5" height="5" rx="1.2" /><rect x="9" y="9" width="5" height="5" rx="1.2" /></svg>
        <span class="tasto__testo">Grid</span>
      </button>
    </header>

    <div class="scena" data-scena>
      <!-- the grid: every cell keeps a socket for its photo and the name under it -->
      <section class="griglia" data-griglia aria-label="Journal photos">
        <div class="cella"><div class="presa" data-presa-g></div><p class="cella__nome" data-nome-g><span>Harbour wall</span><em>Jun</em></p></div>
        <div class="cella"><div class="presa" data-presa-g></div><p class="cella__nome" data-nome-g><span>Beskid hills</span><em>Sep</em></p></div>
        <div class="cella"><div class="presa" data-presa-g></div><p class="cella__nome" data-nome-g><span>Hillside town</span><em>Oct</em></p></div>
        <div class="cella"><div class="presa" data-presa-g></div><p class="cella__nome" data-nome-g><span>The dunes</span><em>Mar</em></p></div>
        <div class="cella"><div class="presa" data-presa-g></div><p class="cella__nome" data-nome-g><span>Big Sur</span><em>May</em></p></div>
        <div class="cella"><div class="presa" data-presa-g></div><p class="cella__nome" data-nome-g><span>Marina Bay</span><em>Aug</em></p></div>
      </section>

      <!-- the open view: the chosen photo in the middle, its caption and arrows, the row of thumbnails -->
      <section class="aperta" data-aperta aria-hidden="true">
        <div class="vista-posto" data-vista-posto>
          <div class="vista" data-vista>
            <div class="binario" data-binario>
              <figure class="lastra"><img src="molo.webp" alt="" width="960" height="720"></figure>
              <figure class="lastra"><img src="colline.webp" alt="" width="1024" height="681"></figure>
              <figure class="lastra"><img src="paese.webp" alt="" width="1024" height="683"></figure>
              <figure class="lastra"><img src="dune.webp" alt="" width="960" height="643"></figure>
              <figure class="lastra"><img src="costa.webp" alt="" width="1024" height="683"></figure>
              <figure class="lastra"><img src="baia.webp" alt="" width="960" height="641"></figure>
            </div>
            <i class="vista__grana" aria-hidden="true"></i>
            <i class="vista__bordo" aria-hidden="true"></i>
          </div>
        </div>

        <div class="sotto">
          <div class="didascalia" data-didascalia aria-live="polite">
            <p class="riga riga--luogo"><span data-luogo>Harbour wall</span></p>
            <p class="riga riga--mese"><span data-mese>June, on the coast</span></p>
            <p class="riga riga--frase"><span data-frase>The sea went copper long before the town lit up.</span></p>
          </div>
          <div class="frecce">
            <button class="tasto tasto--freccia" type="button" data-prima aria-label="Previous photo" tabindex="-1">
              <span class="tasto__fondo"></span>
              <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M13 8H3.5M7.5 3.5 3 8l4.5 4.5" /></svg>
            </button>
            <button class="tasto tasto--freccia" type="button" data-dopo aria-label="Next photo" tabindex="-1">
              <span class="tasto__fondo"></span>
              <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9.5M8.5 3.5 13 8l-4.5 4.5" /></svg>
            </button>
          </div>
        </div>

        <div class="fila" data-fila>
          <i class="fila__luce" data-luce aria-hidden="true"></i>
          <div class="presa presa--fila" data-presa-f></div>
          <div class="presa presa--fila" data-presa-f></div>
          <div class="presa presa--fila" data-presa-f></div>
          <div class="presa presa--fila" data-presa-f></div>
          <div class="presa presa--fila" data-presa-f></div>
          <div class="presa presa--fila" data-presa-f></div>
        </div>
      </section>

      <!-- the six photos: they move between the grid sockets and the row sockets -->
      <div class="riserva" hidden>
        <button class="foto" type="button" data-foto data-flip-id="f0" aria-label="Open Harbour wall"><span class="foto__dentro"><img src="molo.webp" alt="A calm sea at dusk with a stone jetty and a copper horizon" width="960" height="720"></span></button>
        <button class="foto" type="button" data-foto data-flip-id="f1" aria-label="Open Beskid hills"><span class="foto__dentro"><img src="colline.webp" alt="Golden grass hills and fir trees in the low evening sun" width="1024" height="681"></span></button>
        <button class="foto" type="button" data-foto data-flip-id="f2" aria-label="Open Hillside town"><span class="foto__dentro"><img src="paese.webp" alt="Rooftops of a hillside town in Portugal under a warm setting sun" width="1024" height="683"></span></button>
        <button class="foto" type="button" data-foto data-flip-id="f3" aria-label="Open The dunes"><span class="foto__dentro"><img src="dune.webp" alt="Soft pink sand dunes with a long ridge in the haze" width="960" height="643"></span></button>
        <button class="foto" type="button" data-foto data-flip-id="f4" aria-label="Open Big Sur"><span class="foto__dentro"><img src="costa.webp" alt="Bixby Bridge on the Big Sur coast in golden light" width="1024" height="683"></span></button>
        <button class="foto" type="button" data-foto data-flip-id="f5" aria-label="Open Marina Bay"><span class="foto__dentro"><img src="baia.webp" alt="Marina Bay in Singapore under a pink evening sky" width="960" height="641"></span></button>
      </div>
    </div>

    <svg class="puntatore" data-puntatore viewBox="0 0 24 24" aria-hidden="true"><path d="M5 2.8v16.4l4.4-4.2 2.8 6.2 2.8-1.2-2.8-6.1h6.2Z" /></svg>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/Flip.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.

31 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 journal gallery” 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 the warm white paper of Saltway, a made-up travel journal, six real photos sit in a tidy three-column grid, each with the place and the month under it. Hovering, a photo leans in slightly and its thin edge catches the light right where the pointer is; pressed, it gives a little and comes back on a spring. On click the chosen photo grows from its place to the middle of the page, while the others leave with Flip one after another, nearest first, and drop into a thin row of thumbnails under it: the grid has rearranged itself into a frame. The big photo settles from a slight zoom, the caption rises line by line underneath (the place, the month in terracotta, a line from the journal), the two arrows arrive with a small bounce and at the top the edition note makes way for the “Grid” button. The idle thumbnails have less colour; the one of the open photo is lit and has a terracotta ring. With the arrows (or the arrow keys, or tapping a thumbnail) the big photo slides to the next one, which drifts a little inside its frame while the frame takes a breath; the ring runs to the new thumbnail and lands on a spring, stretching as it runs; the caption leaves upwards and the new one rises from below. Esc or “Grid” do the opposite gesture: the caption drops, the big photo goes back to its cell and the thumbnails climb back into the grid. The photos are real (CC0) with a breath of film grain. Left alone, a drawn pointer opens a photo, slides two and goes back to the grid, each time from a different photo.

How it works

Two layouts and the same six photos

The stage has two stacked layers: the grid, with six 4/3 aspect-ratio cells and the name under each, and the open view, with the frame of the big photo, the caption, the arrows and a row of six small cells, also 4/3. The six photos are buttons moving from one cell to another: opening, each goes into its cell of the row; closing, it goes back to its cell of the grid.

The Flip of the others

Before the move Flip.getState records the positions and corner radii of the six photos; then the photos change cell and Flip.from takes them back and animates them to their new place in FLIP_TIME, with absolute: true, scale: false (width and height change, so the photo never stretches) and a STAGGER starting from the chosen photo. Closing does the same in reverse.

The chosen photo growing

The big photo is not the thumbnail: it is a frame holding a track of six images, 600% wide, moved with xPercent. Opening measures the cell of the chosen photo and the frame starts exactly there (left, top, width and height relative to its place) and grows to its place with expo.inOut; meanwhile the chosen thumbnail stays transparent and appears in the row only at the end, so it reads as a single photo growing. Closing sends the frame back onto the grid cell and the real photo reappears under it.

Arrows, the sliding photo and the spring ring

Forwards and back the track slides in SLIDE_TIME; the arriving image drifts 10% inside the frame and the frame dips to 0.985 and comes back with a back.out. The terracotta ring is a single element inside the row: it measures the lit cell (offsetLeft) and moves there with SPRING, stretched by 12% while it runs; on resize it is measured again. The caption has three lines in overflow-hidden windows: they leave with yPercent -110 and the new ones come in from 110, staggered.

Edge light, grain and the press

Each photo has an ::after with a one-pixel border made with a mask: inside, a white radial gradient follows the pointer through the --lx and --ly variables, at the strength LIGHT. The grain is a 140-pixel noise canvas painted once and tiled in overlay at the strength GRAIN. Pressed, the inside of the photo drops to 0.94 and comes back with a curve that overshoots a little: the transform is on the child, because Flip moves the button.

Values to change

NameFileDefaultWhat it changes
FLIP_TIMEscript.js1Seconds of the gesture from the grid to the frame, and back.
STAGGERscript.js0.045Seconds between one photo and the next as they move.
SLIDE_TIMEscript.js0.8Seconds of the big photo sliding to the next one.
SPRINGscript.js'elastic.out(1, 0.55)'The spring of the lit thumbnail following the photo.
GRAINscript.js0.07How much film grain lies on the photos.
LIGHTscript.js0.6How much light the edge of a photo catches under the pointer.
HOLDscript.js2.3Seconds on each photo when the demo plays by itself.

Try them in the Playground

When to use it

For the gallery of a travel blog or journal, a photographer, a hotel or a holiday home, the page of a restaurant with photos of the place: when the photos are the story and you want to go from the overview to a single photo without losing the others. Swap the photos in the img tags of the HTML (twice: in the grid and in the frame), the captions in DIARIO at the top of the script, the colours in :root.

On phones

The same animations at adapted sizes: the grid keeps three columns and is measured on height, the big photo is measured on width and height, the thumbnails shrink to 40 pixels and the note at the top makes way for the “Grid” button. The edge light stays only where there is a pointer.

With reduced motion

No movement: the grid and the open view cross-fade, the big photo changes with a fade instead of sliding, the ring jumps to the new thumbnail and the caption changes with a fade.

Pitfalls

  • Flip moves the photo button with top, left, width and height: the squeeze on press and the zoom on hover live on the child and on the image, otherwise the CSS transform and GSAP's cancel each other.
  • With scale: true the thumbnails would stretch and the corners would squash: scale: false is used with cells of the same 4/3 aspect ratio, and the corner radius goes in the Flip props.
  • The big photo and the chosen thumbnail would be two copies of the same photo in flight: the thumbnail stays transparent until the frame has finished growing, and on closing the real photo reappears only once the frame is on top of it.
  • The frame grows by changing width and height: the track inside is in percentages (600% and xPercent), so the images follow it at any size without recalculating.

Libraries

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

Compressed with gzip, the three demo files weigh 9.5 KB; the libraries: GSAP + Flip 37 KB.

Testing

Tested on 13 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