Skip to content
animorio
IT
Back to the library

Lesson to player transition

Transitions, HoverGSAP, CSS onlyAdvancedCompressed weight: Demo 14 KBGSAP 28 KBFreeDownload the zip

The lesson list of a made-up online course, Motion for Product Design by Tempo School, in the premium style of Dribbble shots: five lessons with a drawn thumbnail, the title, the length and the state. Tapping one the row lifts into a white card and the card becomes the lesson screen: the thumbnail grows into the player, title and length fly to their places on a curve, the rest of the list steps back, up above the row and down below it, the nearest first. The lesson starts: the drawing in the player moves, the scrubber with its chapters runs, the chapter being played lights up. Back brings everything home into the row, which lands in its slot with the time watched already on its bar and its ring.

The code

A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN.

<!doctype html>
<!--
  "Lesson to player 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>Tempo School: Motion for Product Design</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 lesson list of a made-up online course, Motion for Product Design by Tempo School. Tap a lesson: its row
         lifts, the thumbnail grows into the player, the title and the length fly to their places, the rest of the list
         steps back above and below, and the lesson starts. Back flies everything home and the row lands in its slot,
         with the time you watched already on its bar -->
    <div class="glow" aria-hidden="true"></div>
    <div class="grain" aria-hidden="true"></div>

    <section class="app" data-app aria-label="Tempo School app">
      <div class="status" aria-hidden="true">
        <span class="status__time">9:41</span>
        <span class="status__icons">
          <svg viewBox="0 0 18 12"><rect x="0.5" y="7.5" width="3" height="4" rx="0.9"/><rect x="5" y="5.2" width="3" height="6.3" rx="0.9"/><rect x="9.5" y="2.8" width="3" height="8.7" rx="0.9"/><rect x="14" y="0.5" width="3" height="11" rx="0.9" opacity=".3"/></svg>
          <svg viewBox="0 0 26 12"><rect x="0.6" y="0.6" width="21.8" height="10.8" rx="3.4" fill="none" stroke="currentColor" stroke-opacity=".4" stroke-width="1.1"/><rect x="2.4" y="2.4" width="14.4" height="7.2" rx="2"/><path d="M24 4.2v3.6" stroke="currentColor" stroke-opacity=".4" stroke-width="1.4" stroke-linecap="round"/></svg>
        </span>
      </div>

      <div class="list" data-list>
        <header class="head" data-head>
          <p class="eyebrow">
            <svg class="mark" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6.2"/><path d="M8 4.4V8l2.6 1.6"/></svg>
            Tempo School
          </p>
          <h1 class="head__title">Motion for Product Design</h1>
          <p class="head__meta"><span>Easing and springs</span><span class="sep">·</span><span data-done>2 of 5 done</span></p>
          <div class="course-bar" data-course-bar aria-hidden="true"></div>
        </header>
        <div class="rows" data-rows role="list"></div>
      </div>

      <div class="detail" data-detail aria-hidden="true">
        <div class="sheet" data-sheet aria-hidden="true"></div>
        <div class="detail__in">
          <div class="bar" data-in>
            <button class="back" type="button" data-back>
              <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M9.8 3.6 5.4 8l4.4 4.4"/></svg>
              <span>Back</span>
            </button>
            <span class="bar__label" data-chip>Easing and springs</span>
            <button class="round" type="button" aria-label="Save for offline">
              <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 2.8v7.4M4.9 7.4 8 10.4l3.1-3"/><path d="M3.2 12.8h9.6"/></svg>
            </button>
          </div>

          <div class="slot" data-slot>
            <div class="media" data-media>
              <span class="media__paint" aria-hidden="true"></span>
              <span class="media__art" data-art aria-hidden="true"></span>
              <span class="media__scrim" data-ctl aria-hidden="true"></span>
              <button class="play" type="button" data-play aria-label="Pause">
                <svg class="play__p" viewBox="0 0 16 16" aria-hidden="true"><path d="M5.4 3.4v9.2L12.6 8z"/></svg>
                <svg class="play__s" viewBox="0 0 16 16" aria-hidden="true"><rect x="4.2" y="3.4" width="2.7" height="9.2" rx="0.9"/><rect x="9.1" y="3.4" width="2.7" height="9.2" rx="0.9"/></svg>
              </button>
              <span class="tc" data-ctl aria-hidden="true"><span data-now>0:00</span><span data-total>0:00</span></span>
              <span class="track" data-track aria-hidden="true"></span>
              <span class="media__sheen" data-sheen aria-hidden="true"></span>
            </div>
          </div>

          <h2 class="title" data-d="title">Lesson</h2>
          <p class="meta">
            <svg data-in viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5.8"/><path d="M8 4.9V8l2.1 1.4"/></svg>
            <span class="meta__len" data-d="len">0:00</span>
            <span class="meta__rest" data-in>with Noor Haddad <span class="sep">·</span> Notes included</span>
          </p>

          <div class="chapters" data-in>
            <p class="chapters__label">In this lesson</p>
            <div class="chapters__list" data-chapters role="list">
              <span class="chapters__hi" data-hi aria-hidden="true"></span>
            </div>
          </div>

          <button class="done" type="button" data-in data-complete>
            <svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6.2"/><path d="M5.3 8.2 7.2 10l3.5-3.8" pathLength="1"/></svg>
            <span>Mark as complete</span>
          </button>
        </div>
      </div>
    </section>
    <p class="sr" data-live aria-live="polite"></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.

35 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 “Lesson to player 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 background with fine grain and a soft purple light, the Tempo School app in the middle as on a phone: the time and battery at the top, the mark, the course title Motion for Product Design, the Easing and springs section with 2 of 5 done and a bar split in five pieces, one per lesson. Below, five rows: every lesson has a dark thumbnail in its own colour, a thin graph-paper grid and a small white drawing (three hopping squares, spacing ticks, a Bézier curve with its handles, a damped spring wave, four bars coming in staggered), the bar of the time watched with its chapters, the title, the length and the state: a tick in a black disc for the finished ones, a purple ring telling how much is left for the one in progress, an empty ring for the rest. Under the mouse the row becomes a white card with a soft shadow, the thumbnail rises a pixel and shows the glass play button; pressed, it sinks. Tapped, the card grows to the whole app losing its shadow, the thumbnail widens into the player really changing size, title and length fly on a curve to the big title and the line under the player, and the other rows step back, up above the tapped row and down below it, the nearest first, while the header rises and fades. Then come the Back button, the section, the chapters and Mark as complete; a light crosses the player, which settles with a one pixel nod; the play button springs in, turns into pause and fades. The lesson runs fast: the drawing moves (the dot runs on the curve, the wave, the bars), the time climbs, the bar fills across the chapters and the light box slides onto the chapter being played. Back brings the player into the thumbnail, title and length on the same curve reversed, the rows close in with a small bounce, the row lands sinking one pixel and its ring and the course bar move up to the time watched. Left alone, it opens three lessons in turn.

How it works

Measure the row and the screen

On tap the lesson screen is filled in, made visible and the row, thumbnail, title and length are measured relative to the app, along with their partners on the screen (the player slot, the big title, the length). The row hides: from here on everything you see belongs to the screen, placed where the row was.

Card and player really resize

The white card and the player are not scaled: GSAP animates left, top, width, height and the corner radius from the row to the whole app and from the thumbnail to the player slot. The drawing is an SVG with a viewBox and the chapter bar is in percentages, so they grow with the player without stretching or blurring.

Title and length on a curve

They have white-space nowrap in the row and on the screen: they start with x, y and a scale equal to their width in the row divided by their width on the screen, origin at the top left. x uses power3.inOut, y a curve blending inOut and out by ARC, so the piece draws an arc; on the way back the curve is flipped.

The list opens in two

Every other row leaves in the direction it sits from the tapped one (above goes up, below goes down), by SPREAD pixels plus a little for every row of distance, and starts STAGGER seconds later for every row of distance: the nearest first. On the way back the same order with back.out, so the list closes in around the row.

The lesson that plays

A single gsap.ticker moves the lesson's seconds forward (RATE at a time), fills the three pieces of the bar between chapters with a CSS variable, writes the time and, passing a chapter, slides the light box onto it with back.out. The drawing in the player has its own looping timeline, paused when the lesson is paused.

The landing

Before going back the row's bar gets the time watched, so the player lands on the same picture. When the card covers the row, the row shows again, sinks SETTLE pixels and springs back with elastic.out; then the ring, the tick and the piece of the course bar move to the new value. After every trip the inline styles are cleared: at rest the CSS is in charge.

Values to change

NameFileDefaultWhat it changes
OPEN_TIMEscript.js0.85Seconds the row takes to become the lesson screen.
CLOSE_TIMEscript.js0.7Seconds the screen takes to go back into its row.
ARCscript.js0.5How much title and length curve in flight (0 straight, 1 a wide curve).
STAGGERscript.js0.045Seconds between one row and the next as the list steps back and returns.
SPREADscript.js22How many pixels the other rows move away.
SETTLEscript.js1How many pixels the row sinks when it lands.
RATEscript.js20Seconds of lesson for every real second (the demo fast-forwards).
HOLDscript.js3.4Left alone: how many seconds the lesson stays open.
LOOPscript.jstrueLeft alone, it opens three lessons in turn.
--accentstyle.css#5b4cf0The accent colour: progress, ring, chapter being played.
--panelstyle.css#f6f5f1The list background behind the rows.

Try them in the Playground

When to use it

For the lesson list of a course platform, a podcast or episodic video app, a workout programme: whoever taps an item sees that the new screen is the same thing as the row, only bigger, and coming back finds the row in its place with the progress already updated.

On phones

The same animation with adapted sizes: the app is measured on the width and the height of the box (container units), the rows share the height, the player shrinks as needed and Mark as complete disappears when the app is short. Touch does what the pointer does.

With reduced motion

No flights or movement: the list fades out and the lesson screen fades in already in place, the drawing in the player stays still; back does the opposite, with the ring already at the new value.

Pitfalls

  • The white background of the lifted row is an absolute ::before: without z-index -1 and isolation on the row it covered the title and length, which are not positioned.
  • The player is absolute and comes after the title: the flying title passed under it. Title and length have position relative and a higher z-index.
  • GSAP also rounds strokeDashoffset: with pathLength 1 the ring jumped. It is turned off with an empty autoRound plugin and gsap.defaults({ autoRound: false }).
  • cqw and cqh units inside the app only work for its children: the app's own size is in vw and vh.
  • The white sheet has inset 0 in the CSS: animating it with left, top, width and height needs right and bottom auto, and they must be cleared too at the end.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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