
The star rating
Ratings, SVG, Hover
The button that books a hem or an alteration at a tailor’s. Pressed, the needle leaves the disc and goes round the pill leaving a line of red thread stitches behind it, just inside the edge; when the seam closes the tick draws itself and the tag says when it will be ready.
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>
<!--
"Tailor’s needle 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>Book an alteration button of a tailor with the needle that sews the edge of the pill</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 books an alteration at a tailor's: pressed, a needle runs along the edge of the pill and
leaves a line of stitches behind it; when the seam closes a tick draws itself and the tag says when it is ready -->
<button class="tl" type="button" data-tl>
<span class="tl__body" aria-hidden="true"><span class="tl__wash" data-wash></span><span class="tl__light"></span></span>
<span class="tl__edge" aria-hidden="true"></span>
<svg class="tl__sew" data-sew aria-hidden="true">
<defs><mask id="tl-mask" maskUnits="userSpaceOnUse"><rect class="tl__reveal" data-reveal pathLength="1"></rect></mask></defs>
<rect class="tl__stitch" data-stitch mask="url(#tl-mask)"></rect>
<g data-needle><path class="tl__needle" d="M-7 0H8"></path><ellipse class="tl__eye" cx="-5" cy="0" rx="1.800" ry="0.900"></ellipse></g>
</svg>
<span class="seat" data-seat aria-hidden="true">
<svg viewBox="0 0 24 24">
<g data-icon>
<path class="seat__thread" d="M7.300 16.700c-2.600 1.700-3.800-1.200-1.600-2.300 2.400-1.200 4.600 2.800 2 4.300"></path>
<path class="seat__needle" d="M6.500 17.500 18.200 5.800"></path>
<ellipse class="seat__eye" cx="8.300" cy="15.700" rx="1.700" ry="0.850" transform="rotate(-45 8.300 15.700)"></ellipse>
</g>
<path class="seat__tick" data-tick pathLength="1" d="M7.500 12.400 10.600 15.300 16.500 8.800"></path>
</svg>
</span>
<span class="label">
<span class="label__main"><span data-word>Book an alteration</span></span>
<span class="label__sub"><span data-sub></span></span>
</span>
<span class="tag" aria-hidden="true"><span data-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.
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 “Tailor’s needle button” from Animorio and fit it into my siteAn SVG rounded rectangle, five pixels inside the pill, with a dashed stroke (5 and 4.5): those are the stitches. A mask with the same rectangle and pathLength 1 uncovers it with stroke-dashoffset: so the dashes stay still and appear one at a time.
From the same number the point on the rectangle is read with getPointAtLength and, two pixels further on, the direction: the needle sits there rotated, with a small sideways wave (a sine on the length) that takes it in and out of the cloth. All written into the transform attribute.
The rectangle takes width and height from the real button, at every resize and once the font has arrived. The lap uses sine.inOut: it starts gently, keeps the pace, slows on the last stitches.
| Name | File | Default | What it changes |
|---|---|---|---|
JOB | script.js | "Trousers, hem" | The alteration to book (made up). |
PRICE | script.js | 18 | The price, in euros (made up). |
READY | script.js | "Friday" | When it is ready (made up). |
SEW | script.js | 1.5 | How many seconds the needle takes to go round the pill. |
ACCENT | script.js | #d9463e | The colour of the thread. |
OK | script.js | #2f9d6a | The colour once the alteration is booked. |
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. |
On the site of a tailor, a dry cleaner that does repairs or a cobbler, on a garment’s page of a shop that offers hemming, in any made-to-measure service to book.
The same pill, at most as wide as the screen minus the margins: the seam is measured again on the real width. There is no hover, the tap does the same job.
The needle does not run: the stitches appear all together, 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.4 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.