Skip to content
animorio
IT
Back to the library

Throwable canvas toolbar

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

The floating toolbar of Plinth, an invented design app, on its dark canvas, like a Dribbble shot: a dark glass body whose edge catches the light, and inside the grip, Move, Frame, Pen, Text, Comment and Ask AI. It is a chain of springs: held by the grip the tools follow late and the body bends like a tube; thrown, it flies on with its speed, slows with friction, bounces off the walls, the tools push each other when they bunch up, and a spring takes it to the edge it was thrown at, lying flat at the bottom and top, standing up on the sides.

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>
<!--
  "Throwable canvas toolbar" 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 canvas toolbar you throw that snaps to the edges</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 canvas of Plinth, a design tool, on a near black page with a faint grid and the selected Hero frame in the
         middle. The floating toolbar is a chain of tools held together by springs: grab it by the grip and the tools
         trail behind it and bend the dark glass body; throw it and it flies with inertia, bounces off the walls,
         rounds off and snaps to the nearest edge, lying flat at the bottom or top and standing up on the sides -->
    <span class="glow glow--a" aria-hidden="true"></span>
    <span class="glow glow--b" aria-hidden="true"></span>
    <span class="grid" aria-hidden="true"></span>

    <section class="board" aria-hidden="true">
      <header class="board__head"><span>Hero / Desktop</span><span>1440 &#215; 900</span></header>
      <div class="board__frame">
        <span class="board__img"></span>
        <span class="board__line board__line--a"></span>
        <span class="board__line board__line--b"></span>
        <span class="board__cta"></span>
        <span class="board__sel"><i></i><i></i><i></i><i></i></span>
      </div>
    </section>

    <span class="halo" data-halo aria-hidden="true"></span>
    <svg class="tb" data-svg aria-hidden="true">
      <defs>
        <filter id="tb-soft" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="9"/></filter>
        <filter id="tb-sheen" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="3"/></filter>
        <linearGradient id="tb-rim" data-rim-grad gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="100" y2="0">
          <stop offset="0" stop-color="var(--cyan)" stop-opacity="0.9" data-rim-head/>
          <stop offset="0.45" stop-color="#ffffff" stop-opacity="0.16"/>
          <stop offset="1" stop-color="#ffffff" stop-opacity="0.1"/>
        </linearGradient>
        <linearGradient id="tb-shine" gradientUnits="objectBoundingBox" x1="0" y1="0" x2="1" y2="0">
          <stop offset="0" stop-color="var(--violet)"/>
          <stop offset="1" stop-color="var(--cyan)"/>
        </linearGradient>
      </defs>
      <g data-zones class="tb__zones"></g>
      <path class="tb__shadow" data-p="shadow" filter="url(#tb-soft)"/>
      <path class="tb__rim" data-p="rim" stroke="url(#tb-rim)"/>
      <path class="tb__body" data-p="body"/>
      <path class="tb__sheen" data-p="sheen" filter="url(#tb-sheen)"/>
      <path class="tb__shine" data-p="shine" stroke="url(#tb-shine)"/>
      <path class="tb__hit" data-p="hit"/>
    </svg>

    <span class="pick" data-pick aria-hidden="true"></span>

    <div class="tools" role="toolbar" aria-label="Canvas tools" data-tools>
      <span class="tool tool--grip" data-node data-grip aria-hidden="true">
        <span class="tool__face"><svg viewBox="0 0 24 24"><path d="M9.5 7.5v9M14.5 7.5v9"/></svg></span>
      </span>
      <button class="tool" type="button" data-node data-tool="Move" data-key="V" aria-label="Move" aria-pressed="true">
        <span class="tool__face"><svg viewBox="0 0 24 24"><path d="M6.5 4.8l11.2 6.1-5 1.3-2.2 4.9z"/></svg></span>
      </button>
      <button class="tool" type="button" data-node data-tool="Frame" data-key="F" aria-label="Frame" aria-pressed="false">
        <span class="tool__face"><svg viewBox="0 0 24 24"><path d="M8.5 4.5v15M15.5 4.5v15M4.5 8.5h15M4.5 15.5h15"/></svg></span>
      </button>
      <button class="tool" type="button" data-node data-tool="Pen" data-key="P" aria-label="Pen" aria-pressed="false">
        <span class="tool__face"><svg viewBox="0 0 24 24"><path d="M12 4.5l5.2 8.3-5.2 6.7-5.2-6.7z"/><path d="M12 12.6v6.9"/><circle cx="12" cy="11.6" r="1.1"/></svg></span>
      </button>
      <button class="tool" type="button" data-node data-tool="Text" data-key="T" aria-label="Text" aria-pressed="false">
        <span class="tool__face"><svg viewBox="0 0 24 24"><path d="M6 6.5h12M12 6.5v11.5M9.5 18h5"/></svg></span>
      </button>
      <button class="tool" type="button" data-node data-tool="Comment" data-key="C" aria-label="Comment" aria-pressed="false">
        <span class="tool__face"><svg viewBox="0 0 24 24"><path d="M5.5 11.4c0-3.6 2.9-6.1 6.5-6.1s6.5 2.5 6.5 6.1-2.9 6.1-6.5 6.1c-1 0-2-.2-2.8-.5L5.6 18.4l1-3.1c-.7-1.1-1.1-2.4-1.1-3.9z"/></svg></span>
      </button>
      <button class="tool tool--ai" type="button" data-node data-tool="Ask AI" data-key="A" data-ai aria-label="Ask AI">
        <span class="tool__face">
          <span class="tool__ring"></span>
          <svg viewBox="0 0 24 24"><g data-spark><path class="spark" d="M12 4.2c.5 4 2.3 5.8 6.3 6.3-4 .5-5.8 2.3-6.3 6.3-.5-4-2.3-5.8-6.3-6.3 4-.5 5.8-2.3 6.3-6.3z"/><path class="spark spark--s" data-spark-s d="M18 15.2c.2 1.4.8 2 2.2 2.2-1.4.2-2 .8-2.2 2.2-.2-1.4-.8-2-2.2-2.2 1.4-.2 2-.8 2.2-2.2z"/></g></svg>
        </span>
      </button>
    </div>

    <span class="tip" data-tip aria-hidden="true"><span class="tip__inner"><span data-tip-name>Move</span><kbd data-tip-key>V</kbd></span></span>

    <svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true">
      <path d="M5 3.2l13.6 9.6-6.1.9 3.5 6.6-2.6 1.3-3.4-6.7-4.6 4.2z"/>
    </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.

20 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 “Throwable canvas toolbar” 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 with a thin grid fading towards the edges, two distant lights, one violet and one cyan, and a very fine grain, sits the selected frame «Hero / Desktop» of a site in progress, with its violet outline and the four small squares at the corners. At the bottom in the middle floats the toolbar: a tube of dark glass with a one pixel rim, a soft sheen on top and a blurred shadow underneath; inside the two line grip, the drawn icons of Move, Frame, Pen, Text and Comment and the Ask AI button with its violet and cyan ring and the sparkle. The chosen tool sits under a small square of light glass. An arrow cursor goes over Pen: above the bar the label «Pen» with the P key springs up, the click makes the icon give and the square slides over to it; then Text. Then the cursor takes the grip and carries it in an arc: the tools follow late one after another, the body bends like a soft tube, the rim lights up cyan from the head and a violet halo rises underneath; at the four edges the dashed outlines of the places it can land appear. A flick to the left and the bar flies, hits the edge and bounces, the tools push each other and line up standing along the side, each with a small sway. Ask AI: the sparkle turns and swells, and a band of light from violet to cyan runs along the whole body. Then a throw downwards: the bar curls on itself for an instant, uncoils and lies down where it started, and the cursor goes back to Move. With the mouse or a finger you take it by the grip or by the body, carry it, throw it wherever you like, and the tools really get picked.

How it works

A chain of masses

Each tool is a mass with a position and a speed. The grip leads; every other tool wants to sit one step from the one before, along the edge when the bar is docked, behind like a rope while it moves (a blend of the two directions). A spring (CHAIN, CHAIN_DAMPING) pulls it there, and a link never stretches past a step and a half.

The body is one path

The glass is a single SVG path through the tools, a Catmull-Rom turned into Bézier curves, redrawn every frame with a thick stroke and round caps. The same curve makes the rim (a pixel wider, with a gradient from head to tail that lights up with speed), the sheen on top, the blurred shadow underneath and the area to grab.

Throw, friction and walls

Let go, the grip flies on with the hand's speed, measured frame by frame and smoothed, and slows with an exponential friction. Every tool bounces off the walls with BOUNCE; tools that are not neighbours push each other away when they come closer than a step, trading speed along the line between them.

The right edge

A fast throw picks the edge it is heading for (the larger part of the speed); a slow one the edge nearest the grip. Then a spring (STIFFNESS, DAMPING) takes the grip to its place and the chain straightens along the new direction, lying down or standing up. The dashed outlines of the four places show while you hold it, and the chosen one lights up.

The details

The chosen tool's square chases its tool on a spring of its own, the label with the key springs up with back.out on the bar's outer side, the icons tilt slightly with the curve, a click makes them give on an elastic spring and Ask AI runs a dash of light along the path with strokeDashoffset. The walk on its own is a GSAP timeline of calls only that moves an arrow and works out every time where the tools are.

Values to change

NameFileDefaultWhat it changes
STIFFNESSscript.js170The spring that takes the bar to its edge: higher is quicker.
DAMPINGscript.js15Lower lets the bar pass the edge and come back.
CHAINscript.js520How stiff the springs between the tools are.
CHAIN_DAMPINGscript.js28How quickly the tools stop swinging.
FRICTIONscript.js2.4How quickly a thrown bar slows down.
BOUNCEscript.js0.45How much speed is left after a wall: 0 stops, 1 like rubber.
THROWscript.js1How easily a throw picks the edge: higher needs a slower flick.
SPEEDscript.js12 = the walk on its own twice as fast, 0.5 = half.
LOOPscript.jstrueThe walk on its own starts again.

Try them in the Playground

When to use it

For a design, whiteboard, video editing or notes app: a toolbar people can move where it bothers them least, whose weight tells them it can be picked up and thrown. It also suits the landing page of such a product.

On phones

The same physics with adapted sizes: the step between the tools comes from the shorter side of the screen, so the bar fits whole even standing on a side; a finger takes it by the grip or the body and throws it, and the tool's label shows on touch.

With reduced motion

Nothing flies or sways: the bar stays straight, it can be dragged, and when let go it fades out and reappears on the chosen edge; the walk on its own only changes the chosen tool, with a fade.

Pitfalls

  • With two physics steps per frame the grip's speed worked out inside the step came out zero in the second one (the hand had not moved): the speed is measured once per frame, smoothed, and the physics reads it.
  • When the browser drops frames the measured speed goes wild and the walk on its own landed on the wrong edge: the walk on its own says where it throws, the measured speed only counts for a real hand.
  • On a narrow screen the edge nearest a long bar's centre was not the one it was thrown at: a fast throw picks the edge from the direction of its speed.

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 2 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