
The star rating
Ratings, SVG, Hover
The rent button in a shop that also rents out its gear: an orange pill with the return arrow that turns on itself. Pressed, the arrow makes one turn for each day, the tag counts the days and the line below adds up the price; at the end the arrow closes into a tick and the label says until when it is yours.
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>
<!--
"Rent it 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>Rent it button with the arrow that goes round and the days that count</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 rent button of a shop that also rents its gear: pressed, the return arrow makes one turn for each day,
the tag counts the days and the line below adds up the price; then the arrow closes into a tick and the
label says until when it is yours -->
<button class="rent" type="button" data-rent>
<span class="rent__body" aria-hidden="true"><span class="rent__sheen" data-sheen></span><span class="rent__light"></span></span>
<span class="rent__edge" aria-hidden="true"></span>
<span class="seat" data-seat aria-hidden="true">
<svg viewBox="0 0 24 24">
<g data-loop><path d="M18.6 8.2A7.6 7.6 0 1 0 19.6 12"></path><path d="M19.4 3.8v4.6h-4.6"></path></g>
<path class="seat__tick" data-tick pathLength="1" d="M7.6 12.4 10.6 15.3 16.4 9"></path>
</svg>
</span>
<span class="label">
<span class="label__main"><span data-word>Rent it</span></span>
<span class="label__sub"><span data-sub>From €12 a day</span></span>
</span>
<span class="tag" data-tag aria-hidden="true"><span data-days>1 day</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.
14 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 “Rent it button” from Animorio and fit it into my siteA timeline with one cycle for each day: the arrow rotates 360 degrees in TURN seconds with power2.inOut around the centre of the drawing (svgOrigin 12 12), and halfway through the turn the tag and the line below roll to the new number. Changing DAYS the timeline lengthens by itself.
The days text and the price text come from the same number (days times RATE), so they cannot disagree; the plural (“day”, “days”) and the price’s decimals are decided by one function.
The arrow scales to zero, the tick draws itself with stroke-dashoffset, seat and pill make a small elastic bounce and a slanted sheen crosses the pill: the slant (skewX) is given to GSAP together with the movement.
| Name | File | Default | What it changes |
|---|---|---|---|
DAYS | script.js | 3 | For how many days it is rented. |
RATE | script.js | 12 | The price of one day. |
CURRENCY | script.js | € | The currency symbol. |
UNTIL | script.js | Sunday | The day it must be returned. |
TURN | script.js | 0.55 | How many seconds one turn of the arrow lasts, one per day. |
ACCENT | script.js | #ff6a2b | The pill’s colour. |
HOLD | script.js | 2.6 | On its own: how many seconds the summary stays before going back. |
LOOP | script.js | true | Left alone, a pointer tries it by itself. |
For a shop that rents as well as sells: mountain gear, cameras and lenses, formal wear, tools, bikes, board games. It sits next to the “Add to cart” button on the product page. In a real product the days come from the calendar chosen earlier.
The same button: the pill takes at most the screen width minus the margins; it is pressed with a finger and there is no light under the pointer.
No turns, bounces or sheen: days, price and labels change in place, the tick appears without drawing itself.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 5.1 KB; the libraries: GSAP 28 KB.
Tested on 15 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.