Skip to content
animorio
IT
Back to the library

Glass preview player

Hover, ImagesCanvas, GSAPMediumCompressed weight: Demo 10 KBGSAP 28 KBFreeDownload the zip

The video player of the keynote of an invented design app, Aster, on a near black page, in the premium style of the product pieces. Passing over the timeline the chapters swell on a spring, the one under the pointer a little more, a light settles under the pointer with a thin line standing in for the playhead, and a frosted glass preview follows it on a spring: it leans with its speed, a highlight runs along its edge, it shows the frame at that moment, the chapter that rolls when it changes and the time. Pressing jumps there: the frame crossfades into the new one and the watched part springs to its new length.

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>
<!--
  "Glass preview player" 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 video player with the glass preview on the bar</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>
    <span class="halo" data-halo aria-hidden="true"></span>
    <!-- the player of a product keynote. Hovering the timeline the chapters swell on a spring, a light sits under the
         pointer and a frosted glass preview follows it with the frame at that moment, the chapter and the time -->
    <article class="player" data-player>
      <div class="screen" data-screen>
        <canvas class="screen__frame" data-frame aria-hidden="true"></canvas>
        <canvas class="screen__frame screen__frame--next" data-next aria-hidden="true"></canvas>
        <span class="screen__grain" aria-hidden="true"></span>
        <span class="screen__scrim" aria-hidden="true"></span>
        <span class="screen__chip" data-chip>Opening</span>

        <div class="bubble" data-bubble aria-hidden="true">
          <div class="bubble__tilt" data-tilt>
            <span class="bubble__glare" data-glare></span>
            <canvas class="bubble__thumb" data-thumb></canvas>
            <span class="bubble__row">
              <span class="bubble__name"><span class="bubble__name-in" data-name>Opening</span></span>
              <span class="bubble__time" data-hovertime>0:00</span>
            </span>
          </div>
        </div>

        <div class="controls">
          <button class="ctl ctl--play" type="button" data-play aria-label="Pause">
            <svg viewBox="0 0 20 20" aria-hidden="true">
              <path class="ctl__pause" data-pause d="M6.5 4.5v11M13.5 4.5v11"/>
              <path class="ctl__tri" data-tri d="M6.5 4.6l9 5.4-9 5.4z"/>
            </svg>
          </button>
          <span class="clock"><span data-now>1:42</span><span class="clock__sep">/</span><span data-total>9:24</span></span>
          <div class="bar" data-bar role="slider" aria-label="Seek" aria-valuemin="0" aria-valuemax="564" aria-valuenow="102" tabindex="0">
            <span class="bar__glint" data-glint aria-hidden="true"></span>
            <span class="bar__ghost" data-ghost aria-hidden="true"></span>
            <div class="bar__track" data-track></div>
            <span class="bar__knob" data-knob aria-hidden="true"><span class="bar__knob-in" data-knobin></span></span>
          </div>
          <button class="ctl ctl--sound" type="button" aria-label="Sound">
            <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M3.5 7.8h2.8L10 4.6v10.8l-3.7-3.2H3.5z"/><path d="M13 7.2a4 4 0 010 5.6M15.2 5.2a7 7 0 010 9.6"/></svg>
          </button>
        </div>
      </div>
      <footer class="meta">
        <span class="meta__mark" aria-hidden="true">
          <svg viewBox="0 0 20 20"><path d="M10 2.5l2.1 5.4 5.4 2.1-5.4 2.1L10 17.5l-2.1-5.4L2.5 10l5.4-2.1z"/></svg>
        </span>
        <span class="meta__words">
          <span class="meta__title">Aster Keynote 2026</span>
          <span class="meta__sub">Aster Studio · 12.4k watching</span>
        </span>
        <span class="meta__hd">4K</span>
      </footer>
    </article>
    <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.

25 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 “Glass preview player” 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 near black page a dark player with round corners and a one pixel edge catching the light rises slowly: inside is the film of the keynote of Aster, an invented design app, made of soft lights in two colours drifting slowly and the chapter's title (‘The new canvas’, ‘Live together’, ‘One plan, every seat’), with the fine grain of a real video; behind the player the page takes on a hint of the film's colours. At the bottom the pause button, the time ‘1:44 / 9:24’, the timeline split into five chapters, the watched part orange fading into white, and the speaker; below, the keynote's name, who streams it and the 4K label. The pointer reaches the bar: the chapters swell on a spring and the one under the pointer a little more, a light comes on under the pointer with a thin vertical line, the white knob with its glow appears on the watched part, and above it a frosted glass preview rises with the frame at that minute, the chapter's name and the time. The pointer slides right and the preview follows it on a spring, leans with its speed and straightens up, a highlight runs along its top edge, the chapter's name rolls up when it passes into the next one. Then the bar is pressed: the film crossfades into the new frame, the watched part springs to its new length, the knob bounces and the light flares for an instant. The preview goes back, it jumps to 1:42 again, the light goes out and the loop starts over. With a pointer or a finger you really look and jump, and the button pauses.

How it works

A film drawn from its time

Every frame is a function of the minute: the chapter's ground, four radial gradients of its two colours added with 'lighter' and moved by slow sines, a line of light like a stage, the vignette and the title fading up as the chapter starts. The same function draws the big film and the preview's thumbnail, at any minute.

The chapter bar

One segment per chapter, as long as it lasts (flex-grow), holding the loaded and the watched parts scaled horizontally. The measured positions of the segments give two functions, from time to x and from x to time, that skip the gaps between chapters.

Two springs for the preview

The preview's x chases the pointer on a spring integrated by hand (stiffness 240, damping 22) in two steps per frame; its speed leans the glass and shifts the highlight on its edge. Another spring takes the hover from 0 to 1 and passes the mark slightly: it swells the bar, grows the knob and lifts the preview.

The rolling chapter

When the pointer passes into another chapter a GSAP timeline sends the name up (or down, going back) and brings the new one in with a back.out. The thumbnail is redrawn only when the time changes by almost half a second.

The jump

On a press the current frame is copied onto a second canvas over the film and fades, the time jumps and the difference stays as an offset that a tween takes to zero with expo.out: so the watched part slides into place while the film is already at the new minute.

Values to change

NameFileDefaultWhat it changes
STIFFNESSscript.js240The spring pulling the preview to the pointer: higher is quicker.
DAMPINGscript.js22Lower lets the preview pass the pointer and come back.
TILTscript.js7How far the preview leans when it runs, in degrees.
SWELLscript.js1How much the bar swells on hover (0 = it stays thin).
GLOWscript.js1How bright the light under the pointer is.
SPEEDscript.js12 = the walk on its own twice as fast, 0.5 = half.
LOOPscript.jstrueRepeats the walk along the bar.

Try them in the Playground

When to use it

For the video player of an online course, a streaming platform, a launch page or a product keynote: wherever the viewer wants to see what comes later before jumping.

On phones

The same animation with adapted sizes: the player is as wide as the box and never taller than the screen, the preview stays inside the film even at the ends of the bar, and a finger scrubs along the bar and jumps on release.

With reduced motion

No springs and no leaning: the preview fades in and out at the right spot, the chapter's name changes with a fade and the jump is a crossfade between the two frames.

Pitfalls

  • The chapters' positions must be measured from the real segments: with the gaps between chapters a plain ratio between time and width is off by a few pixels at every chapter.
  • The jump has to change the film's time at once and slide only the watched part with an offset: animating the time itself the film would rush through every chapter in between.
  • The preview has two elements, one for the position and one for the leaning: with one only the rotation would turn around the wrong point and wipe out the movement.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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