
Film slider
Transitions, Images, Hover
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.
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>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
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 siteThe 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.
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 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.
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.
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.
| Name | File | Default | What it changes |
|---|---|---|---|
FLIP_TIME | script.js | 1 | Seconds of the gesture from the grid to the frame, and back. |
STAGGER | script.js | 0.045 | Seconds between one photo and the next as they move. |
SLIDE_TIME | script.js | 0.8 | Seconds of the big photo sliding to the next one. |
SPRING | script.js | 'elastic.out(1, 0.55)' | The spring of the lit thumbnail following the photo. |
GRAIN | script.js | 0.07 | How much film grain lies on the photos. |
LIGHT | script.js | 0.6 | How much light the edge of a photo catches under the pointer. |
HOLD | script.js | 2.3 | Seconds on each photo when the demo plays by itself. |
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.
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.
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.
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.
Tested on 13 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.