Skip to content
animorio
IT
Back to the library

The spiral page transition

Transitions, SVGGSAP, CSS onlyMediumCompressed weight: Demo 6.3 KBGSAP 28 KBFreeDownload the zip

A minimal page transition with a single gesture: on the click a terracotta band starts from the bottom corner, runs along the edge under the link and winds inwards in a square spiral, turn after turn, like a coil-built pot, until the page is covered and the band closes with a small settle. Then it unwinds from its outer end: the edges of the new page come free first and the middle last, and only then the new headline rises into its lines. On the way back the spiral starts from the middle and unwinds towards the edges.

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>
<!--
  "The spiral page transition" 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>Orra</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>
  <!-- two pages of an invented coil pottery studio; the link lays one band of clay around the edge of the screen and
       winds it inwards until the page is covered, then the band unwinds from the outside and leaves the new page -->
  <main class="sito" data-site>

    <section class="pagina pagina--chiara" data-page="a" aria-label="Index">
      <header class="testa">
        <p class="marchio">Orra</p>
        <p class="nota">Coil pottery</p>
      </header>
      <div class="eroe">
        <p class="occhiello" data-in>Index</p>
        <h1 class="titolo">
          <span class="riga"><span class="riga__dentro" data-line>Built up</span></span>
          <span class="riga"><span class="riga__dentro" data-line>one coil at a time.</span></span>
        </h1>
        <a class="pillola" href="#work" data-go="b" data-autoclic data-in>
          <span class="pillola__scritta">See the work</span>
          <span class="pillola__segno" data-mark><svg viewBox="0 0 16 16" aria-hidden="true"><path pathLength="1" d="M1.5 14.5H14.5V1.5H1.5V11.5H11.5V4.5H4.5V8.5H8.5" /></svg></span>
        </a>
      </div>
      <footer class="piede">
        <p class="nota">Click the link: one band winds over the page</p>
      </footer>
    </section>

    <section class="pagina pagina--scura" data-page="b" aria-label="Work" hidden>
      <header class="testa">
        <p class="marchio">Orra</p>
        <p class="nota">Work</p>
      </header>
      <div class="eroe">
        <p class="occhiello" data-in>Work</p>
        <h1 class="titolo">
          <span class="riga"><span class="riga__dentro" data-line>Thrown slow,</span></span>
          <span class="riga"><span class="riga__dentro" data-line>fired once.</span></span>
        </h1>
        <a class="pillola" href="#index" data-go="a" data-autoclic data-in>
          <span class="pillola__segno" data-mark><svg viewBox="0 0 16 16" aria-hidden="true"><path pathLength="1" d="M1.5 14.5H14.5V1.5H1.5V11.5H11.5V4.5H4.5V8.5H8.5" /></svg></span>
          <span class="pillola__scritta">Back to index</span>
        </a>
      </div>
      <footer class="piede">
        <p class="nota">Small kiln, twelve pieces a month</p>
      </footer>
    </section>

    <svg class="spirale" aria-hidden="true" data-coil>
      <g data-coil-body>
        <path class="spirale__cucitura" data-seam />
        <path class="spirale__nastro" data-band />
        <path class="spirale__labbro" data-lip />
      </g>
    </svg>
  </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.

30 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 “The spiral page transition” 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

Two pages of an invented pottery studio, Orra, that builds its pots from coils: one on warm white, with the headline ‘Built up one coil at a time.’, and one almost black, ‘Thrown slow, fired once.’. Next to the link there is a small square spiral drawn in a thin line: with the pointer on the link it fills with a bounce, the label widens on the width axis and the little spiral turns a quarter while its line winds in again from its outer end. On the click the link gives under the press and the little spiral turns on a spring. From the bottom left corner a terracotta band, a seventh of the short side of the screen wide, sets off: it runs along the edge under the link, climbs on the right, comes back along the top, goes down on the left and carries on inwards, turn after turn, slow at first, fast on the large turns and slow again on the last ones. Between one turn and the next a thin darker seam stays, like between two coils of clay, and the moving end has a lighter lip two and a half pixels wide. Meanwhile the old page draws in a hair towards the middle and the small text dims by half. When the band reaches the middle the page is covered: the whole band presses in by a pixel and comes back on a spring, like clay under the thumb. A beat, then the band unwinds from its outer end, with the light lip now on its tail: the new page is already underneath and comes free from the edges towards the middle. Only once the band has left almost all of the page does the new headline come in: its lines rise from their slots narrow on the width axis, widen, go a hair too far and settle. On the way back the gesture turns around: the spiral starts from the middle, winds out towards the edges and unwinds again from the middle.

How it works

A single path

The two pages are real HTML, one above the other; on top of them there is an svg that lets clicks through, with the same path three times: the seam, the band and the lip. The path is a square spiral of lane centres, worked out in pixels from the size of the window and rebuilt on every resize.

Lanes that close

The width of the band is the short side divided by TURNS: with an odd number the last run passes right through the middle and covers everything. The last stretch runs on by half a lane, so the corner in the middle is covered too, and the outer turn sits a seam beyond the edge, so the dark line never shows along the screen.

Head and tail as shares

The band is a single stroke-dasharray dash: ‘0, tail, head minus tail, the rest’. Head and tail are shares of the path from 0 to 1 that GSAP animates with power2.inOut; stored like that, if the window changes size halfway through the band is redrawn right.

The seam and the lip

The seam is the same path a pixel wider than the band and darker, drawn underneath: between one turn and the next a thin line of it stays. The lip is a lighter dash two and a half pixels long that follows the head while the band winds and the tail while it unwinds.

The settle and the headline

Once the band has closed, the svg group shrinks by two pixels on the long side in eight hundredths of a second and comes back with elastic.out. The new headline starts towards the end of the unwinding: each line rises from yPercent 108 with the --wdth variable going from 62 to 86 and settles at 84.

Values to change

NameFileDefaultWhat it changes
WINDscript.js1.35How many seconds the band takes to wind over the whole page.
UNWINDscript.js1.15How many seconds it takes to unwind and free the new page.
TURNSscript.js7How many widths of band fit across the short side of the screen (odd numbers close best).
HOLDscript.js0.14How many seconds the page stays covered before the band unwinds.
SEAMscript.js1.2How wide the seam between one turn and the next is, in pixels (0 = no seam).
SPEEDscript.js12 = twice as fast, 0.5 = half as fast.

Try them in the Playground

When to use it

For moving between the pages of a pottery studio, a craft workshop, an archive or a portfolio that wants a page change with a single gesture, geometric and precise, that goes from the edge to the middle.

On phones

The same transition with adapted sizes: the band is a seventh of the short side on a phone too, so the turns are the same, and the headline is as big as the box allows in width and height. Without a pointer the link’s little spiral does not wind in on hover.

With reduced motion

The band does not move: the old page fades out and the new one fades in, with no spiral and no movement.

Pitfalls

  • With stroke-linecap butt the last stretch ends halfway along its lane: it has to run on by half a lane, otherwise a square hole of the old page stays in the middle.
  • The seam is a pixel wider than the band and also lies along the outer edge of the first turn: if the spiral starts inside the screen, a dark line shows along the edges. The outer turn has to move a seam beyond the edge.
  • The link’s little spiral turns with GSAP and on hover with CSS: on the same element, GSAP’s inline transform cancels the hover one. It needs a span for GSAP and the svg inside for the CSS.

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 31 October 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