Skip to content
animorio
IT
Back to the library

Talk night transition

TransitionsGSAP, CSS onlyAdvancedCompressed weight: Demo 12 KBGSAP 28 KBFreeDownload the zip

The page change of the site of a made-up series of talk nights, Kestrel Nights: five nights in a list, each with its date tile filled with colour (vermilion, cobalt, pine, violet, rust). Choose a row and the tile grows to cover the screen: three corners travel on one curve and the fourth follows them on a spring, so the shape stretches like a sheet pulled by a corner and snaps into place. Then the bottom edge rises and the shape becomes the header of the night's page, with a soft light and a shadow under it; the row's title flies into the header and grows on the wdth axis, and the times, the line, the speakers, the seats left and Get tickets come in. Back folds the header into its row, corner and all.

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>
<!--
  "Talk night 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 talk night row that stretches into its page</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 list of nights of a made-up series of evening talks. Every row has a filled date tile in its own colour:
         choose one and the tile grows to cover the screen, one corner stretching behind on a spring, then it settles
         into the header of the night's page; Back folds it into its row again -->
    <section class="list" data-list>
      <header class="bar">
        <span class="brand">
          <svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true">
            <path d="M2 2h9a7 7 0 0 1 7 7v0H9a7 7 0 0 1-7-7z"/>
            <rect x="2" y="11" width="7" height="7" rx="2"/>
          </svg>
          <span class="brand__name">Kestrel Nights</span>
        </span>
        <span class="bar__season">Autumn season</span>
      </header>
      <div class="list__head">
        <h1 class="list__title">Upcoming nights</h1>
        <p class="list__count">Five evenings of short talks</p>
      </div>
      <ul class="rows" data-rows></ul>
    </section>

    <svg class="shape" data-shape aria-hidden="true">
      <defs>
        <radialGradient id="luce" gradientUnits="userSpaceOnUse" cx="0" cy="0" r="600" data-luce>
          <stop offset="0" stop-color="#fff" stop-opacity="0.26"/>
          <stop offset="0.55" stop-color="#fff" stop-opacity="0.06"/>
          <stop offset="1" stop-color="#fff" stop-opacity="0"/>
        </radialGradient>
        <linearGradient id="fondo" x1="0" y1="0" x2="0" y2="1">
          <stop offset="0" stop-color="#000" stop-opacity="0"/>
          <stop offset="1" stop-color="#000" stop-opacity="0.16"/>
        </linearGradient>
        <filter id="morbida" x="-10%" y="-10%" width="120%" height="140%">
          <feGaussianBlur stdDeviation="16"/>
        </filter>
      </defs>
      <path class="shape__shadow" data-ombra/>
      <path class="shape__fill" data-fill/>
      <path class="shape__shade" data-shade fill="url(#fondo)"/>
      <path class="shape__light" data-light fill="url(#luce)"/>
    </svg>

    <section class="night" data-night aria-hidden="true">
      <div class="night__head" data-head>
        <div class="night__top">
          <button class="back" type="button" data-back>
            <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M9.8 3.6L5.4 8l4.4 4.4"/></svg>
            <span>Back</span>
          </button>
          <span class="night__brand" data-uno>Kestrel Nights</span>
        </div>
        <div class="night__bottom">
          <p class="night__meta" data-uno><span data-when></span><span class="night__sep" aria-hidden="true"></span><span data-where></span></p>
          <h2 class="night__title" data-title></h2>
        </div>
      </div>
      <div class="night__body" data-body>
        <p class="night__times" data-due><span>Doors 19:00</span><span>Talks 19:30</span><span data-room></span></p>
        <p class="night__line" data-due data-line></p>
        <div class="night__people" data-due>
          <span class="faces" data-faces></span>
          <span class="night__names" data-names></span>
        </div>
        <div class="night__seats" data-due>
          <span class="seats__track"><span class="seats__fill" data-fill-seats></span></span>
          <span class="seats__words" data-seats></span>
        </div>
        <div class="night__actions" data-due>
          <button class="ticket" type="button" data-ticket>
            <span class="ticket__face" data-ticket-face>
              <span class="ticket__words" data-ticket-words>Get tickets</span>
              <span class="ticket__price" data-price></span>
              <svg class="ticket__icon" viewBox="0 0 16 16" aria-hidden="true">
                <path class="ticket__arrow" data-arrow d="M3 8h9M8.5 4.2L12.3 8 8.5 11.8"/>
                <path class="ticket__check" data-check pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"/>
              </svg>
            </span>
          </button>
        </div>
      </div>
    </section>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true">
      <path d="M5 3.2l13.2 8.1-5.9 1.2-3.1 5.4z"/>
    </svg>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

28 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 “Talk night 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 white page with grain, the Kestrel Nights mark and «Autumn season» at the top, the title «Upcoming nights» and five rows split by hairlines: on the left the date tile filled with colour, with a highlight at the top and a shadow of its own colour, the talk title, the day and the city, a chevron on the right. On hover a white plate with a soft shadow rises under the row and the chevron slides two pixels; on press the tile gives a little. Choose the row and the tile becomes a shape drawn in SVG that grows over the whole screen: three corners follow the same curve, the fourth is tied to a spring and lags behind, so the shape stretches askew and then snaps into place. Once the screen is covered, the bottom edge rises to a little past halfway and there the shape bounces a few pixels and settles: it is the page header, with a soft light drifting slowly, the colour darkening towards the bottom and a blurred shadow on the page. Meanwhile the row's title flies into the header, growing, turning white and widening on the wdth axis from 100 to 125; then Back and the mark, the date and the place, and below, one after the other, the times, the line of the night, three abstract avatars with names, the seats left bar filling up and the Get tickets button with the price. On the button the words widen and the pill swells; on click it gives, the arrow leaves, «Two seats held» arrives with a check drawing itself and the seats drop by two. Back folds the header into its row's tile, with the other corner on the spring, the title goes back into the row and the list comes close again. Left alone, a drawn pointer opens three nights in different colours.

How it works

A shape with four corners

The shape is an SVG path as big as the page, redrawn every frame from four corners with the rounding made of quadratic curves. GSAP only animates a rectangle (x0, y0, x1, y1 and the two radii): it starts from the tile measured with getBoundingClientRect and goes to the whole screen in 0.8 s on power3.inOut.

The corner on a spring

One of the four corners does not go where the rectangle says: it chases it on a spring (stiffness 190, damping 15, four steps of maths per frame). On the way it lags and the shape stretches askew; when the rectangle stops, the corner catches it, passes it by a few pixels and comes back. Even and odd rows use different corners, both ways.

From screen to header

Once the screen is covered, the list underneath goes out and the rectangle's bottom edge rises to 54% of the height in 0.75 s on power3.out, the two bottom corners rounding to 26 px. The bounce you see is the spring's. Over the shape a radial gradient in soft-light drifts slowly, under it a blurred copy of the path makes the shadow.

The title that flies and widens

The header title is measured in place at wdth 125, then laid over the row's title with translate and scale (FLIP) at wdth 100. It goes back to its place in a little over a second; the wdth climbs to 125 on back.out and the colour turns from black to white as the shape arrives under it. Its size is computed so it fits on one line at any width.

The way back

Back measures the tile where it will be once the list is still, sends the contents out bottom first, brings the rectangle back onto the tile in 0.85 s with the other corner on a (stiffer) spring and the title into the row at wdth 100. When the corner has arrived the shape fades out over the real tile.

Values to change

NameFileDefaultWhat it changes
FLIGHTscript.js0.8Seconds the tile takes to grow over the whole screen.
SETTLEscript.js0.75Seconds the shape takes to rise from the whole screen to the header.
RETURNscript.js0.85Seconds Back takes to fold the header into its row.
HEADERscript.js0.54The height of the header, as a share of the screen.
STRETCHscript.js1How far the corner on the spring lags: 0 no stretch, 2 twice as far.
STIFFNESSscript.js190The corner's spring: higher is quicker.
DAMPINGscript.js15Lower lets the corner pass the mark and come back.
WIDTH_TOscript.js125The wdth the title widens to in the header (75 to 125).
HOLDscript.js1.6Seconds the autopilot stays on a night.
LOOPscript.jstrueLeft alone, it opens the nights again and again.

Try them in the Playground

When to use it

For the site of a series of events, talks, concerts, courses or tastings: when the list of dates leads into the page of one date, and every date has its own colour. It also suits a portfolio with projects in a list or the products of a shop with a colour each.

On phones

The same transition with adapted sizes: tiles and titles are sized on width and height, the header is a little lower on short screens and the title shrinks just enough to fit on one line. Nights open with a finger.

With reduced motion

No movement: the header fades in already in place, the list fades out and the page contents appear together; Back does the same in reverse. The button turns to «Two seats held» without moving.

Pitfalls

  • The shape cannot be a div with border-radius: a corner on a spring needs four free points. The path is redrawn every frame only while the shape is showing.
  • The spring has to be computed in several steps per frame: with one step and a high stiffness a slow frame makes it blow up.
  • The tile must be measured at rest: if the click has just squeezed it with the CSS transition, getBoundingClientRect returns a smaller tile. Here the transition is switched off for a moment before measuring.
  • The header title has to be measured at its final wdth, with white-space nowrap: if it wrapped, it would change lines while widening in flight.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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