Skip to content
animorio
IT
Back to the library

Loader to header

Transitions, TextGSAP, CSS onlyMediumCompressed weight: Demo 7.1 KBGSAP 28 KBFreeDownload the zip

The loader of Slowform Retreat, a made-up retreat for people who draw letters and interfaces: four cells in the middle of a dark screen, the name, the track with a percentage that climbs in steps with pauses and two provisional labels that arrive under an orange block. Once full, the bar slides to the top and becomes the real header of the site: the cells change colour, the fill wipes out to the right, the labels flip to the local time and to the real links, the menu slides in and the dark backdrop pulls down to uncover the page. 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>
<!--
  "Loader to header" 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>Slowform Retreat · Orsa Valley</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>
  <!-- A loader that becomes the header. Four cells sit in the middle of a dark screen: the name of the retreat, the
       loading track with its percentage, and two provisional labels. The percentage climbs in steps with pauses; when
       it is full the whole bar slides to the top and turns into the real header of the site: the name cell goes
       light, the fill wipes out to the right, the labels flip to the local time and to the real links, the menu
       button slides in, and the dark backdrop pulls down to uncover the page. -->

  <main class="pagina" data-pagina aria-hidden="true">
    <span class="filo-pagina" data-filo-pagina></span>
    <section class="eroe">
      <p class="eroe__occhiello" data-sale><span>Orsa Valley</span><span>14&ndash;16 May</span><span class="eroe__posti">40 seats</span></p>
      <h1 class="eroe__titolo">
        <span class="riga"><span data-sale>Slowform</span></span>
        <span class="riga"><span data-sale>Retreat</span></span>
      </h1>
      <p class="eroe__frase" data-sale>Three slow days for people who draw letters and interfaces.</p>
    </section>
  </main>

  <div class="velo" data-velo aria-hidden="true"></div>

  <header class="barra" data-barra role="progressbar" aria-label="Loading" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
    <a class="cella cella--marchio" href="#" data-cella="marchio" aria-label="Slowform Retreat, home">
      <svg class="segno" viewBox="0 0 24 24" aria-hidden="true">
        <path d="M4 12a8 8 0 0 1 8-8h0v8z" />
        <path d="M20 12a8 8 0 0 1-8 8h0v-8z" />
        <rect x="14" y="4" width="6" height="6" rx="1" />
      </svg>
      <span class="parole"><span class="riga-t" data-parole>Slowform</span><span class="riga-t" data-parole>Retreat</span></span>
    </a>

    <div class="cella cella--pista" data-cella="pista">
      <span class="pista__riempi" data-riempi aria-hidden="true"></span>
      <span class="pista__filo" data-filo aria-hidden="true"></span>
      <span class="pista__testo" data-strato="chiaro">
        <span class="giro"><span class="giro__in" data-giro><span class="faccia" data-parole>Loading</span><span class="faccia" data-luogo>Orsa</span></span></span>
        <span class="giro"><span class="giro__in" data-giro><span class="faccia cifre" data-parole><span data-cifra>0</span>%</span><span class="faccia cifre" data-ora>09:41 GMT+1</span></span></span>
      </span>
      <span class="pista__testo pista__testo--scuro" data-strato="scuro" aria-hidden="true">
        <span class="giro"><span class="giro__in" data-giro><span class="faccia">Loading</span><span class="faccia" data-luogo>Orsa</span></span></span>
        <span class="giro"><span class="giro__in" data-giro><span class="faccia cifre"><span data-cifra>0</span>%</span><span class="faccia cifre" data-ora>09:41 GMT+1</span></span></span>
      </span>
    </div>

    <a class="cella cella--voce" href="#" data-cella="voce">
      <span class="giro"><span class="giro__in" data-giro><span class="faccia" data-parole>Workshops</span><span class="faccia">Program</span></span></span>
    </a>

    <a class="cella cella--voce cella--ultima" href="#" data-cella="voce">
      <span class="giro"><span class="giro__in" data-giro><span class="faccia" data-parole>Slow days</span><span class="faccia">About</span></span></span>
      <span class="menu" data-menu aria-hidden="true">
        <span class="menu__in" data-menu-in>
          <svg viewBox="0 0 20 20"><path d="M4 7.5h12M4 12.5h12" /></svg>
        </span>
      </span>
    </a>
  </header>

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

40 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 “Loader to header” 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 screen is dark, almost forest black. In the middle a bar of four cells opens from the centre outwards, as wide as the grid of a site: the mark and the name «Slowform Retreat», the loading track, «Workshops» and «Slow days». Each word arrives under an orange block that grows from the left, covers it, leaves it written and leaves to the right, one word after another. The track fills with orange and the percentage climbs in steps, in tabular figures, pausing at 15% and 50% like a real loader; a thread of light runs along the edge of the fill, and wherever the orange passes the type turns dark. At 100% it holds for a moment, then the whole bar slides to the top and becomes the header: the name cell turns paper-coloured with dark type, the track almost black, the links moss and forest green; the fill wipes out to the right, the labels flip one after another («Loading» and the percentage become «Orsa» and the local time, with its offset from Greenwich; the links become Program and About), the orange menu button slides in from the right and the dark backdrop pulls down. Underneath is the page: a hairline drawing itself under the header, the place, the dates and the seats, the big headline rising from its masks and one sentence. On hover the links widen along the type’s width axis and the cell brightens, the mark turns a quarter and the two lines of the menu open. After a few seconds the backdrop comes back up, the bar closes towards the centre and the loader starts again.

How it works

A single bar

The bar is the header from the start: a four-column grid (25.625, 24.375, 24.375 and 25.625) as tall as the header, pushed to the middle of the screen with translateY(calc((1 − --d) × (50vh − height / 2))). GSAP takes --d from 0 to 1: the bar slides to the top and stays there, with nothing to swap.

The opening and the words

The bar opens from the centre with a clip-path of inset(0 calc((1 − --o) × 50%)), --o from 0 to 1, in 0.56 seconds. Each word has an orange block that goes from scaleX 0 to 1 from the left in 0.32 seconds, the word appears, the block waits 0.09 and goes to 0 towards the right in 0.38, with cubic-bezier(.86, 0, .07, 1) and 0.055 seconds between words.

Loading in steps

A time from 0 to 1 over LOAD_TIME seconds goes through an eight-point curve, with a smoothstep between points: the pauses are the almost flat stretches (15 to 16%, 50 to 53%). The value goes into --p, which crops the fill and a second, dark copy of the type with the same clip-path: wherever the orange is, the type is dark.

The climb

After HOLD_FULL seconds at 100% the climb of DOCK_TIME seconds starts with cubic-bezier(.76, 0, .24, 1): the cells change colour, the fill wipes out to the right in 70% of the time, the labels flip FLIP_DELAY seconds later (two faces in a window one line tall, yPercent −50), the menu arrives at 45% and the dark backdrop pulls down from 35% in REVEAL_TIME seconds.

The local time

Intl.DateTimeFormat writes the time in the TIME_ZONE zone, and the offset from Greenwich comes from timeZoneName: "shortOffset"; it updates once a second in the GSAP ticker.

Values to change

NameFileDefaultWhat it changes
LOAD_TIMEscript.js3.2How long the loader takes from 0 to 100%, in seconds.
HOLD_FULLscript.js0.34How long it holds at 100% before climbing, in seconds.
DOCK_TIMEscript.js0.9How long the bar takes to climb to the top, in seconds.
REVEAL_TIMEscript.js0.82How long the dark backdrop takes to pull down, in seconds.
WORD_GAPscript.js0.055The time between one word and the next as they arrive under the colour block, in seconds.
FLIP_DELAYscript.js0.18How long the labels wait to flip after the bar starts climbing, in seconds.
PAUSEscript.js2.6How long the page stays uncovered before starting again, in seconds.
PLACEscript.js"Orsa"The name of the place next to the time.
TIME_ZONEscript.js"Europe/Rome"The time zone of the time shown in the header.
--accentostyle.css#ff9a4dThe only colour: the fill, the word blocks and the menu.
--nottestyle.css#0d1513The dark backdrop of the loader.
--cartastyle.css#f2efe6The page and the name cell once the header is ready.

Try them in the Playground

When to use it

For the first visit to the site of an event, a festival, a conference or a studio, when the loader should not be an obstacle to throw away but become the header that stays: whoever waits already reads the name and the links, and at the end nothing disappears, it just moves into place.

On phones

The same animation with adapted sizes: the four cells stay in a row, the bar is at least 48 pixels tall, the track puts the label on top and the figure or the time below, and the headline is sized on both the width and the height of the screen.

With reduced motion

No climbing loader: the header is already at the top with its colours, the time and the real links, the page already uncovered, and they simply fade in.

Pitfalls

  • The dark type over the orange is a second copy of the type, cropped with the same clip-path as the fill: a single value, --p, moves both, so they never drift apart.
  • The flipping faces must share the font size of their window: with smaller digits only inside the face, the second face peeked out below the first. The smaller size goes on the whole window.
  • A bar measured in vh moves on its own when the window changes height, even halfway through the climb: no pixel values to recompute on resize.
  • CSS cubic-bezier curves in GSAP without CustomEase: a small function that inverts x by bisection and returns y.
  • The clock updates in the GSAP ticker rather than with setInterval, so the whole choreography stays on a single clock.
  • Do not let GSAP blend two clip-paths: the browser rewrites inset(0% 50% 0% 50%) in its short form and the opening started from the left instead of the centre. The clip-path lives in the CSS with a variable, and GSAP only moves the variable.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 7.1 KB; the libraries: GSAP 28 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