Skip to content
animorio
IT
Back to the library

Plane window transition

Transitions, ImagesGSAP, CSS onlyMediumCompressed weight: Demo 6.7 KBGSAP 28 KBFreeDownload the zip

The opening of Saltway, a made-up travel site, on light paper: an aeroplane window with its plastic bezel, the glass and the shade pulled down. The lip dips a hair, the shade lifts, hits the top and drops back a breath; behind it there is a real beach seen from above. A glint slides across the glass, then the window opens: the cut-out of the glass grows to the whole page while the bezel flies past and fades, and the photo becomes the hero, with the destination name rising letter by letter, the flight time and «Book your seat». Then everything goes back into the window and the shade comes down again.

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>
<!--
  "Plane window 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>Window to the destination</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 opening of a made-up travel site, Saltway: an aeroplane window on light paper, the shade lifts on a real
       photo of the destination, then the window opens up to the whole page and the photo becomes the hero -->
  <main class="stage" data-stage>
    <header class="top" data-top>
      <p class="brand">
        <svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true"><path d="M2 11.5 18 5.5 13.5 17 10.6 12.4Z" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/><path d="M10.6 12.4 18 5.5" fill="none" stroke="currentColor" stroke-width="1.5"/></svg>
        Saltway
      </p>
      <p class="top__nav">Flights <span>Stays</span> <span>Guides</span></p>
    </header>

    <!-- the destination: one full-page photo, clipped to the glass of the window until it opens -->
    <section class="hero" data-hero aria-label="Isla Clara">
      <img class="hero__photo" data-photo src="spiaggia.webp" width="1024" height="576" alt="A white sand beach seen from above, with a row of palms, a road and turquoise water">
      <span class="hero__grain" aria-hidden="true"></span>
      <span class="hero__shade" aria-hidden="true"></span>
      <div class="dest" data-dest>
        <p class="dest__kicker" data-kicker>Now boarding · 2h 40m</p>
        <h1 class="dest__title" data-title>Isla Clara</h1>
        <a class="pill" href="#" data-pill>
          <span class="pill__bg" aria-hidden="true"></span>
          <span class="pill__text">Book your seat</span>
          <svg class="pill__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9.5M8.5 4l4 4-4 4" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>
        </a>
      </div>
    </section>

    <!-- the window: plastic bezel, inner frame and the place of the glass (the photo above is clipped to it) -->
    <div class="win" data-win aria-hidden="true">
      <div class="win__bezel" data-bezel>
        <div class="win__frame">
          <div class="win__glass" data-glass></div>
        </div>
      </div>
      <p class="win__seat" data-seat>Window seat <b>14A</b></p>
    </div>

    <!-- on top of the photo, laid exactly on the glass: the glint and the shade -->
    <div class="pane" data-pane aria-hidden="true">
      <span class="win__glint" data-glint></span>
      <div class="win__shade" data-shade>
        <span class="win__ribs"></span>
        <span class="win__lip" data-lip></span>
      </div>
    </div>
  </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.

27 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 “Plane window 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

At the top Saltway and Flights, Stays, Guides. In the middle an aeroplane window on light paper: the plastic bezel, the inner frame and the glass with the shade pulled down, finely ribbed and with its lip; below it, Window seat 14A. The lip dips 3 pixels, the shade lifts in one second, hits the top and drops back 5% before it stops: behind it there is a white beach seen from above, with palms, the road and turquoise water. A glint slides across the glass. Then the cut-out of the glass grows to the whole page in 1.35 seconds, the photo goes from 1.16 to 1 and settles on a small spring, the bezel grows and fades, the header turns white. «Now boarding · 2h 40m» rises, then the name Isla Clara letter by letter from its mask, and the «Book your seat» pill. After a few seconds the letters leave upwards, the cut-out goes back into the window, the bezel returns and the shade comes down again.

How it works

One photo only

There is a single full-page photo under the window: the glass is transparent and the photo is clipped with a clip-path inset(… round …) matching the edges and radius of the glass. So when the window opens nothing swaps: only the cut-out grows.

The measured cut-out

The four distances of the glass from the edges and its radius come from getBoundingClientRect; a number p goes from 0 (the window) to 1 (the page) and every value of the clip is multiplied by 1 − p. On resize everything is measured again, with the bezel briefly set back to scale 1, and p is reapplied: even halfway open the clip stays right.

The shade

The shade lives inside the glass (overflow hidden) and lifts with yPercent to −100: first a 3-pixel press, then the lift in power3.inOut, the bounce to −95 and back with back.out.

The opening

In 1.35 seconds p goes to 1 with expo.inOut, the photo goes from 1.16 to 1, the bezel grows to 1.55 and fades, the header turns white and a dark veil rises at the edges so the text reads. At the end the photo does a small spring, 1.012 and back.

The name

The name is split into letters, each in its own mask (overflow hidden), rising from yPercent 112 to 0 with back.out(1.35), 0.045 seconds apart; the pill arrives with elastic.out. On the way back they leave upwards and the cut-out closes into the window.

The loop

The bezel entrance runs once, then the looping timeline starts: at the end of each loop everything is as it was, window closed and shade down, so there is no jump.

Values to change

NameFileDefaultWhat it changes
SPEEDscript.js1The speed of everything.
SHADE_TIMEscript.js1Seconds for the shade to lift.
OPEN_TIMEscript.js1.35Seconds for the window to open to the whole page.
ZOOMscript.js1.16How much the photo is zoomed while seen through the window.
PANscript.js0How far the photo is shifted while seen through the window, in percent, to frame the shoreline.
HOLDscript.js2.6Seconds the hero stays before going back into the window.
DESTscript.js"Isla Clara"The destination name.
KICKERscript.js"Now boarding · 2h 40m"The line above the name.

Try them in the Playground

When to use it

For the opening of a travel site, an airline, a hotel or a guide: you enter the page the way you look out of the window, and the destination becomes the hero.

On phones

The window is sized on both height and width (min of vh and vw), so it fits the phone box; the name scales down with clamp and min(vw, vh), and the top menu keeps only Flights.

With reduced motion

No lifting shade, no growing cut-out and no rising letters: the hero with the photo, the name and the button is already in place and fades in.

Pitfalls

  • One photo under the window, not two (one in the glass and one full-page): with two photos the swap shows a jump in framing.
  • The clip is in pixels: measure again on resize, even halfway open, with the bezel set back to scale 1 to measure the real glass.
  • Keep the bezel entrance out of the loop: inside it, every loop would start the bezel from transparent and flash.
  • No mix-blend-mode inside an element clipped with clip-path: in Chrome the blended layer (the grain here) escapes the clip and leaves a light rectangle over the bezel; the grain stays in normal blending, very light.

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 6.7 KB; the libraries: GSAP 28 KB.

Testing

Tested on 2 December 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