
The star rating
Ratings, SVG, Hover
The button that asks the pharmacy to refill a prescription. On the right it says how many tablets are left; pressed, the bottle’s cap swings open, the tablets drop in one after the other while the level and the count rise, then the cap shuts, the tick draws itself on the glass and the tag says when to pick it up.
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>
<!--
"Refill prescription 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>Refill prescription button with the tablets that drop back into the bottle</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 button that asks the pharmacy for a refill: pressed, the cap lifts, the tablets drop back into the bottle
while the level and the count rise, the cap closes, a tick draws itself and the tag says when to pick it up -->
<button class="rx" type="button" data-rx>
<span class="rx__body" aria-hidden="true"><span class="rx__wash" data-wash></span><span class="rx__light"></span></span>
<span class="rx__edge" aria-hidden="true"></span>
<span class="seat" data-seat aria-hidden="true">
<svg viewBox="0 0 24 24">
<defs><clipPath id="rx-in"><rect x="7.4" y="8.6" width="9.2" height="10.6" rx="1.9"></rect></clipPath></defs>
<g data-pills>
<rect class="seat__pill" x="10.4" y="0" width="3.2" height="1.7" rx="0.85"></rect>
<rect class="seat__pill" x="10.4" y="0" width="3.2" height="1.7" rx="0.85"></rect>
<rect class="seat__pill" x="10.4" y="0" width="3.2" height="1.7" rx="0.85"></rect>
</g>
<rect class="seat__glass" x="7.4" y="8.6" width="9.2" height="10.6" rx="1.9"></rect>
<g clip-path="url(#rx-in)"><rect class="seat__level" data-level x="7.4" y="8.6" width="9.2" height="10.6"></rect><path class="seat__shine" d="M9.3 10.4v6.800"></path></g>
<rect class="seat__bottle" x="7.4" y="8.6" width="9.2" height="10.6" rx="1.9"></rect>
<g data-cap><rect class="seat__cap" x="6.5" y="5" width="11" height="3.3" rx="1.1"></rect><path class="seat__ribs" d="M9.6 6v1.300M12 6v1.300M14.400 6v1.300"></path></g>
<path class="seat__tick" data-tick pathLength="1" d="M9.5 14.1 11.3 15.9 14.700 12.200"></path>
</svg>
</span>
<span class="label">
<span class="label__main"><span data-word>Refill prescription</span></span>
<span class="label__sub"><span data-sub>Calmera 10 mg</span></span>
</span>
<span class="tag" aria-hidden="true"><span data-left>4 left</span></span>
</button>
<p class="sr" data-live aria-live="polite"></p>
<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 “Refill prescription button” from Animorio and fit it into my siteAn object with the tablets in the bottle, from LEFT to FULL: the level (a rectangle clipped by the glass, scaled vertically from the bottom) and the count in the tag come from the same number, moved with power1.inOut, no spring.
The cap is an SVG group that rotates by 58 degrees on its bottom right corner with back.out. The three tablets are rounded rectangles drawn before the glass: they fall with power2.in, spinning, and vanish behind the bottle; at each landing the disc drops by a pixel and comes back.
The cap drops in 0.24 seconds and squashes to 0.78 with elastic.out, the tick draws itself in 0.36 seconds, the three texts roll staggered. Below a quarter of the bottle the tag at rest is orange.
| Name | File | Default | What it changes |
|---|---|---|---|
DRUG | script.js | "Calmera 10 mg" | The medicine on the prescription (made-up name). |
LEFT | script.js | 4 | How many tablets are left in the bottle. |
FULL | script.js | 30 | How many there are after the refill. |
PICKUP | script.js | "5 pm" | The pickup time at the pharmacy (made up). |
REFILL | script.js | 1.5 | How many seconds the refill lasts. |
ACCENT | script.js | #3b7bff | The colour of the tablets. |
OK | script.js | #17b877 | The colour once the refill is ready. |
HOLD | script.js | 2.6 | Alone: how many seconds the confirmation stays before going back. |
LOOP | script.js | true | Left alone, a pointer tries it by itself. |
In a pharmacy’s app or site, in the patient area of a medical practice, in a health app next to the list of treatments. In a real product the count comes from the prescription and the pickup time from the pharmacy’s reply.
The same pill, at most as wide as the screen minus the margins; there is no hover, the tap does the same job.
No swinging cap, falling tablets, flooding tint or bounces: the level and the count still rise (they are the information), the texts change without rolling and the tick appears.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.0 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.