
The inchworm menu
Menus, Hover, Transitions
The «Gift this article» button of an online magazine, dark on warm paper with light and grain, like a Dribbble shot: the little gift box, the words and the counter of the gifts left this month. Pressed, the lid pops, the counter rolls down by one and a coral thread runs along the bottom; then a satin ribbon with stitched edges unrolls over the button from the left, with a fold of light on its edge, and under it is the gift link, resolving letter by letter, already copied. After a moment the ribbon slides away.
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>
<!--
"Gift article 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 Gift article button with the ribbon that wraps the link</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/jetbrains-mono@5.3.0/index.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="stage">
<!-- the Gift this article button of Loam, an invented online magazine. A dark pill with the gift box and the
counter of the gifts left this month. Pressed, the lid lifts, the counter rolls down by one and a coral thread
runs along the bottom; then a satin ribbon with stitched edges unrolls over the button from left to right and
under it is the gift link, resolving letter by letter, already copied. After a moment the ribbon slides off -->
<div class="gift" data-wrap>
<span class="gift__floor" data-floor aria-hidden="true"></span>
<button class="gift__btn" type="button" data-btn aria-label="Gift this article, 5 gifts left this month">
<span class="gift__body" data-body>
<span class="gift__clip">
<span class="gift__shine" data-shine aria-hidden="true"></span>
<span class="gift__thread" data-thread aria-hidden="true"></span>
<span class="gift__face gift__face--rest" data-rest aria-hidden="true">
<span class="gift__icon">
<svg viewBox="0 0 24 24">
<rect class="gift__box" x="4.5" y="11.2" width="15" height="9" rx="1.6"/>
<path class="gift__ribbon" d="M12 11.2v9"/>
<g data-lid>
<rect class="gift__box" x="3.4" y="7.6" width="17.2" height="3.6" rx="1.1"/>
<path class="gift__ribbon" d="M12 7.6v3.6"/>
<g class="gift__bow" data-bow>
<path class="gift__ribbon" d="M12 7.5C10.6 4.6 7.4 4.4 7.6 6.2 7.8 7.5 10.2 7.6 12 7.5z"/>
<path class="gift__ribbon" d="M12 7.5c1.4-2.9 4.6-3.1 4.4-1.3-.2 1.3-2.6 1.4-4.4 1.3z"/>
</g>
</g>
</svg>
</span>
<span class="gift__labels">
<span class="gift__label" data-label>Gift this article</span>
<span class="gift__label gift__label--busy" data-label>Wrapping link</span>
<span class="gift__label gift__label--empty" data-label>No gifts left</span>
</span>
<span class="gift__chip" data-chip>
<span class="gift__roll" data-roll><span class="gift__digits" data-digits></span></span><span class="gift__left">left</span>
</span>
</span>
<span class="gift__ribbonface" data-ribbon aria-hidden="true">
<span class="gift__satin" data-satin></span>
<span class="gift__stitch gift__stitch--t"></span>
<span class="gift__stitch gift__stitch--b"></span>
<span class="gift__face gift__face--done">
<span class="gift__icon gift__icon--link">
<svg viewBox="0 0 24 24">
<path d="M10.2 13.8a3.6 3.6 0 0 0 5.1 0l3-3a3.6 3.6 0 0 0-5.1-5.1l-1.1 1.1"/>
<path d="M13.8 10.2a3.6 3.6 0 0 0-5.1 0l-3 3a3.6 3.6 0 0 0 5.1 5.1l1.1-1.1"/>
</svg>
</span>
<span class="gift__link" data-link>loam.pub/g/K7xQ2</span>
<span class="gift__copied" data-copied>
<svg viewBox="0 0 16 16"><path class="gift__check" data-check pathLength="1" d="M3.6 8.4l2.9 2.9 5.9-6.4"/></svg>
<span>Copied</span>
</span>
</span>
</span>
<span class="gift__fold" data-fold aria-hidden="true"></span>
</span>
</span>
</button>
</div>
<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>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.
24 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 “Gift article button” from Animorio and fit it into my siteThe button is a button element holding a body that only GSAP moves (the press's scale and shift) and, under it, a rounded clip that holds every layer: the light under the pointer (a radial-gradient on two CSS variables), the loading thread, the rest face, the ribbon and its fold. The black has a gradient from the top and six shadows: the one pixel edge, the light at the top, the inner shadow below and three soft shadows on the paper.
The digits from 0 to 9 are a column behind a window 16 pixels tall; GSAP moves it by 16 pixels per digit with back.out, so the new digit passes the mark by a pixel and settles, and the capsule swells by 6% and comes back.
The ribbon is a whole layer already in place, revealed with clip-path: inset(0 right 0 left). An object with two values, p for the covered part and from for the part already slid away, is animated by GSAP and on every frame writes the clip-path and carries the fold (a 24 pixel gradient: satin, bright lip, shadow on the black) to the moving edge; on the way out the fold flips with scaleX -1.
The satin is a coral gradient from the top with two inner shadows, a weave of one pixel vertical lines every three and a slanted sheen three times the button's width that GSAP slides with background-position; the stitches are two one pixel lines with a repeating-linear-gradient of four pixels on and four off.
While the ribbon opens a value t goes from 0 to 1 and every second frame rewrites the link: the letters before t are the real ones, the others random letters from an alphabet without ambiguous characters, while dots and slashes always stay in place. On a real press the link goes to the clipboard with navigator.clipboard.
| Name | File | Default | What it changes |
|---|---|---|---|
LABEL_REST | script.js | Gift this article | The words at rest. |
LABEL_BUSY | script.js | Wrapping link | The words while the link is made. |
GIFT_LINK | script.js | loam.pub/g/K7xQ2 | The gift link under the ribbon. |
GIFTS | script.js | 5 | The gifts left this month at the start, from 1 to 9. |
WRAP | script.js | 0.9 | How many seconds the thread takes to run along the bottom. |
UNROLL | script.js | 0.62 | How many seconds the ribbon takes to cover the button. |
HOLD | script.js | 1.8 | How many seconds the ribbon stays before sliding off. |
SPRING | script.js | 1 | How springy the press is: 0.4 calm, 2 very bouncy. |
AUTO | script.js | true | The button goes round by itself until someone touches it. |
For a magazine or a paid newsletter that lets readers gift a few articles a month, for a blog with members only posts, for a podcast gifting an episode: the button tells how many gifts are left and turns the link into a small parcel, so sharing feels like a gesture and not a copy and paste.
On the phone the button is at most 84% of the screen wide and the ribbon measures its width on every frame; without hover the light turns on under the finger at the touch, and the rest is the same.
Nothing moves: the lid stays still, the counter changes with a fade, the thread fades in, the ribbon appears and disappears with a fade with the link already written and the check already drawn, and at zero the button does not shake its head but the words dim.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.6 KB; the libraries: GSAP 28 KB.
Tested on 2 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.