Skip to content
animorio
IT
Back to the library

Live stream reactions

Physics, HoverCanvas, GSAPAdvancedCompressed weight: Demo 14 KBGSAP 28 KBFreeDownload the zip

The player of Coda Room, a made-up live concert channel: an abstract video of stage lights, the «LIVE» pill and the hearts counter. Tap one of the four drawn reactions (heart, flame, applause, star) and it leaves the button with real physics written by hand on a canvas: a push, the upward pull of a bubble against the braking air, a side drift, a small lean, and it shrinks as it climbs. Hold the button and they come out in a burst; from the side come those of the other viewers. The ones that reach the top are caught by a spring and carried into the counter, which rolls like an odometer and gives a small jolt.

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>
<!--
  "Live stream reactions" 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 live reactions that rise and gather in the counter</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/geist-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <!-- the player of a made-up live session channel, Coda Room. Tap a reaction and it rises from its button like a
         bubble; hold it and they come out in a burst. The ones of the other viewers drift in from the side. The ones
         that reach the top are gathered into the counter, which rolls and gives a small jolt -->
    <section class="player" data-player aria-label="Coda Room live player">
      <span class="player__rim" aria-hidden="true"></span>

      <div class="video" data-video>
        <div class="video__scene" aria-hidden="true">
          <span class="glow glow--a" data-glow></span>
          <span class="glow glow--b" data-glow></span>
          <span class="beam beam--l" data-beam></span>
          <span class="beam beam--r" data-beam></span>
          <span class="floor"></span>
          <span class="ring" data-ring></span>
          <span class="grain"></span>
          <span class="vignette"></span>
        </div>

        <div class="video__top">
          <span class="live">
            <span class="live__pill">Live</span>
            <span class="live__time" data-clock>1:24:07</span>
          </span>
          <span class="counter" data-counter aria-label="12.4 thousand reactions">
            <span class="counter__icon" data-counter-icon aria-hidden="true">
              <svg viewBox="0 0 24 24"><path d="M12 20.4c-.3 0-.6-.1-.8-.3C6.6 16.2 3.2 13.2 3.2 9.4c0-2.8 2.1-4.9 4.7-4.9 1.7 0 3.1.8 4.1 2.1 1-1.3 2.4-2.1 4.1-2.1 2.6 0 4.7 2.1 4.7 4.9 0 3.8-3.4 6.8-8 10.7-.2.2-.5.3-.8.3Z"/></svg>
            </span>
            <span class="counter__num" data-counter-num aria-hidden="true"></span>
          </span>
        </div>

        <div class="video__bottom">
          <span class="channel">
            <svg class="channel__mark" viewBox="0 0 28 28" aria-hidden="true">
              <rect x="0.5" y="0.5" width="27" height="27" rx="9"/>
              <path d="M17.6 9.6a5.6 5.6 0 1 0 0 8.8"/>
              <path d="M20.4 11.2v5.6"/>
            </svg>
            <span class="channel__text">
              <span class="channel__name">Coda Room</span>
              <span class="channel__title">Late set from room two</span>
            </span>
          </span>
          <span class="watching">
            <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M2.6 12s3.4-6.2 9.4-6.2 9.4 6.2 9.4 6.2-3.4 6.2-9.4 6.2S2.6 12 2.6 12Z"/><circle cx="12" cy="12" r="2.8"/></svg>
            <span class="watching__num" data-watching aria-hidden="true"></span>
            <span class="sr">2,184 watching</span>
          </span>
        </div>
      </div>

      <div class="controls">
        <span class="controls__left" aria-hidden="true">
          <svg class="ctl" viewBox="0 0 24 24"><rect x="7" y="5.5" width="3.4" height="13" rx="1.2"/><rect x="13.6" y="5.5" width="3.4" height="13" rx="1.2"/></svg>
          <svg class="ctl ctl--line" viewBox="0 0 24 24"><path d="M4.5 9.6h3l4.3-3.6v12l-4.3-3.6h-3Z"/><path d="M15.6 9.2a4 4 0 0 1 0 5.6M18.2 6.8a7.4 7.4 0 0 1 0 10.4"/></svg>
          <span class="edge"><span class="edge__bar"></span><span class="edge__knob"></span></span>
        </span>

        <div class="tray" data-tray role="group" aria-label="Send a reaction">
          <span class="tray__pill" data-tray-pill aria-hidden="true"></span>
          <button class="react" type="button" data-react="heart" data-autoclic aria-label="Send a heart">
            <span class="react__halo" aria-hidden="true"></span>
            <svg class="react__icon" viewBox="0 0 24 24" aria-hidden="true"><path class="f-heart" d="M12 20.4c-.3 0-.6-.1-.8-.3C6.6 16.2 3.2 13.2 3.2 9.4c0-2.8 2.1-4.9 4.7-4.9 1.7 0 3.1.8 4.1 2.1 1-1.3 2.4-2.1 4.1-2.1 2.6 0 4.7 2.1 4.7 4.9 0 3.8-3.4 6.8-8 10.7-.2.2-.5.3-.8.3Z"/></svg>
          </button>
          <button class="react" type="button" data-react="flame" data-autoclic aria-label="Send a flame">
            <span class="react__halo" aria-hidden="true"></span>
            <svg class="react__icon" viewBox="0 0 24 24" aria-hidden="true"><path class="f-flame" d="M12 21.4c-3.9 0-6.8-2.7-6.8-6.4 0-2.8 1.6-4.8 3.2-6.5.5-.5 1.2-.1 1.2.5 0 1.1.5 2 1.3 2.5-.1-3.1 1.1-5.9 3.6-8.1.5-.4 1.2-.1 1.2.5.1 2.3 1.2 3.8 2.4 5.3 1.1 1.5 2.2 3.1 2.2 5.4 0 4-3 6.8-8.3 6.8Z"/><path class="f-flame-in" d="M12 20c-1.9 0-3.1-1.2-3.1-2.9 0-1.4.9-2.5 1.9-3.4.3-.3.8-.1.8.3 0 .7.4 1.3 1 1.5.1-1.2.6-2.3 1.4-3.1.3-.3.8-.1.8.3.1.9.5 1.6.9 2.2.4.6.7 1.2.7 1.9 0 1.9-1.5 3.2-4.4 3.2Z"/></svg>
          </button>
          <button class="react" type="button" data-react="clap" data-autoclic aria-label="Send applause">
            <span class="react__halo" aria-hidden="true"></span>
            <svg class="react__icon" viewBox="0 0 24 24" aria-hidden="true"><rect class="f-clap" x="6.2" y="7.6" width="6.4" height="12.4" rx="3.2" transform="rotate(-22 9.4 13.8)"/><rect class="f-clap-b" x="11.4" y="7.2" width="6.4" height="12.4" rx="3.2" transform="rotate(18 14.6 13.4)"/><path class="f-spark" d="M11.6 2.8l.5 2M15.8 3.4l-.9 1.8M7.8 3.8l1.1 1.6"/></svg>
          </button>
          <button class="react" type="button" data-react="star" data-autoclic aria-label="Send a star">
            <span class="react__halo" aria-hidden="true"></span>
            <svg class="react__icon" viewBox="0 0 24 24" aria-hidden="true"><path class="f-star" d="M12.00 4.30L14.29 9.74L20.18 10.24L15.71 14.11L17.05 19.86L12.00 16.80L6.95 19.86L8.29 14.11L3.82 10.24L9.71 9.74Z"/></svg>
          </button>
        </div>
      </div>

      <canvas class="sky" data-sky aria-hidden="true"></canvas>
    </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.

38 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 “Live stream reactions” 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 an almost black page sits the Coda Room player: an abstract video with two swaying stage lights, two pink and blue glows drifting slowly, a thin hanging ring and a striped floor in perspective. At the top the pink «LIVE» pill with the running time of the stream and, on the right, the frosted glass counter with the heart and «12.4k»; at the bottom the channel name, the title «Late set from room two» and the viewers, which change now and then by rolling. Below, pause, volume, the full live line and a tray with four drawn reactions. Over one a light pill glides under the reaction, the icon rises and tilts, a halo of its colour lights up behind it. Tapped, the button squashes and springs back, and the reaction comes out: it blooms with a small bounce, rises with its push and then floats like a bubble, sways sideways leaning the way it goes, and shrinks. Held down, eleven come out per second. From the right side of the video, smaller, come those of the other viewers. Six in ten reach the top: there a spring carries them into the counter, where they vanish with a thin ring of their colour, the counter heart jolts and the digits roll forward. The others fade halfway. The more reactions leave, the warmer the pink light of the video. Left alone, a pointer taps the heart and the flame, holds the heart for two seconds, then taps the star and the applause.

How it works

The reactions drawn once

The four shapes are SVG paths in a 24 by 24 box: with new Path2D(d) each is painted only once on an offscreen canvas, with a top to bottom gradient, a coloured shadow, a gloss at the top left and a hairline of light on the edge. While it runs it only does drawImage of that picture, rotated and scaled with setTransform.

A pool of particles

At the start 160 objects are created; a new reaction takes the first free one and frees it when it ends. Nothing is created while it runs, so no garbage collector pauses, even with the burst and the other viewers together.

The physics of a bubble

Every frame (gsap.ticker) the vertical speed gets -BUOYANCY x dt, then speed times exp(-DRAG x dt): the first push dies down and a steady climb is left, like a bubble. The drift is a sine that grows in the first 0.6 s; the lean is the cosine of the same wave, so it bends the way it goes. The scale is born with 1 - e^(-9t) cos(15t), a bounce, and drops with the climb down to END_SCALE.

The spring to the counter

A share of the reactions (COLLECT), past the high line of the video, changes regime: a critically damped spring, a = w²(target - position) - 2w v, carries it to the heart of the counter without wobbling, shrinking it. A few pixels away it vanishes, leaves a thin ring that grows, and the counter adds.

The rolling counter

«12.4k» is made of windows one line tall with a column 0-9 0-9 inside: a digit that changes always moves forward with yPercent, in 0.6 s on expo.out, and a wrapper around it rises one pixel and comes back, the settle. The counter pill gives a 2.5 px jolt with elastic.out and the heart swells and comes back.

Holding and the others

pointerdown with setPointerCapture sends the first; after HOLD_DELAY an accumulator in the ticker sends BURST_RATE per second until released. Those of the other viewers start from the right side of the video with a chain of gsap.delayedCall at random times, sometimes three in a row.

Values to change

NameFileDefaultWhat it changes
LAUNCHscript.js340Pixels per second of the push a reaction leaves the button with.
BUOYANCYscript.js150How hard a reaction is pulled up, like a bubble.
DRAGscript.js1.7How much the air slows a reaction down.
DRIFTscript.js18Pixels of the side drift.
DRIFT_SPEEDscript.js2.6How fast it sways sideways.
SPINscript.js14Degrees it leans into the drift.
SIZEscript.js36Pixels of a reaction when it leaves (on a 480 px player).
END_SCALEscript.js0.55How small a reaction is at the top.
COLLECTscript.js0.6The share of reactions that reach the counter.
BURST_RATEscript.js11Reactions per second while holding.
HOLD_DELAYscript.js0.22Seconds of holding before the burst.
OTHERS_EVERYscript.js1.1Seconds, on average, between the reactions of the other viewers.
ADD_EACHscript.js9How much each gathered reaction adds to the counter, on average.
ROLLscript.js0.6Seconds a digit of the counter takes to roll.
LOOPscript.jstrueLeft alone, the pointer taps and holds again and again.

Try them in the Playground

When to use it

For a live and streaming events player, a concert or launch page streamed live, a webinar, a video or social app, or anywhere a «like» button should be felt: also a blog post or a product page with the readers’ reactions.

On phones

The same animation with adapted sizes: the player is measured on width and height, the reactions, the push and the drift scale with its width, the canvas and the counter target are measured again at every resize. A finger taps or holds: no long press menu and no text selection.

With reduced motion

No flights and no swaying: the reaction fades in above its button and fades out, and the counter changes without rolling. The video stays still, no pointer on its own.

Pitfalls

  • One DOM element per reaction, with the burst and the other viewers, means dozens of nodes created and removed per second: the canvas with a pool of objects stays at 60 fps on a phone too.
  • Drawing each SVG path every frame with a shadow (shadowBlur) is slow: the reactions are painted once on an offscreen canvas, large for Retina screens, and then copied.
  • The drift is added to the position, not the speed: when the spring takes over the reaction would jump. At the switch the drawn position becomes the real one and the drift speed is added.
  • A plain spring to the counter would make the reaction orbit the heart: critically damped (2w) it arrives without wobbling.
  • The player enters with a scale: measures taken with getBoundingClientRect are divided by the ratio between the seen width and offsetWidth, or the target is off.
  • Taking dt as it comes, back on a tab after a while the reactions would make a huge leap: dt is capped at a twentieth of a second.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Geist Mono (font variabile) 5.3.0.

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

Testing

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