
The funnel context menu
Menus, Transitions, SVG, Hover
The Offset shipping button in the checkout of Fernwell, a made-up online shop: a white pill with a one pixel edge that catches the light, a small grey CO2 cloud drawn in line, 1.8 kg CO2e under the label and the +$0.42 cost sunk into a notch. Pressed, the cloud breaks into specks that rise like smoke, turn green and gather again as a leaf that rights itself on a spring; the label rolls to Offset added, a tick draws in the notch as it turns green and the cost flies on an arc into the order total, which rolls up. Another tap takes it back with the same gesture in reverse.
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>
<!--
"Carbon offset 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>Carbon offset button</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">
<!-- one gesture: offset the shipping. Pressed, the grey cloud of CO2 inside the pill breaks into specks that
drift up and gather again as a green leaf, the label rolls to Offset added, a tick draws in the chip and the
cost flies down into the order total, which rolls up. Another press takes the offset back the other way -->
<div class="frame" data-wrap>
<button class="s" type="button" data-btn data-autoclic aria-pressed="false" aria-describedby="s-note">
<span class="s__shadow" data-shadow aria-hidden="true"></span>
<span class="s__shell" data-shell aria-hidden="true">
<span class="s__skin"></span>
<span class="s__fill" data-fill></span>
<span class="s__glow" data-glow></span>
<span class="s__sheen" data-sheen></span>
<span class="s__edge"></span>
<span class="s__edge s__edge--on" data-edge></span>
</span>
<span class="s__icon" aria-hidden="true">
<svg viewBox="0 0 24 24" data-svg>
<g data-cloud>
<g data-breath>
<path class="cloud__body" data-cloud-path d="M7 18.5h10a4 4 0 0 0 .6-7.95a5.5 5.5 0 0 0-10.5 1.2A3.4 3.4 0 0 0 7 18.5Z"></path>
<path class="cloud__line" d="M9.4 15.4h5.4"></path>
</g>
</g>
<g data-leaf>
<path class="leaf__body" data-leaf-path d="M5.6 18.4C5.6 10.6 10.8 5.6 18.8 5.6C18.8 13.4 13.8 18.4 5.6 18.4Z"></path>
<path class="leaf__vein" data-vein d="M5.6 18.4L12.6 11.4M9.6 14.4h3.4M11.6 12.4V9.2"></path>
<path class="leaf__stem" data-stem d="M5.6 18.4L3.8 20.2"></path>
</g>
<g data-dust></g>
</svg>
</span>
<span class="s__text">
<span class="s__labels" data-labels>
<span class="s__label" data-l="idle">Offset shipping</span>
<span class="s__label" data-l="done">Offset added</span>
</span>
<span class="s__sub" data-sub><span data-kg>1.8</span> kg CO<sub>2</sub>e</span>
</span>
<span class="s__chip" data-chip aria-hidden="true">
<span class="chip__skin"></span>
<span class="chip__skin chip__skin--on" data-chipon></span>
<span class="chip__price" data-price>+$0.42</span>
<svg class="chip__check" viewBox="0 0 24 24"><path data-tick d="M6.6 12.4l3.6 3.5 7.2-7.6"></path></svg>
</span>
</button>
<p class="note" id="s-note" aria-live="polite">
<span class="note__k">Fernwell order total</span>
<span class="note__total odo" data-odo="total"></span>
</p>
<span class="token" data-token aria-hidden="true">
<span class="token__skin"></span>
<span class="token__txt" data-token-txt>+$0.42</span>
</span>
<span class="sr" data-sr></span>
</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.
25 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 “Carbon offset button” from Animorio and fit it into my siteThe cloud and the leaf are two SVG paths. On start getPointAtLength takes twenty two points along each (the leaf’s shifted by a third, so the specks cross the shape instead of sliding round the edge) and a circle is made for each pair. The change is a timeline: the starting shape shrinks and fades, every speck grows, moves away from the middle and rises by DRIFT with a random delay, changes colour, then goes to its landing point with a back.out, eleven thousandths apart.
Outline, stem and veins have a stroke-dasharray as long as the path: GSAP brings the stroke-dashoffset to zero as the specks arrive, and the green veil comes in with fill-opacity. The leaf group starts fourteen degrees off and a little smaller and rights itself with an elastic.out round a fixed svgOrigin, so it passes by a degree and comes back.
The token lives outside the button, in the component’s frame: the script measures the middle of the price and of the total and a 0 to 1 tween carries it along a quadratic Bézier curve with its control point above both ends, tilted by the sine of the path. When it lands it squashes and vanishes, and the digits of the total, columns of 0 to 9 moved with yPercent, roll from the right with a back.out.
The press lowers the button by one pixel and squashes it by one pixel (scaleY 0.983) and dims the shadow layer, which sits on its own under the shell. On hover an inner group of the cloud breathes on an endless sine.inOut timeline, separate from the group that breaks up, so the two animations do not cancel each other. The pale green of the added state is a circle clip-path in pixels starting from the leaf, worked out again on every resize.
| Name | File | Default | What it changes |
|---|---|---|---|
COST | script.js | 0.42 | What offsetting the shipping costs, in dollars. |
TOTAL | script.js | 86.4 | The order total before the offset. |
KG | script.js | 1.8 | The kilos of CO2 offset, written under the label. |
SPECKS | script.js | 22 | How many specks the cloud breaks into. |
MORPH | script.js | 1.15 | The seconds of the change from cloud to leaf. |
DRIFT | script.js | 3.2 | How far the specks rise as the cloud breaks up. |
ARC | script.js | 30 | How high the cost’s arc rises before dropping into the total, in pixels. |
BOUNCE | script.js | 1.5 | How much the pill, the digits and the cloud bounce. |
SKIP | script.js | 1 | For how many clicks of the self-running round the added offset stays in view before it is taken back. |
--verde | style.css | #1f8a57 | The green of the leaf, the notch and the specks. |
--nuvola | style.css | #a9aeb2 | The grey of the CO2 cloud. |
In the checkout or cart of an online shop that offers to offset the shipping emissions: the shopper sees in one gesture what they add, what it costs and where the price lands in the total.
The pill drops to 58 pixels, the label by half a point and the notch to 38; the finger taps like the mouse and the press looks the same. Without hover the cloud does not breathe and the light stays off; the rest is the same.
No specks, flight or rolling: the cloud fades out and the leaf fades in already drawn, the label, the tick, the green of the pill and the digits of the total change with a fade; on the way back the same in reverse.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 9.7 KB; the libraries: GSAP 28 KB.
Tested on 17 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.