Skip to content
animorio
IT
Back to the library

Hour over the photo

Scroll, Images, TextGSAPAdvancedCompressed weight: Demo 5.6 KBGSAP + ScrollTrigger 45 KBFreeDownload the zip

Scroll inside the preview

Scroll down and the strip moves sideways; when a panel with the time arrives, the slide before it stays still and shrinks while the panel covers it.

Rebuilt from scratch studying lemansclassic.richardmille.com by Magnetism: the idea is theirs; code, copy and images are ours. Read how it’s made

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>
<!--
  "Hour over the photo" 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="it">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>L’ora che copre la foto</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/standard.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>

  <!-- la striscia: si scorre in giù, si va di lato. Lo schermo resta fermo (sticky) mentre il binario scivola -->
  <main class="striscia" data-striscia>
    <div class="striscia__schermo">
      <div class="binario" data-binario>
      <section class="lastra lastra--apertura tema-giallo">
        <div class="lastra__contenuto" data-contenuto>
          <h1 class="apertura__titolo">Fuori<br>campo</h1>
          <p class="apertura__testo">Una giornata di gara vista dal lato del box, un’ora dopo l’altra.</p>
          <p class="apertura__scorri">Scorri <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 12h15M13 6l6 6-6 6" /></svg></p>
        </div>
      </section>
      <figure class="lastra lastra--foto">
        <div class="lastra__contenuto" data-contenuto>
          <div class="cornice" style="--r: 1.5"><div class="cornice__dentro"><img src="tribuna.webp" alt="File di seggiolini vuoti in una tribuna" width="1024" height="654" loading="eager" decoding="async" style="object-position: 50% 50%"></div></div>
          <figcaption>Alle sei la tribuna è vuota e il cemento è ancora freddo.</figcaption>
        </div>
      </figure>
      <section class="lastra lastra--testo tema-carta">
        <div class="lastra__contenuto" data-contenuto>
          <h2 class="testo__titolo"><span class="riga"><span>Prima che</span></span><span class="riga"><span>arrivi il rumore</span></span></h2>
          <p class="testo__corpo">Il paddock è ancora un parcheggio. Le prime voci arrivano dai box, insieme all’odore del caffè e della benzina.</p>
        </div>
      </section>
      <section class="lastra lastra--titolo tema-carta">
        <div class="lastra__contenuto" data-contenuto>
          <p class="titolo-media"><span class="titolo-media__parola">Primo</span><span class="titolo-media__foto"><img src="curva.webp" alt="Una curva della pista col cordolo, vuota" width="1024" height="683" loading="eager" decoding="async" style="object-position: 40% 50%"></span><span class="titolo-media__parola">giro</span></p>
          <p class="testo__corpo testo__corpo--centro">Il primo giro si guarda in silenzio, anche da dietro le transenne.</p>
        </div>
      </section>
      <section class="lastra lastra--ora tema-giallo" data-ora>
        <div class="lastra__contenuto">
          <p class="ora" aria-label="09:15"><span class="cifra"><span>0</span></span><span class="cifra"><span>9</span></span><span class="due-punti">:</span><span class="cifra"><span>1</span></span><span class="cifra"><span>5</span></span></p>
          <p class="ora__sotto">Le gomme vanno in pista</p>
        </div>
      </section>
      <figure class="lastra lastra--foto">
        <div class="lastra__contenuto" data-contenuto>
          <div class="cornice" style="--r: 1.6"><div class="cornice__dentro"><img src="gomme.webp" alt="Un mucchio di gomme segnate col gesso" width="1024" height="493" loading="eager" decoding="async" style="object-position: 50% 50%"></div></div>
          <figcaption>Le gomme aspettano ammucchiate, ognuna segnata col gesso.</figcaption>
        </div>
      </figure>
      <figure class="lastra lastra--foto">
        <div class="lastra__contenuto" data-contenuto>
          <div class="cornice" style="--r: 0.8"><div class="cornice__dentro"><img src="casco.webp" alt="Un casco appoggiato sulla sella di una moto" width="1024" height="683" loading="eager" decoding="async" style="object-position: 45% 50%"></div></div>
          <figcaption>Un casco appoggiato sulla sella, la visiera ancora sporca del giro prima.</figcaption>
        </div>
      </figure>
      <section class="lastra lastra--testo lastra--piena tema-inchiostro">
        <div class="lastra__contenuto" data-contenuto>
          <h2 class="testo__titolo"><span class="riga"><span>Il pomeriggio</span></span><span class="riga"><span>non passa mai</span></span></h2>
          <p class="testo__corpo">Il rumore diventa normale, come il vento. Ci si accorge che c’è solo quando si ferma.</p>
        </div>
      </section>
      <section class="lastra lastra--ora tema-inchiostro" data-ora>
        <div class="lastra__contenuto">
          <p class="ora" aria-label="22:30"><span class="cifra"><span>2</span></span><span class="cifra"><span>2</span></span><span class="due-punti">:</span><span class="cifra"><span>3</span></span><span class="cifra"><span>0</span></span></p>
          <p class="ora__sotto">Restano solo i fari</p>
        </div>
      </section>
      <figure class="lastra lastra--foto">
        <div class="lastra__contenuto" data-contenuto>
          <div class="cornice" style="--r: 1"><div class="cornice__dentro"><img src="fari.webp" alt="La scia dei fari in una curva di notte" width="1024" height="683" loading="eager" decoding="async" style="object-position: 55% 50%"></div></div>
          <figcaption>Di notte la gara è una scia di luce che entra in curva e torna.</figcaption>
        </div>
      </figure>
      <section class="lastra lastra--fine tema-giallo">
        <div class="lastra__contenuto" data-contenuto>
          <h2 class="apertura__titolo">Fine<br>del giro</h2>
          <button type="button" class="torna">Torna all’inizio</button>
        </div>
      </section>
      </div>
    </div>
  </main>

  <div class="grana" aria-hidden="true"></div>

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

38 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 “Hour over the photo” 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

The page is a strip of slides in a row: texts, photographs, a title with a photo in the middle. Scrolling down moves the strip sideways, and every photo also slides inside its frame, a little slower. Then a panel as wide as the screen arrives with a huge time: the slide in front of it does not leave, it stays still on screen and shrinks away while the panel slides over it, and the digits of the time rise one at a time out of their mask. The photos are real, a race day seen from the pits: the empty grandstand in the morning, a corner of the track with its kerb, tyres marked in chalk, a helmet on a saddle, the headlight trail at night, all in black and white.

How it works

The strip

A screen as tall as the window with position: sticky and overflow: hidden; inside, a flex track as wide as all the slides. The section is as tall as the track's travel plus one screen, and a single scrubbed timeline moves the track one pixel left for every pixel scrolled. It is linear (ease none): the other effects need it that way.

Hooked effects

Every other ScrollTrigger uses containerAnimation: the track's timeline. So start and end are written horizontally, for instance 'left right' (the element's left edge touches the screen's right edge) to 'right left'.

The photo in its frame

Inside each frame there is a layer 120% wide. While the frame crosses the screen the layer goes from a negative x (as much as it overhangs) to zero: the photo seems farther away than the page.

The panel that covers

While the panel goes from 'left right' to 'left left', the slide before it moves right by the panel's width: the track carries it left, it moves right, and on screen it stands still. In the first quarter of that travel its content goes to scale 0.86 and disappears; then the digits of the time rise out of their masks one after another.

Values to change

NameFileDefaultWhat it changes
RIMPICCIOLISCEscript.js0.86How far the covered slide shrinks while it disappears.
SPARISCEscript.js0.25At what fraction of the panel's travel the covered slide has already gone.
PARALLASSEscript.jstruePhotos slide inside their frame. With false they stay still.
data-oraindex.htmlsul pannelloAny slide with data-ora covers the one before it. It can hold a time, a title, a big number.

Try them in the Playground

When to use it

For a photo story that runs like a roll of film: a reportage, a day, a collection. The covering panel is a chapter change without changing page.

On phones

The strip stays horizontal and is driven by the finger just like the wheel: frames and titles adapt to the screen height.

With reduced motion

No strip: the slides sit one below the other, the photos are still and the time panels are ordinary sections.

Pitfalls

  • The track timeline must have ease none: containerAnimation computes horizontal positions assuming linear movement.
  • The section height must be recomputed before every refresh (refreshInit event): if the track width changes, so does how far you need to scroll.
  • The covered slide's offset must be a function (x: () => panel width) with invalidateOnRefresh, or after a resize the slide drifts away.
  • Do not put transforms on the sticky screen: a transform on an ancestor breaks position: sticky.
  • The photos are in colour and turn black and white through a CSS filter (grayscale plus a touch of contrast) on the img: a new photo drops in without editing. The img has real width and height and object-fit: cover, and sits in the 120% wide layer that slides.

Libraries

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

Compressed with gzip, the three demo files weigh 5.6 KB; the libraries: GSAP + ScrollTrigger 45 KB.

Testing

Tested on 8 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: Done

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