Skip to content
animorio
IT
Back to the library

Seat map transition

Transitions, HoverGSAP, CSS onlyMediumCompressed weight: Demo 9.1 KBGSAP 28 KBFreeDownload the zip

The flight results of Tarnwick Air, a made-up airline: three flights from Lisbon to Oslo. Touch a flight and its row lifts and slides up to become the header of the next page, while the search and the other flights step away; the airline mark turns into the back arrow, the outline of the cabin draws itself with its nose and wings, and the seats arrive row by row on a spring. Pick a seat: it presses in, fills with orange, a tick draws itself and the bar with the seat, its kind and its price rises from below. Back folds the page into the row 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>
<!--
  "Seat map 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>The transition from the chosen flight to the cabin seat map</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>
  <main class="stage" data-stage>
    <!-- the flight results of a made-up airline, Tarnwick Air. Touch a flight: its row lifts and slides up to become the
         header of the next page, the airline mark turns into the back arrow, the outline of the cabin draws itself and
         the seats arrive row by row. Pick a seat and the bar with the price rises; back, everything folds into the list -->
    <section class="app" data-app aria-label="Tarnwick Air flights">

      <div class="list" data-list>
        <header class="top" data-top>
          <span class="brand">
            <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M3.5 14.5 20.5 7l-3.2 8.4-4.6-2.1-3.6 4.7-.6-5.2Z"/></svg>
            <span class="brand__name">Tarnwick</span>
          </span>
          <span class="search">
            <span class="search__route">LIS<svg viewBox="0 0 16 8" aria-hidden="true"><path d="M1 4h13M10.5 1 14 4l-3.5 3"/></svg>OSL</span>
            <span class="search__meta">Thu 19 Nov · 1 adult</span>
          </span>
        </header>
        <div class="days" data-days aria-label="Nearby days">
          <span class="day"><span class="day__d">Tue 17</span><span class="day__p">€112</span></span>
          <span class="day"><span class="day__d">Wed 18</span><span class="day__p">€97</span></span>
          <span class="day is-now"><span class="day__d">Thu 19</span><span class="day__p">€89</span></span>
          <span class="day"><span class="day__d">Fri 20</span><span class="day__p">€134</span></span>
          <span class="day"><span class="day__d">Sat 21</span><span class="day__p">€101</span></span>
        </div>
        <p class="count" data-count>3 flights · cheapest first</p>
        <ul class="rows" data-rows>
          <li class="rows__item"><button class="row" type="button" data-row="0">
            <span class="logo" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M3.5 14.5 20.5 7l-3.2 8.4-4.6-2.1-3.6 4.7-.6-5.2Z"/></svg></span>
            <span class="row__times"><b>06:40</b><svg viewBox="0 0 22 8" aria-hidden="true"><path d="M1 4h20"/><circle cx="11" cy="4" r="1.6"/></svg><b>11:15</b></span>
            <span class="row__meta">4h 35m · 1 stop, Paris</span>
            <span class="row__price">€89</span>
          </button></li>
          <li class="rows__item"><button class="row" type="button" data-row="1">
            <span class="logo" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M3.5 14.5 20.5 7l-3.2 8.4-4.6-2.1-3.6 4.7-.6-5.2Z"/></svg></span>
            <span class="row__times"><b>09:05</b><svg viewBox="0 0 22 8" aria-hidden="true"><path d="M1 4h20"/></svg><b>13:50</b></span>
            <span class="row__meta">3h 45m · Direct</span>
            <span class="row__price">€126</span>
          </button></li>
          <li class="rows__item"><button class="row" type="button" data-row="2">
            <span class="logo" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M3.5 14.5 20.5 7l-3.2 8.4-4.6-2.1-3.6 4.7-.6-5.2Z"/></svg></span>
            <span class="row__times"><b>17:20</b><svg viewBox="0 0 22 8" aria-hidden="true"><path d="M1 4h20"/></svg><b>22:05</b></span>
            <span class="row__meta">3h 45m · Direct</span>
            <span class="row__price">€141</span>
          </button></li>
        </ul>
        <p class="note" data-note><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 5.5h10v7H3zM6 5.5V4h4v1.5"/></svg>Prices per person, taxes and a cabin bag included</p>
      </div>

      <div class="seatview" data-seatview aria-hidden="true">
        <div class="hdr" data-hdr>
          <button class="back" type="button" data-back aria-label="Back to flights">
            <span class="logo logo--hdr" data-hdr-logo aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M3.5 14.5 20.5 7l-3.2 8.4-4.6-2.1-3.6 4.7-.6-5.2Z"/></svg></span>
            <span class="back__arrow" data-hdr-arrow aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M14.5 6 8.5 12l6 6"/></svg></span>
          </button>
          <span class="row__times"><b data-hdr-dep>09:05</b><svg viewBox="0 0 22 8" aria-hidden="true"><path d="M1 4h20"/></svg><b data-hdr-arr>13:50</b></span>
          <span class="row__meta" data-hdr-meta>3h 45m · Direct</span>
          <span class="row__price" data-hdr-price>€126</span>
        </div>
        <p class="pick" data-pick>Choose your seat</p>
        <div class="cabin" data-cabin>
          <svg class="hull" data-hull aria-hidden="true"><path data-hull-path pathLength="1"/><path class="wing" data-wing-l pathLength="1"/><path class="wing" data-wing-r pathLength="1"/></svg>
          <div class="grid" data-grid role="group" aria-label="Seat map"></div>
        </div>
        <div class="legend" data-legend aria-hidden="true">
          <span><i class="dot dot--free"></i>Free</span>
          <span><i class="dot dot--room"></i>Extra legroom</span>
          <span><i class="dot dot--taken"></i>Taken</span>
        </div>
        <div class="bar" data-bar>
          <span class="bar__seat"><span class="bar__label">Seat</span><b data-seat-name>14C</b><span class="bar__kind" data-seat-kind>Aisle · €9</span></span>
          <button class="go" type="button" data-go><span class="go__in">Continue<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9.5M9 4.5 12.5 8 9 11.5"/></svg></span></button>
        </div>
      </div>
    </section>

    <svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true"><path d="M5 2.8v16.4l4.2-4 2.8 6.2 2.9-1.3-2.8-6.1h5.9Z"/></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.

58 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 “Seat map 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

On a warm grey sits the Tarnwick Air app: the mark, the search pill (Lisbon to Oslo, Thursday 19 November, one adult) and three flights with times, duration, stops and price. Touch a flight: its row lifts and rises to the top, with a hair of bounce, to become the header of the seat page, while the search rises and fades and the other flights drop away. In the header the airline mark turns and goes out, and the back arrow turns in to take its place. Below, the outline of the cabin draws itself, with the round nose at the top, then the two wings appear at the exit row; the column letters and row numbers light up and the seats arrive row by row on a spring. Taken seats are grey, the exit row seats are blue with extra legroom. Touch a seat: it presses in and springs back, fills with orange and its tick draws itself; from below rises the dark bar with the seat, window, aisle or middle, the price and the Continue button. Changing seat, the old one goes out and the bar text slides back in from below. The arrow folds everything away: the seats leave from the last row, the cabin erases itself, the header goes back down into its row and the other flights come back.

How it works

The row and the header share every measure

The flight row and the header of the seat page use the same CSS rule: same height, same grid, same slot for the mark. So on opening the row hides and the header starts exactly on top of it: measure both positions with getBoundingClientRect, move the header by the difference and let it return to zero with a back.out.

The cabin draws itself

The outline of the cabin is an SVG path built in pixels around the seat grid, with two curves for the nose. With pathLength="1" the stroke-dasharray and stroke-dashoffset go from 1 to 0 at any size. The wings are two wide strokes at the exit row.

The seats arrive in rows

The seats are buttons in a seven-column CSS grid (three seats, the aisle with the row number, three seats); a seat’s size is a variable worked out from the free space. GSAP brings them in with a grid stagger on the vertical axis, so they arrive row by row, and on closing they leave from the last one.

Picking a seat

The chosen seat gets a class that fills it with orange; its inside presses in and springs back with a back.out and the tick, a path with pathLength=1, draws itself. The price bar rises the first time; afterwards only its text changes, sliding back in from below.

Values to change

NameFileDefaultWhat it changes
OPEN_TIMEscript.js0.8Seconds for the row to slide up and become the header.
SPRINGscript.js1How much the header overshoots before it settles (0 = not at all).
SEAT_STAGGERscript.js0.045Seconds between one row of seats and the next.
HULL_TIMEscript.js0.8Seconds for the outline of the cabin to draw itself.
CLOSE_SPEEDscript.js1.4How much faster it folds back than it opens.
IDLEscript.js4Seconds before the pointer plays by itself again.
LOOPscript.jstrueLeft alone, it opens a flight, picks two seats and goes back, again and again.

Try them in the Playground

When to use it

For a flight, train, ferry, cinema or theatre app or site: anywhere a row of a list leads to a detail page with a map to touch. The row that becomes the header works for any list that opens a page (orders, bookings, messages).

On phones

The same transition with adapted sizes: the app is min(420px, 92vw) by min(560px, 88vh), the rows clamp(54px, 13vmin, 68px), and the seat size is worked out again from the free space, also when the window changes with the seat page open.

With reduced motion

No flying row and no bouncing seats: the list fades out and the seat page fades in, already drawn; the chosen seat lights up without pressing in. The drawn pointer does not move: the actions just happen.

Pitfalls

  • The row and the header must match to the pixel, or a jump shows at the swap: they share the same CSS rule.
  • The row’s position is measured again on closing, because the window may have changed in the meantime.
  • The cabin outline is in pixels: it is rebuilt on every resize, after the seat size has been worked out again.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 9.1 KB; the libraries: GSAP 28 KB.

Testing

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