Skip to content
animorio
IT
Back to the library

Horizon photo gallery

Images, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 9.7 KBGSAP 28 KBFreeDownload the zip

The portfolio gallery of Fellmark, a made-up landscape photography studio, with five real photos: the jetty on the lake, the dunes, the moon over the sea, the open water and the desert valley. To go from one photo to the next a thread of warm light draws itself on the horizon of the photo on screen, glides on a spring to the height of the next photo’s horizon while the thirds of the viewfinder show for a moment, and the new photo opens from there: the sky goes up, the land goes down, the two halves part by a few pixels and settle from a hair too large, and the thread gives a last anamorphic flare and fades. The title and the shot data (focal length, aperture, shutter, ISO) roll letter by letter, the ring on the thumbnails jumps across with a bounce and its thin line counts the time before the next photo. Left alone it turns by itself; thumbnails, arrows, a swipe or the arrow keys take over.

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>
<!--
  "Horizon photo 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>The landscape gallery where each photo opens along its horizon</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 portfolio viewer of Fellmark, a made-up landscape studio, with five real photos. To change photo a thin
       line of light appears on the horizon of the one on screen, glides to the height of the next one's horizon
       and the next photo opens from it: the sky parts upwards, the land downwards, and both settle. The title and
       the camera data roll to the new ones, the ring on the strip of thumbnails springs across. Left alone it
       turns on its own; the thumbnails, the arrows, a swipe and the arrow keys take over. -->
  <main class="palco" data-palco>
    <article class="viewer" data-viewer>
      <header class="testa">
        <p class="marchio">
          <svg class="marchio__segno" viewBox="0 0 20 20" aria-hidden="true"><path d="M4.5 11a5.5 5.5 0 0 1 11 0" /><path d="M1.5 11h17" /><path d="M5 14.5h10" /></svg>
          Fellmark
        </p>
        <p class="serie">Quiet Horizons <span>Landscape, 2025</span></p>
      </header>

      <div class="cornice" data-cornice aria-roledescription="carousel" aria-label="Quiet Horizons, five landscapes">
        <figure class="lastra" data-lastra data-orizzonte="0.53">
          <div class="meta meta--cielo" data-cielo><img src="pontile.webp" width="960" height="641" alt="A long wooden jetty runs out over still water towards a pine shore and a mountain" decoding="async"></div>
          <div class="meta meta--terra" data-terra><img src="pontile.webp" width="960" height="641" alt="" decoding="async"></div>
        </figure>
        <figure class="lastra" data-lastra data-orizzonte="0.28">
          <div class="meta meta--cielo" data-cielo><img src="dune.webp" width="1000" height="750" alt="Sand dunes in low sun, a bright ridge running to the horizon" decoding="async"></div>
          <div class="meta meta--terra" data-terra><img src="dune.webp" width="1000" height="750" alt="" decoding="async"></div>
        </figure>
        <figure class="lastra" data-lastra data-orizzonte="0.455">
          <div class="meta meta--cielo" data-cielo><img src="luna.webp" width="960" height="640" alt="A full moon over a dark sea, its light a road on the water, rocks in front" decoding="async"></div>
          <div class="meta meta--terra" data-terra><img src="luna.webp" width="960" height="640" alt="" decoding="async"></div>
        </figure>
        <figure class="lastra" data-lastra data-orizzonte="0.30">
          <div class="meta meta--cielo" data-cielo><img src="mare.webp" width="960" height="540" alt="Open sea under a pale sky, turquoise over the reef" decoding="async"></div>
          <div class="meta meta--terra" data-terra><img src="mare.webp" width="960" height="540" alt="" decoding="async"></div>
        </figure>
        <figure class="lastra" data-lastra data-orizzonte="0.47">
          <div class="meta meta--cielo" data-cielo><img src="valle.webp" width="960" height="639" alt="Eroded desert ridges in late light under a clear blue sky, far mountains" decoding="async"></div>
          <div class="meta meta--terra" data-terra><img src="valle.webp" width="960" height="639" alt="" decoding="async"></div>
        </figure>

        <div class="terzi" data-terzi aria-hidden="true"><i></i><i></i><i></i><i></i></div>
        <div class="guida" data-guida aria-hidden="true">
          <div class="linea" data-linea>
            <i class="linea__alone" data-alone></i>
            <i class="linea__filo"></i>
            <i class="linea__capo"></i>
            <i class="linea__capo linea__capo--destra"></i>
          </div>
        </div>
        <i class="luce" data-luce aria-hidden="true"></i>
        <i class="velo" aria-hidden="true"></i>
      </div>

      <div class="didascalia" aria-live="polite">
        <div class="didascalia__nomi">
          <p class="titolo" data-titolo>Still water</p>
          <p class="luogo" data-luogo>Alta Lake, British Columbia</p>
        </div>
        <ul class="dati" aria-label="Camera settings">
          <li class="dato" data-dato>24mm</li>
          <li class="dato" data-dato>f/11</li>
          <li class="dato" data-dato>30s</li>
          <li class="dato" data-dato>ISO 64</li>
        </ul>
      </div>

      <nav class="fila" aria-label="Photos">
        <div class="miniature" data-miniature>
          <i class="selettore" data-selettore aria-hidden="true"><i class="selettore__corsa" data-corsa></i></i>
          <button class="miniatura" type="button" data-miniatura aria-label="Still water"><img src="pontile.webp" width="960" height="641" alt="" decoding="async"></button>
          <button class="miniatura" type="button" data-miniatura aria-label="Last light on the erg"><img src="dune.webp" width="1000" height="750" alt="" decoding="async"></button>
          <button class="miniatura" type="button" data-miniatura aria-label="Moon road"><img src="luna.webp" width="960" height="640" alt="" decoding="async"></button>
          <button class="miniatura" type="button" data-miniatura aria-label="Flat calm"><img src="mare.webp" width="960" height="540" alt="" decoding="async"></button>
          <button class="miniatura" type="button" data-miniatura aria-label="Valley of the Moon"><img src="valle.webp" width="960" height="639" alt="" decoding="async"></button>
        </div>
        <div class="frecce">
          <button class="freccia" type="button" data-prima aria-label="Previous photo"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M10 3.5 5.5 8l4.5 4.5" /></svg></button>
          <button class="freccia" type="button" data-dopo aria-label="Next photo"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5" /></svg></button>
        </div>
      </nav>
    </article>
  </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.

24 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 “Horizon photo 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 a near black ground, with a veil of warm light at the top, sits the gallery of Fellmark, a made-up landscape photography studio: a dark card with a thin edge that catches the light and soft layered shadows. At the top the mark, half a sun over two lines, the name Fellmark and on the right Quiet Horizons, Landscape, 2025. Below, the photo frame with rounded corners, vignetting and a breath of grain; then the large title, the place in grey and four pills with the shot data (24mm, f/11, 30s, ISO 64); at the bottom the strip of five thumbnails with the light ring on the chosen one and two round buttons with arrows. On opening the card rises, a thread of light widens on the horizon of the first photo, the jetty on the lake, and the photo opens from there, the sky upwards and the lake downwards. Then the gallery turns by itself: inside the ring a thin line fills, the gold thread of light appears on the photo’s horizon, glides up or down to the horizon of the next photo with a small bounce, the thirds of the viewfinder barely light up, the old photo darkens and the new one opens from the thread, its two halves parting and settling; the thread flares once and is gone. Meanwhile the title and the data roll letter by letter, the pills widen or narrow on a spring, the place rises and the ring jumps to the new thumbnail. The photos are the dunes at sunset, the moon over the sea with its trail, the flat sea over the reef and the valley of the moon in the desert; then it starts again from the jetty. While a photo rests, it slowly leans in. With the mouse a soft light follows the pointer on the photo, the thumbnails lift and the arrows, when pressed, squash and come back with a bounce.

How it works

Each photo knows where its horizon is

Each photo has data-orizzonte, the height of its horizon as a share of the picture. The script redoes the object-fit: cover sum with the sizes of the frame and the photo and finds where the horizon falls in the frame, as a percentage: so it holds at any width.

Two layers of the same photo

Each photo is two layers with the same picture: the sky, clipped with clip-path above the horizon, and the land, clipped below. The clip sits on the layer and never leaves the line; inside it the picture slides by PARTING pixels and settles from SETTLE to 1, so the two halves seem to part from the line.

The thread of light that glides

The thread sits in a wrapper as tall as the frame that GSAP moves with yPercent: a yPercent equal to the horizon puts the thread right on the line. It first draws itself on the horizon of the photo on screen, then glides with back.out to the next photo’s, and only then does the new photo open.

Letters that roll

The title and the data pills split into letters only for the change: the old ones rise and go, the new ones come up from below one after another with a small bounce, the pill widens or narrows on a spring, and at the end they go back to plain text so the font keeps its kerning.

Values to change

NameFileDefaultWhat it changes
DWELLscript.js2.4The seconds each photo rests before the next one, when the gallery turns by itself.
OPENscript.js0.95The seconds the new photo takes to open from its horizon.
GLIDEscript.js0.6The seconds the thread of light takes to glide to the new horizon.
PARTINGscript.js14How many pixels the sky and the land travel as they part from the line.
SETTLEscript.js1.06How large the new photo starts before it settles (1 for none).
GLOWscript.js1How strong the flare around the thread of light is (0 just the thread).
DRIFTscript.js1.03How far the photo leans in while it rests (1 stays still).
--sunstyle.css#f0cf9fThe warm gold of the thread of light and the mark.
--pagestyle.css#0b0c0eThe black of the page.

Try them in the Playground

When to use it

For the portfolio of a landscape, travel or architecture photographer, for the page of a series or an exhibition, or for the gallery of a hotel or holiday home in front of a fine view: whoever looks moves from photo to photo with the thumbnails, the arrows or a finger, and sees the title, the place and the shot data along with it.

On phones

The same animation with adapted measures: the card is sized on the height too, the data pills move under the title, the thumbnails and arrows shrink and below 420 pixels the series year hides; on the photo you swipe to change.

With reduced motion

No motion: no thread of light and no parting photo, the photos change with a fade and the words appear already in place.

Pitfalls

  • With object-fit: cover the photo’s horizon no longer sits at the same height in the frame: it must be worked out again from the real crop, using the sizes of the frame and the photo.
  • If the clipped layer moves, the clip edge leaves the line and two strips show: the clip goes on the container, the movement on the picture inside.
  • Splitting words into letters drops Mona Sans’s kerning (35m m, 1/3 20): once the roll is done the whole text goes back in.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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