Skip to content
animorio
IT
Back to the library

Storyboard playhead

Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 5.9 KBGSAP 28 KBFreeDownload the zip

The storyboard of a twelve-second ad in an editing tool: five shots in a row, an orange playhead crossing them in time, the one on air widening while the others narrow, its note appearing below and the timecode counting. Tapping a shot makes the playhead jump to it.

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>
<!--
  "Storyboard playhead" 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>Storyboard playhead</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">
    <!-- the storyboard of a short ad in a video tool: the playhead crosses the shots, the one on air
         widens and shows its note, and the timecode counts; tap a shot to jump to it -->
    <section class="sb" data-sb data-playing="true" aria-label="Storyboard">
      <header class="sb__head"><span class="sb__title"><strong>Morning roast, 12 s</strong><span class="sb__shot"><span data-outshot>Shot 1 of 5</span></span></span><span class="sb__time"><b data-outtime>0:00.0</b><span>of 0:12</span></span></header>
      <div class="sb__strip" data-strip role="group" aria-label="Shots">
        <button class="sb__card" type="button" data-shot data-len="2.4" data-kind="Wide" data-note="The shop at dawn, lights coming on one by one." style="--h:28"><i class="sb__art sb__art--wide"></i><span class="sb__kind">Wide</span><span class="sb__len">2.4 s</span></button>
        <button class="sb__card" type="button" data-shot data-len="1.6" data-kind="Close-up" data-note="Hands tamping the coffee, no faces yet." style="--h:12"><i class="sb__art sb__art--close"></i><span class="sb__kind">Close-up</span><span class="sb__len">1.6 s</span></button>
        <button class="sb__card" type="button" data-shot data-len="3" data-kind="Macro" data-note="The first drops fall into the cup, in slow motion." style="--h:38"><i class="sb__art sb__art--macro"></i><span class="sb__kind">Macro</span><span class="sb__len">3.0 s</span></button>
        <button class="sb__card" type="button" data-shot data-len="2" data-kind="Over shoulder" data-note="The cup slides across the counter to the first customer." style="--h:200"><i class="sb__art sb__art--over"></i><span class="sb__kind">Over shoulder</span><span class="sb__len">2.0 s</span></button>
        <button class="sb__card" type="button" data-shot data-len="3" data-kind="Pack shot" data-note="The bag on the counter, logo and line: Roasted this morning." style="--h:150"><i class="sb__art sb__art--pack"></i><span class="sb__kind">Pack shot</span><span class="sb__len">3.0 s</span></button>
        <i class="sb__head-line" data-playhead aria-hidden="true"></i>
      </div>
      <p class="sb__note"><span data-outnote>The shop at dawn, lights coming on one by one.</span></p>
      <div class="sb__controls">
        <button class="sb__play" type="button" data-play aria-label="Pause"><svg viewBox="0 0 20 20" aria-hidden="true"><path class="sb__pause" d="M6.500 4.500v11M13.500 4.500v11"></path><path class="sb__tri" d="M6.500 4 16 10l-9.500 6Z"></path></svg></button>
        <span class="sb__bar" aria-hidden="true"><i data-bar></i></span>
      </div>
    </section>
    <span class="live" aria-live="polite" data-live></span>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></path></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.

26 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 “Storyboard playhead” 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 black, a dark panel: “Morning roast, 12 s”, below it “Shot 1 of 5, wide” and on the right the time, “0:00.8 of 0:12”. In the middle a row of five coloured frames, each a composition made of simple shapes (a horizon with a small building, a large disc, a drop above a circle, a shoulder in shadow with a cup, a pack in the centre) with its length at the bottom. The frame on air is more than three times as wide as the others, full of colour and labelled with its kind of shot; the others are narrow and dimmer. A vertical orange line with a small head runs from left to right: when it enters the next frame, that one widens and the previous one narrows, and the playhead stays at the right point even while the widths are changing. Under the row the shot note changes with every shot, and at the bottom are the round pause button and the time bar. Tapping a frame makes the playhead jump to its start; when the ad ends it starts again.

How it works

Time decides everything

On every frame the time grows. From that number come the shot on air, the playhead’s position, the written timecode and the bar.

The accordion row

The frames share the width with flex: the one on air has a higher weight. On the change GSAP takes the weights to their new value, and the row redistributes itself.

The playhead read from the frame

The playhead’s position is not worked out on the total width: it is the left edge of the frame on air plus the fraction of its width already gone, read again on every frame. This way it never misses while the frames are moving.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#ff7a3dThe colour of the playhead and of the bar.
GROWscript.js3.4How much wider the current shot is than the others.
EASEscript.js0.6How many seconds the shots take to change width.
SPEEDscript.js1The playback speed.

Try them in the Playground

When to use it

On the site or in the app of an editing tool, a video studio or an agency, to show how an ad comes together; the same row with its playhead carries the chapters of a podcast, the slides of a timed presentation, the stages of a day or the steps of a recipe with a timer.

On phones

The panel is at most 430 pixels wide and narrows with the screen; the row is at most 150 pixels tall and never more than 34 per cent of the screen. On a narrow screen the frames not on air only show their length, and the label appears on the wide one. Every frame can be tapped to jump to it.

With reduced motion

The playhead does not run: the storyboard stands on the first shot, and the button (or a tap on a frame) moves to another one, which widens at once with its note. The demo’s pointer does not start.

Pitfalls

  • The playhead is read again from the frame on every frame: worked out once it would end up out of place while the widths change.
  • The frames are real buttons with a name saying number, kind and length; the one on air has aria-current.
  • The compositions are shapes made with CSS, not pictures: in a real product the stills or drawings go there, and the note stays text.
  • Ad, shots and lengths are invented.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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