Skip to content
animorio
IT
Back to the library

Image trail

Hover, ImagesGSAP, CSS onlyMediumCompressed weight: Demo 6.3 KBGSAP 28 KBFreeDownload the zip

The home of Kvelda, a made-up landscape photography studio: the big name in the middle, and as the pointer moves the photos of the winter series, Iceland and Norway, are left behind it one every so many pixels, grow with a small tilt, drift a moment with the movement and fade as they sink. The newest sits on top, with the name of its place in a pill; the faster you go, the bigger and further apart they are. When nobody touches, an invisible hand draws a slow loop across the page.

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>
<!--
  "Image trail" 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>Image trail</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 home of a made-up landscape photography studio, Kvelda. As the pointer moves, photographs from the
       studio's winter series are left behind it, one every so many pixels of travel: each one grows from 0.6 with a
       small measured tilt, drifts a moment in the direction of the movement, then dims and sinks away. The newest one
       is on top and carries the name of its place. Faster movement leaves bigger, wider-spaced photos. When nobody
       moves, an invisible hand draws a slow loop across the page. -->
  <main class="stage" data-stage>
    <header class="top">
      <p class="brand">Kvelda <span>Studio</span></p>
      <p class="series">Winter series, Iceland &amp; Norway</p>
    </header>

    <div class="center">
      <h1 class="name" data-name>Kvelda</h1>
      <p class="line">Landscape photography from the far north</p>
    </div>

    <div class="trail" data-trail aria-hidden="true"></div>
    <p class="caption" data-caption aria-hidden="true"><span data-caption-text></span></p>

    <footer class="bottom">
      <p class="hint" data-hint>Move to look around</p>
      <nav class="links" aria-label="Studio">
        <a href="#" data-link>Index</a>
        <a href="#" data-link>Journal</a>
        <a href="#" data-link>Contact</a>
      </nav>
    </footer>
  </main>

  <!-- the photographs of the series, in the order they come out -->
  <ul class="photos" data-photos hidden>
    <li data-src="kirkjufell.webp" data-w="900" data-h="600">Kirkjufell, Iceland</li>
    <li data-src="parete.webp" data-w="900" data-h="597">Fjord wall in fog</li>
    <li data-src="lofoten.webp" data-w="900" data-h="600">Lofoten, Norway</li>
    <li data-src="nebbia.webp" data-w="900" data-h="600">Mist on the lake</li>
    <li data-src="kleifarvatn.webp" data-w="900" data-h="506">Kleifarvatn, Iceland</li>
    <li data-src="cima.webp" data-w="900" data-h="599">Peak in the clouds</li>
    <li data-src="oceano.webp" data-w="900" data-h="675">Winter sea</li>
    <li data-src="valle.webp" data-w="900" data-h="563">Lake in the valley</li>
    <li data-src="cascata.webp" data-w="900" data-h="506">Waterfall, Iceland</li>
    <li data-src="neve.webp" data-w="900" data-h="668">First snow</li>
    <li data-src="altopiano.webp" data-w="900" data-h="675">Highlands, Iceland</li>
    <li data-src="lago-fermo.webp" data-w="900" data-h="675">A still lake</li>
  </ul>

  <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.

34 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Image trail” 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 paper page the name of the studio, Kvelda, huge and dark, with «Landscape photography from the far north» below; at the top the brand and the series, at the bottom «Move to look around» and the links. As the pointer moves, every time it has travelled about half a photo a new one is born where it is: it enters from 0.6 of its size on a spring, takes a small tilt, always the same for the same photo, and slides for a moment in the direction of the movement; a thin light crosses it. After a second it fades as it sinks, tilting a little more. The newest is always on top of the others and below it a pill names the place, «Kirkjufell, Iceland», with the words rising. The faster the pointer, the bigger the photos and the further apart, and the studio name widens a touch. The twelve photos come round in order. After two seconds of stillness an invisible hand draws a slow loop and the trail carries on by itself.

How it works

The travel

Every movement adds up the distance from the previous point. When it passes half the width of a photo (SPACING), the count goes back to zero and a photo is born where the pointer is. So photos come out at regular distances, whether the mouse moves slowly or fast.

The speed

The speed is smoothed frame by frame. It becomes a number between 0 and 1 that makes the new photo bigger (SPEED_GROW) and the travel before the next one longer: moving in a hurry leaves a wider, sparser trail.

The photo

Each photo is a figure with the image inside: GSAP moves the figure, the image fills it with object-fit. It enters from 0.6 with back.out, tilts by an angle taken from a fixed sine (same photo, same angle) and slides for FOLLOW seconds of speed, never leaving the page. After LIFE seconds it fades over FADE seconds and is removed.

The place

Below the newest photo there is a single pill, following it on a spring and swapping its words by sliding them up. It is one element for the whole page, so it does not multiply with the trail.

The invisible hand

If the pointer stays still for IDLE seconds, a point in the ticker follows a slow Lissajous curve across the page and goes through the same function as the real pointer: the trail carries on by itself. At the first real movement the hand stops and the count starts afresh, without jumps.

Values to change

NameFileDefaultWhat it changes
SIZEscript.js1How big the photos are compared to the page (1 = about a third of the short side).
SPACINGscript.js0.55How far the pointer travels before the next photo, compared to a photo’s width.
LIFEscript.js1.0How long a photo stays before it fades, in seconds.
FADEscript.js0.7How long a photo takes to fade and sink, in seconds.
TILTscript.js6The largest tilt of a photo, in degrees.
FOLLOWscript.js0.12How far a photo keeps drifting with the movement (seconds of pointer speed).
SPEED_GROWscript.js0.3How much bigger the photos get when the pointer moves fast (0 never).
IDLEscript.js2.2After how many seconds of stillness the invisible hand starts.
--accentstyle.css#b5532fThe single accent colour: the place under the newest photo and the link under the pointer.

Try them in the Playground

When to use it

On the home page of a photographer, a creative studio or an agency that wants to show many images without a grid: whoever arrives moves the mouse and sees the work go by. It also works as a portfolio section or as the entrance page of an exhibition.

On phones

Sizes follow the short side of the page, so in the phone box the photos stay a third of it and never leave the sides: every photo and the pill are kept inside the page. With a finger the trail follows the drag (touch-action off on the demo page only); when still, the invisible hand takes over.

With reduced motion

No drifting, tilting or running hand: photos fade in and out where they are born, and when still they take turns in six fixed places around the name.

Pitfalls

  • The travel is measured on every movement and not on a timer: with a fixed interval a slow mouse would pile photos on the same spot and a fast one would leave them randomly far apart.
  • When the invisible hand stops or starts again the previous point is forgotten: otherwise the jump from the hand to the real pointer would count as a long stretch and give birth to a photo halfway.
  • Old photos are removed from the page at the end of their timeline: in a trail that never ends, just hiding them would make the page grow for ever.
  • The tilt comes from a fixed sine of the photo’s number, not from Math.random: so the video and the poster are the same on every loop.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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