
The inchworm menu
Menus, Hover, Transitions
The giveaway card of Kiln Roasters, a made-up coffee roaster: you can win a year of coffee, 2,481 people have entered and two days are left. On tap the elastic «Enter the giveaway» pill squashes and a ticket comes out of a slot under the figures in two pushes, like from a printer, with a toothed edge and a punched hole, its entry number #2482 rolling into place digit by digit; the entries go up by one, the pill becomes «You’re in» with a tick and below it «Share to get 2 more entries» arrives, which takes the ticket from 1 to 3 entries. On white, with a single tomato accent.
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>
<!--
"Giveaway entry 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>Giveaway entry button</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 giveaway card of Kiln Roasters, a made-up coffee roaster: what you can win, how many have entered and how
long is left, and the elastic pill. On press the pill squashes, a ticket prints out of the slot with its
entry number rolling into place, the entries go up by one and the pill becomes You're in -->
<section class="card" data-card aria-label="Kiln Roasters giveaway">
<span class="card__edge" aria-hidden="true"></span>
<div class="prize">
<span class="thumb" aria-hidden="true">
<svg viewBox="0 0 40 40" data-thumb>
<path class="bag" d="M12 9.5h16l1.6 4.2v18.6a2.2 2.2 0 0 1-2.2 2.2H12.6a2.2 2.2 0 0 1-2.2-2.2V13.7z"/>
<path class="bag__fold" d="M10.4 13.7h19.2"/>
<path class="bag__crimp" d="M13 11.4h14"/>
<rect class="bag__label" x="14" y="18" width="12" height="9.5" rx="1.4"/>
<path class="bean" d="M20 19.6c-1.9.6-2.6 3.4-1.2 5.3M20 19.6c1.9.6 2.6 3.4 1.2 5.3"/>
</svg>
</span>
<div class="prize__txt">
<p class="brand">Kiln Roasters · Giveaway</p>
<h1 class="name">Win a year of coffee</h1>
<p class="meta">One bag a week for twelve months</p>
</div>
</div>
<div class="facts">
<span class="fact"><span class="roll" data-count aria-hidden="true"></span><span class="fact__lab">entries</span></span>
<span class="fact fact--end">Ends in <b>2d 14h</b></span>
</div>
<!-- the slot the ticket prints out of -->
<div class="well" data-well aria-hidden="true">
<span class="slot"></span>
<div class="ticket" data-ticket>
<span class="ticket__stub">
<span class="hole"></span>
</span>
<span class="ticket__body">
<span class="ticket__top">
<span class="ticket__lab">Entry</span>
<span class="ticket__num">#<span class="roll" data-num></span></span>
</span>
<span class="ticket__bottom">
<span>Draw on Dec 15</span>
<span class="ticket__entries"><span class="roll" data-mine></span> <span data-mine-lab>entry</span></span>
</span>
</span>
<span class="ticket__shine" data-shine></span>
</div>
</div>
<button class="pill" type="button" data-pill data-autoclic aria-label="Enter the giveaway">
<span class="pill__bg" data-pill-bg aria-hidden="true"></span>
<span class="pill__face" data-face="enter"><span class="pill__txt">Enter the giveaway</span></span>
<span class="pill__face" data-face="in" aria-hidden="true">
<svg class="tick" viewBox="0 0 16 16"><path d="M3.6 8.4 6.6 11.2 12.4 5" pathLength="1" data-tick/></svg>
<span class="pill__txt">You’re in</span>
</span>
</button>
<button class="share" type="button" data-share aria-hidden="true" tabindex="-1">
<span class="share__face" data-sface="ask">
<svg class="ico" viewBox="0 0 16 16"><path d="M8 2.2v7.6M5 5.1 8 2.2l3 2.9M3.4 8.6v3.6c0 .9.7 1.6 1.6 1.6h6c.9 0 1.6-.7 1.6-1.6V8.6"/></svg>
<span>Share to get 2 more entries</span>
</span>
<span class="share__face" data-sface="done">
<svg class="ico" viewBox="0 0 16 16"><path d="M3.6 8.4 6.6 11.2 12.4 5" pathLength="1" data-stick/></svg>
<span>Link copied · 2 entries added</span>
</span>
</button>
<p class="sr" aria-live="polite" data-live></p>
</section>
</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.
35 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Giveaway entry button” from Animorio and fit it into my siteThe ticket sits in a well with hidden overflow as tall as the slot, shifted up by 100% of its own height: GSAP stretches the well to the ticket’s height and meanwhile brings it down in four stretches (to halfway, a pause, a pixel too far, its place), so it comes out in pushes as from a printer.
The bottom edge is a CSS mask: a transparent circle at the bottom, repeated every 0.62 em across, takes out a half circle at each step. The hole is a circle in the card’s colour with an inner shadow.
Each digit is a window one line tall over a column from 0 to 9; to change the number each column is sent to its digit with yPercent, so in the entries count only the last one rolls, in the entry number all of them, one after another.
| Name | File | Default | What it changes |
|---|---|---|---|
ENTRIES | script.js | 2481 | How many have entered before you. |
PRINT_TIME | script.js | 1.1 | Seconds the ticket takes to print out of the slot. |
ROLL_TIME | script.js | 0.7 | Seconds each digit takes to roll into place. |
DIGIT_GAP | script.js | 0.08 | Seconds between one digit of the entry number and the next. |
SQUASH | script.js | 0.9 | How flat the pill gets when pressed (1 = not at all). |
SPRING | script.js | 0.45 | How springy the pill is (lower = more bounce). |
BONUS | script.js | 2 | The extra entries you get for sharing. |
HOLD | script.js | 2.6 | Seconds the finished state stays before the demo starts over. |
IDLE | script.js | 7 | Seconds after your last touch before the demo plays by itself again. |
On the page of a prize contest, a social giveaway or a charity raffle: the ticket that comes out gives whoever enters proof they are in, and the share button arrives when interest is at its highest.
Everything is in em and the size depends on both the width and the height of the window, so the card fits the phone box whole even with the ticket out. The pill is as wide as the card, easy for a thumb; the share line is a real button, tall enough to tap.
No springs, pushes or rolling: the ticket fades in already out, the numbers are right straight away and the faces of the pill and of the share line swap with a fade.
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 7.3 KB; the libraries: GSAP 28 KB.
Tested on 1 December 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.
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.