Skip to content
animorio
IT
Back to the library

Flipping colour ladder

Scroll, BackgroundsCSS onlyMediumCompressed weight: Demo 6.6 KBLenis 5.3 KBFreeDownload the zip

Scroll inside the preview

The programme of one day at Slowform Retreat, a made-up retreat for type and interface designers, as a ladder of nine rows from cream to near black. Each row is a CSS 3D block: on the front its own colour and a slot of the day, underneath the colour of the opposite row and a slot of the night. As the ladder rises through the screen the blocks roll over by 90 degrees one after the other, the order of the colours turns upside down and the day becomes the night; the big word above rolls with the middle row, from Day to Night. Scroll back and they roll back. Inspired by the Chande Bootcamp site.

Rebuilt from scratch studying chandebootcamp.com by Lumen Studio, Kaixa: 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>
<!--
  "Flipping colour ladder" 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>Day and night · Slowform Retreat</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- The programme of one day at a made-up design retreat as a ladder of nine colour rows, cream to near black. Each
       row is a 3D block: its front face has the row's own colour and the day's slot, its bottom face the colour of the
       mirrored row and the night's slot. As the ladder rises through the screen the blocks roll over by 90 degrees, one
       after the other: the order of the colours flips and the day becomes the night. -->
  <main class="pagina">

    <section class="apertura">
      <p class="sopra">Slowform Retreat <span class="sep" aria-hidden="true"></span> Orsa Valley <span class="sep" aria-hidden="true"></span> 14–16 May</p>
      <h1 class="titolo">One valley,<br>two lights.</h1>
      <p class="sotto">Day two of three: the programme turns over at dusk.</p>
      <p class="invito" aria-hidden="true"><span>Scroll</span><svg viewBox="0 0 12 16"><path d="M6 1v13M1.5 9.5 6 14l4.5-4.5" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg></p>
    </section>

    <section class="giornata" data-giornata>
      <div class="testa">
        <p class="testa__sopra">Day two <span class="sep" aria-hidden="true"></span> Programme</p>
        <div class="parola" data-parola aria-live="polite">
          <div class="blocco" data-blocco>
            <div class="faccia faccia--fronte"><span>Day</span></div>
            <div class="faccia faccia--sotto"><span>Night</span></div>
          </div>
        </div>
      </div>

      <div class="scala" data-scala aria-label="Programme of day two"></div>

      <p class="nota" data-nota>Times are local. Bring a sketchbook and something warm for the pier.</p>
    </section>

    <section class="chiusura">
      <p class="chiusura__sopra">Slowform Retreat</p>
      <p class="chiusura__titolo">Lights out at midnight.<br>Coffee at six.</p>
    </section>

  </main>

  <script src="https://cdn.jsdelivr.net/npm/lenis@1.3.26/dist/lenis.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 “Flipping colour ladder” 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 cream page, at the top, «Slowform Retreat — Orsa Valley — 14–16 May» and the title «One valley, two lights.». Scrolling brings the programme of day two: the big word «Day» and under it nine full-width rows, cream at the top to near black at the bottom, each with the time, the slot and the place, from first light at 6:00 to the closing circle at 17:30. The middle row, Workshops at 10:00, has an orange dash. When the ladder passes the middle of the screen the rows roll upwards one after the other, like blocks: the face going away darkens, a thread of light runs along the edge and a soft shadow grows under the ladder. Each row that lands settles by one pixel. In the end the colours are upside down, near black at the top, and the rows tell the night, from the dusk swim at 18:30 to lights out at midnight, with Fireside talks at 21:00 in the middle; the big word has become «Night». Scroll back and everything rolls back.

How it works

Each row’s block

Each row holds a block with transform-style preserve-3d and two faces: the front one pushed forward by half the height (translateZ), the bottom one turned by -90 degrees and pushed the same way. Turning the block 90 degrees with rotateX brings the bottom face to the front.

The colours upside down

The front face of row i has colour i of the ladder, the bottom face colour n − 1 − i: once they have all turned, the ladder is the same one read backwards. The type colour is picked per face, ink or paper, whichever has the higher contrast.

A ladder that does not grow

The front face sits half a row nearer the eye, and the perspective would enlarge it by p / (p − h/2): the block is shrunk by p / (p + h/2), so at rest the edges are exactly those of the row. h is measured again on every resize.

When they roll

The centre of the ladder is read on every scroll: between 85% and 55% of the screen it becomes a progress from 0 to 1. Each row starts 0.07 after the one above and covers the rest on a smoothstep, x·x·(3 − 2x).

The chase

The angle does not follow the scroll directly: each frame it moves towards its goal by k = 1 − e^(−9·dt), which behaves the same at 60 or 120 frames a second. When still, the loop stops; scrolling back lowers the goal and the rows roll back.

Shade, light and settle

While it turns, a dark veil grows on the face going away up to 0.38, a thread of light worth sin(π·t) runs along the edge and the ladder casts a shadow that is strongest halfway. When a row lands, a small spring dips it by one pixel and brings it back.

Values to change

NameFileDefaultWhat it changes
STARTscript.js0.85Where the centre of the ladder is on the screen when the rows start rolling (0 top, 1 bottom).
ENDscript.js0.55Where the centre of the ladder is when they have finished.
STAGGERscript.js0.07How much later each row starts than the one above, as a share of the whole roll.
CHASEscript.js9How quickly the angle chases the scroll: k = 1 − e^(−CHASE·dt).
PERSPECTIVEscript.js1600The CSS perspective of the ladder, in pixels: lower shows more of the blocks’ sides.
SETTLEscript.js1How many pixels a row dips when it lands.
LERPscript.js0.1Lenis smooth scroll: lower is smoother.

Try them in the Playground

When to use it

For a programme, a timetable or a before and after told by the scroll (day and night, summer and winter, before and after a product), or as a striped divider between two sections of different colour, going from light to dark.

On phones

The ladder takes the full width; the place goes away and the slot moves to the right, the time stays on the left. Rows are 5.4% of the screen tall (between 22 and 54 pixels), the big word is sized on the smaller of 15vw and 12.5vh. Scrolling with a finger does everything.

With reduced motion

No rolling and no smooth scroll: when the ladder passes halfway through its stretch the faces cross-fade, the colours turn over and the word goes from Day to Night.

Pitfalls

  • Perspective only reaches direct children: if the 3D block sits inside another row, that row needs transform-style: preserve-3d, or the block turns flat and the p / (p + h/2) correction only shrinks it.
  • A face left at an angle for the last 2% of the roll shows its edge: switch it off with opacity clamp(0, (1 − t)·50, 1), and the opposite one with clamp(0, t·50, 1).
  • While turning, the faces nearest the eye stick out sideways by a few pixels: the section needs overflow-x: clip, or the page scrolls sideways.
  • A mark under the middle label (the accent dash) must be out of the flow, or it makes the line taller and the label is no longer centred.

Libraries

Lenis 1.3.26, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 6.6 KB; the libraries: Lenis 5.3 KB.

Testing

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