
The inchworm menu
Menus, Hover, Transitions
The Transfer ticket button of a made-up ticketing app, Stagecall, on black: one tap and the graphite pill stretches on a spring into a lane with a friend’s avatar at the far end. The coral ticket tugs twice at the perforation, tears off its stub and slides along the dotted track leaving a warm trail, while a light runs round the rim. It slips into the avatar, a ring waits for her to accept (Cancel brings it back and rejoins it to the stub), then the ring closes green, the badge pops, the stub stays hatched as a receipt and the line below says the seat is hers now.
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>
<!--
"Transfer ticket button" 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 Transfer ticket button with the ticket tearing off its stub and passing to a friend</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 Transfer ticket button of a made-up ticketing app, Stagecall: one tap tears the ticket off its stub,
it slides along the pill to a friend's avatar, waits for her to accept, and the stub stays behind as proof. -->
<div class="wrap" data-wrap>
<div class="pill" data-pill>
<span class="pill__glow" aria-hidden="true"></span>
<span class="pill__light" data-light aria-hidden="true"></span>
<span class="pill__beam" data-beam aria-hidden="true"></span>
<span class="pill__sweep" data-sweep aria-hidden="true"></span>
<!-- the lane: the track the ticket travels and the friend at the end -->
<div class="lane" data-lane aria-hidden="true">
<span class="track"><span class="track__dots"></span><span class="track__trail" data-trail></span></span>
<span class="who" data-who>
<svg class="who__ring" viewBox="0 0 44 44">
<circle class="who__track" cx="22" cy="22" r="20"></circle>
<circle class="who__run" data-run cx="22" cy="22" r="20"></circle>
</svg>
<span class="who__face"><span class="who__shine"></span><span class="who__initials" data-initials>MO</span></span>
<span class="who__badge" data-badge>
<svg viewBox="0 0 12 12"><path data-tick d="M3 6.3 5.1 8.3 9.1 3.9"></path></svg>
</span>
</span>
</div>
<!-- the ticket: the stub stays, the body travels -->
<span class="ticket" data-ticket aria-hidden="true">
<span class="ticket__stub" data-stub>
<svg viewBox="0 0 12.4 28">
<defs>
<linearGradient id="gStub" x1="0" y1="0" x2="44" y2="28" gradientUnits="userSpaceOnUse">
<stop offset="0" class="stop-a"></stop>
<stop offset="1" class="stop-b"></stop>
</linearGradient>
</defs>
<path class="ticket__paper" fill="url(#gStub)" d="M3 0H9.9A2.5 2.5 0 0 0 12.4 2.5V25.5A2.5 2.5 0 0 0 9.9 28H3A3 3 0 0 1 0 25V3A3 3 0 0 1 3 0Z"></path>
<path class="ticket__rim" d="M3 0.5H9.6"></path>
<rect class="ticket__mark" x="3.4" y="8" width="5" height="1.6" rx="0.8"></rect>
<rect class="ticket__mark" x="3.4" y="12" width="3.4" height="1.6" rx="0.8"></rect>
<path class="ticket__perf" d="M12.1 4.6V23.4"></path>
</svg>
<span class="ticket__void" data-void></span>
</span>
<span class="ticket__body" data-body>
<svg viewBox="12.4 0 31.6 28">
<defs>
<linearGradient id="gBody" x1="0" y1="0" x2="44" y2="28" gradientUnits="userSpaceOnUse">
<stop offset="0" class="stop-a"></stop>
<stop offset="1" class="stop-b"></stop>
</linearGradient>
</defs>
<path class="ticket__paper" fill="url(#gBody)" d="M12.4 2.5A2.5 2.5 0 0 0 14.9 0H41A3 3 0 0 1 44 3V25A3 3 0 0 1 41 28H14.9A2.5 2.5 0 0 0 12.4 25.5Z"></path>
<path class="ticket__rim" d="M15.2 0.5H41"></path>
<rect class="ticket__mark" x="17" y="7" width="12" height="2" rx="1"></rect>
<rect class="ticket__mark ticket__mark--soft" x="17" y="11.6" width="8" height="1.6" rx="0.8"></rect>
<g class="ticket__code">
<rect x="33" y="7" width="1.1" height="14"></rect><rect x="35" y="7" width="0.6" height="14"></rect>
<rect x="36.5" y="7" width="1.6" height="14"></rect><rect x="39" y="7" width="0.6" height="14"></rect>
<rect x="40.4" y="7" width="1" height="14"></rect>
</g>
<rect class="ticket__mark ticket__mark--soft" x="17" y="18.4" width="10" height="1.6" rx="0.8"></rect>
</svg>
<span class="ticket__glint" data-glint></span>
</span>
</span>
<button class="rest" type="button" data-go aria-label="Transfer ticket to Maya Okafor">
<span class="rest__label" data-label>Transfer ticket</span>
<svg class="rest__arrow" data-arrow viewBox="0 0 20 20" aria-hidden="true"><path d="M4.5 10h10.4M11 5.8 15.2 10 11 14.2"></path></svg>
</button>
</div>
<div class="cap" aria-live="polite">
<span class="cap__win"><span class="cap__now" data-cap>Lumen Hall · Sat 28 Nov · Row 12, Seat 7</span></span>
<button class="cap__cancel" type="button" data-cancel tabindex="-1">Cancel</button>
</div>
</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.
23 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 “Transfer ticket button” from Animorio and fit it into my siteThe ticket is two SVGs side by side sharing a user-space gradient: the stub’s viewBox runs from 0 to 12.4 and the body’s from 12.4 to 44, so the colour flows on without a seam. The perforation notches are 2.5 arcs in both paths. The body is an HTML element GSAP moves along the pill.
Two tugs of 1.5 and 2.5 pixels with a rotation round the bottom corner, the stub stepping back a pixel and springing home; then the body travels to the avatar’s centre, distance worked out from offsets at the open width, on an arc in y, with the trail stretching by scaleX alongside it.
A conic-gradient in an element with one pixel of padding and a mask that keeps only the border: GSAP turns the --a variable from 0 to 360 degrees while the ticket travels. On acceptance a blade of green light crosses the pill.
The avatar’s ring is an SVG circle with a short dash spinning forever; once accepted the dash closes and turns green and the badge tick draws from its dasharray. Cancel stops the wait and brings the body back to x = -1, then 0 with back.out: the one-pixel overshoot of the snap. The line below rolls, its window following the width of the new sentence.
| Name | File | Default | What it changes |
|---|---|---|---|
LABEL | script.js | Transfer ticket | The label of the closed button. |
FRIEND | script.js | Maya Okafor | Who the ticket goes to (the initials go in the avatar). |
SEAT | script.js | Row 12, Seat 7 | The ticket’s seat. |
EVENT | script.js | Lumen Hall · Sat 28 Nov | The night, in the line under the pill. |
TRAVEL | script.js | 1.05 | The seconds of the ticket’s trip along the pill. |
WAIT | script.js | 1.7 | The seconds of waiting before the friend accepts. |
SPRING | script.js | 1 | How much the pill bounces as it stretches. |
HOLD | script.js | 2.2 | The seconds the final message stays before closing. |
IDLE | script.js | 0.9 | The seconds before the autopilot starts. |
--biglietto | style.css | #ff6b3d | The colour of the ticket. |
In the app or site of a box office, a festival, a theatre or a stadium, next to a ticket already bought: passing it to a friend, with the wait for her to accept and the chance to change your mind.
The open pill takes almost the whole width and the trip is worked out again on that size; the finger taps like the mouse. Without hover the light stays off and the ticket does not tug.
No springs, tugs or trip: the pill opens in a fade, the ticket body fades out and the full trail appears, the ring holds still half drawn while waiting, the tick appears already drawn and the line below changes in a fade.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 9.1 KB; the libraries: GSAP 28 KB.
Tested on 15 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.