
The star rating
Ratings, SVG, Hover
The card at the end of a post to support the writer: you choose one, three or five coffees and the drawn cup fills to that level, the steam wakes up and the total in the button is recounted. Pressed, the button says thank you and the cup makes a small toast.
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>
<!--
"Buy me a coffee card" 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>Buy the author a coffee card with the cup that fills and the total that counts</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 "buy me a coffee" card at the end of a blog post: choosing one, three or five coffees fills the cup,
wakes the steam and recounts the total; the button thanks you and the cup makes a small toast -->
<form class="cf" data-cf onsubmit="return false">
<div class="cf__top">
<svg class="cup" viewBox="0 0 72 72" aria-hidden="true">
<defs><clipPath id="cf-in"><path d="M17 27h34l-3.200 22.500a6 6 0 0 1-5.900 5.100H26.100a6 6 0 0 1-5.900-5.100Z"></path></clipPath></defs>
<g data-steam><path class="cup__steam" pathLength="1" d="M26 20c-3-3.500 3-5.500 0-9"></path><path class="cup__steam" pathLength="1" d="M34 19c-3-4 3-6.500 0-11"></path><path class="cup__steam" pathLength="1" d="M42 20c-3-3.500 3-5.500 0-9"></path></g>
<g data-cup>
<path class="cup__handle" d="M50.500 32h3.500a6.500 6.500 0 0 1 0 13h-5"></path>
<path class="cup__glass" d="M17 27h34l-3.200 22.500a6 6 0 0 1-5.900 5.100H26.100a6 6 0 0 1-5.900-5.100Z"></path>
<g clip-path="url(#cf-in)"><rect class="cup__coffee" data-coffee x="15" y="27" width="38" height="29"></rect><rect class="cup__crema" data-crema x="15" y="27" width="38" height="2.600"></rect></g>
<path class="cup__body" d="M17 27h34l-3.200 22.500a6 6 0 0 1-5.900 5.100H26.100a6 6 0 0 1-5.900-5.100Z"></path>
<path class="cup__shine" d="M22.500 31.500l1.900 14"></path>
</g>
<path class="cup__saucer" d="M12 60.500h44"></path>
</svg>
<div class="cf__say">
<span class="cf__kicker">Enjoyed the essay?</span>
<span class="cf__title" id="cf-title">Buy Mara a coffee</span>
<span class="cf__sub">It keeps the newsletter free.</span>
</div>
</div>
<div class="cf__row" role="radiogroup" aria-labelledby="cf-title" data-row>
<span class="cf__thumb" data-thumb aria-hidden="true"></span>
<label class="opt"><input type="radio" name="cups" value="1"><span>One</span></label>
<label class="opt"><input type="radio" name="cups" value="3"><span>Three</span></label>
<label class="opt"><input type="radio" name="cups" value="5"><span>Five</span></label>
</div>
<button class="cf__go" type="submit" data-go>
<span class="cf__go-fill" aria-hidden="true"></span>
<span class="cf__go-text"><span data-gotext>Support with <b data-total></b></span></span>
<svg class="cf__go-tick" viewBox="0 0 20 20" aria-hidden="true"><path data-tick pathLength="1" d="M4.500 10.400 8.300 14 15.500 6.200"></path></svg>
</button>
<p class="sr" data-live aria-live="polite"></p>
</form>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></svg>
</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.
18 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 “Buy me a coffee card” from Animorio and fit it into my siteThe coffee is a rectangle inside a clipPath shaped like the cup: GSAP only moves its y (29 units for fully empty), with back.out(1.5), so the level passes the mark and comes back like a liquid. The crema is a second rectangle with the same y.
Three paths with pathLength 1: the ones needed draw themselves with stroke-dashoffset staggered by a tenth, the others withdraw. They have opacity 0 when off, so as not to leave dots.
The total counts with power2.out inside the button. At the thank you the text rolls (the total’s node is found again after each change of text), and the cup rotates 12 degrees on its base and comes back with elastic.out.
| Name | File | Default | What it changes |
|---|---|---|---|
PRICE | script.js | 3 | The price of one coffee, in euros. |
START | script.js | 1 | The choice at the start: 0 one coffee, 1 three, 2 five. |
ACCENT | script.js | #a8612c | The colour of the coffee. |
POUR | script.js | 0.9 | How many seconds the cup takes to fill. |
HOLD | script.js | 2.2 | Alone: how many seconds the thank you stays before starting over. |
LOOP | script.js | true | Left alone, a pointer chooses and offers. |
At the end of the posts of a personal blog or a newsletter, on the “support me” page of someone making podcasts, music or open source, wherever a small contribution has three sizes.
The same card, as wide as the screen; below 350 pixels the cup drops to 64 and the title to 17. The three choices and the button stay 38 and 50 pixels high.
The cup is already at its level and changes without rising, the steam appears, the total changes without counting and the thank you arrives without rolling or a toast.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.7 KB; the libraries: GSAP 28 KB.
Tested on 16 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.