
The inchworm menu
Menus, Hover, Transitions
The right-click menu on the canvas of Tessel, a made-up design tool, on white: it is born exactly at the click point from a 0.96 scale, while a wide shadow gathers under it and settles. The items arrive a few milliseconds apart with their shortcuts drawn as real keys, a blue highlight follows the item under the pointer on a spring, and Arrange opens its submenu to the side with the safe triangle. Press an item: a short flash, the menu closes and the frame on the canvas really moves: forward, to the back, duplicated or deleted.
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>
<!--
"Canvas context menu" 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 design canvas context menu born at the click point</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>
<svg width="0" height="0" style="position:absolute" aria-hidden="true">
<defs>
<symbol id="k-cmd" viewBox="0 0 12 12"><path d="M4.2 4.2h3.6v3.6H4.2zM4.2 4.2V3a1.2 1.2 0 1 0-1.2 1.2h1.2zm3.6 0V3A1.2 1.2 0 1 1 9 4.2H7.8zm0 3.6V9A1.2 1.2 0 1 0 9 7.8H7.8zm-3.6 0V9A1.2 1.2 0 1 1 3 7.8h1.2z"/></symbol>
<symbol id="k-shift" viewBox="0 0 12 12"><path d="M6 2.2 2.2 6.4h2.2v3.2h3.2V6.4h2.2z"/></symbol>
<symbol id="k-del" viewBox="0 0 12 12"><path d="M4.4 3h5.4a.9.9 0 0 1 .9.9v4.2a.9.9 0 0 1-.9.9H4.4L1.6 6zM5.8 4.8l2.4 2.4m0-2.4L5.8 7.2"/></symbol>
<symbol id="k-chev" viewBox="0 0 12 12"><path d="M4.6 2.8 7.8 6l-3.2 3.2"/></symbol>
<symbol id="k-lock" viewBox="0 0 12 12"><rect x="2.6" y="5.2" width="6.8" height="4.6" rx="1.1"/><path d="M4.1 5.2V4a1.9 1.9 0 0 1 3.8 0v1.2"/></symbol>
</defs>
</svg>
<main class="stage">
<!-- The canvas of Tessel, a made-up design tool: three frames of a landing page. Right-click (or press and hold) a
frame and its menu is born exactly at the point of the click; Arrange opens its submenu to the side. -->
<div class="canvas" data-canvas tabindex="0" role="application" aria-label="Tessel canvas. Right-click or press and hold a frame to open its menu. With the keyboard, Shift F10 opens it on the selection.">
<span class="canvas__grid" aria-hidden="true"></span>
<span class="canvas__file" aria-hidden="true"><b>Tessel</b><span class="canvas__sep">/</span>Landing v3</span>
<span class="canvas__zoom" aria-hidden="true">100%</span>
<div class="layer layer--hero" data-layer="Hero" style="--x:8%;--y:16%;--w:46%;--h:50%">
<span class="mock mock--nav"><i></i><i></i><i></i></span>
<span class="mock__title">Ship the<br>launch page</span>
<span class="mock mock--line"></span>
<span class="mock mock--line mock--short"></span>
<span class="mock__cta">Get started</span>
</div>
<div class="layer layer--price" data-layer="Pricing card" style="--x:35%;--y:31%;--w:33%;--h:52%">
<span class="mock__tag">Pro</span>
<span class="mock__price">$24<small>/mo</small></span>
<span class="mock mock--line"></span>
<span class="mock mock--line mock--short"></span>
<span class="mock mock--line"></span>
<span class="mock__btn"></span>
</div>
<div class="layer layer--quote" data-layer="Testimonial" style="--x:57%;--y:12%;--w:35%;--h:38%">
<span class="mock__mark">“</span>
<span class="mock mock--line"></span>
<span class="mock mock--line"></span>
<span class="mock mock--line mock--short"></span>
<span class="mock__who"><i></i><b></b></span>
</div>
<div class="sel" data-sel aria-hidden="true">
<span class="sel__name"><svg class="sel__lock"><use href="#k-lock"/></svg><span data-selname>Hero</span></span>
<span class="sel__size" data-selsize>0 × 0</span>
<i class="sel__h sel__h--tl"></i><i class="sel__h sel__h--tr"></i><i class="sel__h sel__h--bl"></i><i class="sel__h sel__h--br"></i>
</div>
<svg class="safe" data-safe aria-hidden="true"><polygon points="0,0 0,0 0,0"/></svg>
<div class="menu" data-menu role="menu" aria-label="Frame" hidden>
<span class="menu__far" aria-hidden="true"></span>
<span class="menu__rest" aria-hidden="true"></span>
<div class="menu__body">
<span class="menu__hl" data-hl aria-hidden="true"></span>
<button class="row" type="button" role="menuitem" tabindex="-1" data-act="copy" data-needs="layer"><span class="row__label">Copy</span><span class="keys"><kbd><svg><use href="#k-cmd"/></svg></kbd><kbd>C</kbd></span></button>
<button class="row" type="button" role="menuitem" tabindex="-1" data-act="paste"><span class="row__label">Paste here</span><span class="keys"><kbd><svg><use href="#k-cmd"/></svg></kbd><kbd>V</kbd></span></button>
<button class="row" type="button" role="menuitem" tabindex="-1" data-act="duplicate" data-needs="layer"><span class="row__label">Duplicate</span><span class="keys"><kbd><svg><use href="#k-cmd"/></svg></kbd><kbd>D</kbd></span></button>
<span class="menu__sep" role="separator"></span>
<button class="row row--sub" type="button" role="menuitem" tabindex="-1" aria-haspopup="menu" aria-expanded="false" data-act="arrange" data-needs="layer"><span class="row__label">Arrange</span><svg class="row__chev"><use href="#k-chev"/></svg></button>
<button class="row" type="button" role="menuitem" tabindex="-1" data-act="lock" data-needs="layer"><span class="row__label" data-locklabel>Lock</span><span class="keys"><kbd><svg><use href="#k-shift"/></svg></kbd><kbd><svg><use href="#k-cmd"/></svg></kbd><kbd>L</kbd></span></button>
<button class="row" type="button" role="menuitem" tabindex="-1" data-act="hide" data-needs="layer"><span class="row__label" data-hidelabel>Hide</span><span class="keys"><kbd><svg><use href="#k-shift"/></svg></kbd><kbd><svg><use href="#k-cmd"/></svg></kbd><kbd>H</kbd></span></button>
<span class="menu__sep" role="separator"></span>
<button class="row row--danger" type="button" role="menuitem" tabindex="-1" data-act="delete" data-needs="layer"><span class="row__label">Delete</span><span class="keys"><kbd><svg><use href="#k-del"/></svg></kbd></span></button>
</div>
</div>
<div class="menu menu--sub" data-sub role="menu" aria-label="Arrange" hidden>
<span class="menu__far" aria-hidden="true"></span>
<span class="menu__rest" aria-hidden="true"></span>
<div class="menu__body">
<span class="menu__hl" data-hl aria-hidden="true"></span>
<button class="row" type="button" role="menuitem" tabindex="-1" data-act="front"><span class="row__label">Bring to front</span><span class="keys"><kbd><svg><use href="#k-cmd"/></svg></kbd><kbd>]</kbd></span></button>
<button class="row" type="button" role="menuitem" tabindex="-1" data-act="forward"><span class="row__label">Bring forward</span><span class="keys"><kbd>]</kbd></span></button>
<button class="row" type="button" role="menuitem" tabindex="-1" data-act="backward"><span class="row__label">Send backward</span><span class="keys"><kbd>[</kbd></span></button>
<button class="row" type="button" role="menuitem" tabindex="-1" data-act="back"><span class="row__label">Send to back</span><span class="keys"><kbd><svg><use href="#k-cmd"/></svg></kbd><kbd>[</kbd></span></button>
</div>
</div>
<div class="note" data-note role="status" aria-live="polite"><span data-notetext></span></div>
<svg class="hand" data-hand viewBox="0 0 24 24" aria-hidden="true"><path d="M5 2.5l13.2 12.1-5.9.4 3.4 6.4-2.6 1.3-3.3-6.5L5 20.3z"/></svg>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
<script src="script.js"></script>
</body>
</html>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.
55 values to change
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 “Canvas context menu” from Animorio and fit it into my siteThe menu is measured, flipped if it does not fit to the right or below and kept inside the canvas; its transform-origin though stays the click point, even when the menu had to move, so it always grows from there. The scale goes from 0.96 to 1.004 and back to 1 with two keyframes: a pixel of overshoot on a 214 wide menu.
Two shadow layers apart from the menu: a wide low one, as if the menu were still lifted, that tightens and fades; and a resting one, four shadows deep, that arrives a moment later. Together they make the shadow that gathers under the menu as it lands.
The highlight is a single element, moved in a GSAP ticker loop by a real spring on position and height (stiffness and damping are knobs) with the time step capped at 1/30 of a second. Once it rests it stops redrawing.
From Arrange, the pointer’s point and the two corners of the submenu’s near side make a triangle. As long as the pointer is inside it and moving towards the submenu, Arrange stays chosen; if it stops, after SAFE_WAIT seconds the item under it wins. The triangle is drawn faintly in SVG, and it works on a phone too, where the submenu overlaps the right half of the menu.
The menu does not use :hover: the script works out which item is under a point by itself, on the rows’ offsets. The pilot’s drawn pointer and the real one go through the same function; at the first real gesture the pilot stops and starts again after six quiet seconds.
A short timeline fills the highlight with blue, switches it off for 40 milliseconds, back on, sinks the keys by a pixel and closes the menu. Then the frame changes place in the stack (z-index), is duplicated by a clone that slides out of the original, or is deleted, and the frames it touched settle a little.
| Name | File | Default | What it changes |
|---|---|---|---|
OPEN_SCALE | script.js | 0.96 | The scale the menu is born at, from the click point. |
OPEN_TIME | script.js | 0.26 | Seconds for the menu to reach its full size. |
STAGGER | script.js | 0.014 | Seconds between one item and the next as the menu opens. |
SHADOW_TIME | script.js | 0.55 | Seconds for the shadow to gather and settle under the menu. |
HL_STIFFNESS | script.js | 640 | The spring pulling the highlight to the item under the pointer. |
HL_DAMPING | script.js | 36 | Lower, the highlight passes the item and comes back. |
SUB_DELAY | script.js | 0.12 | Seconds resting on Arrange before the submenu opens. |
SAFE_WAIT | script.js | 0.3 | How long the triangle keeps Arrange once the pointer stops. |
SHOW_SAFE | script.js | true | Draw the safe triangle faintly while it works. |
HOLD_TIME | script.js | 0.45 | Seconds of pressing on a phone before the menu opens. |
PACE | script.js | 1 | The pilot’s pauses: higher waits longer between moves. |
LOOP | script.js | true | The pilot plays the story again and again. |
In design apps, page, slide or whiteboard editors, file managers and any canvas where people right-click an object. It also works as the actions menu of a row or a card, opened where the click was.
The same animation: the canvas narrows to the full width, the menu and its items get a little shorter, a long press opens the menu and sliding the finger and letting go over an item chooses it. The submenu, with no room to the side, opens under Arrange over the right half of the menu, with the triangle still doing its job.
Nothing moves or scales: the menu and submenu fade in in place, the highlight jumps to the item without a spring, the frames change place without settling and the pilot’s pointer is hidden.
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.
Tested on 11 November 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.