
The star rating
Ratings, SVG, Hover
The Follow button on an invented photographer’s profile, on white: three round avatars that are tiny landscape photos, the follower count and the black pill. Pressed, the pill squeezes and turns light on «Following» with a blue check that draws itself, the counter’s digits roll one by one to the next number, and the avatar row opens to let yours in, with a «You» tag. On a second click the «Unfollow?» question opens inside the pill with two buttons, and everything goes back.
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>
<!--
"Follow button with avatars" 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>The Follow button with the avatar row that makes room for yours</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" data-stage>
<!-- the Follow row of a film photographer's profile: who follows, how many, and the pill -->
<div class="fit" data-fit>
<div class="row" data-row role="group" aria-label="Ines Marlow, film photographer">
<div class="stack" data-stack aria-hidden="true">
<span class="av av--me" data-me><span class="av__photo"></span><span class="tip" data-tip>You</span></span>
<span class="av av--a" data-friend><span class="av__photo"></span></span>
<span class="av av--b" data-friend><span class="av__photo"></span></span>
<span class="av av--c" data-friend><span class="av__photo"></span></span>
</div>
<div class="count" data-countbox>
<span class="count__num" data-num aria-hidden="true"></span>
<span class="count__label">followers</span>
<span class="sr" data-numtext></span>
</div>
<div class="slot" data-slot>
<div class="pill" data-pill>
<div class="pill__body" data-body>
<span class="pill__paper" data-paper aria-hidden="true"></span>
<span class="pill__ink" data-ink aria-hidden="true"></span>
<span class="pill__shine" aria-hidden="true"></span>
<button class="pill__hit" type="button" data-hit data-autoclic aria-pressed="false" aria-label="Follow Ines Marlow"></button>
<span class="face face--follow" data-face="follow" aria-hidden="true">
<span class="face__in">
<svg class="ico ico--plus" data-plus viewBox="0 0 16 16"><path d="M8 3v10M3 8h10"/></svg>
<span class="face__word" data-word>Follow</span>
</span>
</span>
<span class="face face--following" data-face="following" aria-hidden="true">
<span class="face__in">
<svg class="ico ico--check" viewBox="0 0 16 16"><path data-check d="M3.2 8.4 6.6 11.6 12.8 4.6"/></svg>
<span class="face__word" data-word>Following</span>
</span>
</span>
<span class="face face--confirm" data-face="confirm">
<span class="face__in">
<span class="face__ask" data-ask>Unfollow?</span>
<button class="mini mini--no" type="button" data-no aria-label="Keep following" tabindex="-1">
<svg class="mini__ring" viewBox="0 0 40 40" aria-hidden="true"><circle data-ring cx="20" cy="20" r="18.5"/></svg>
<svg class="ico ico--x" viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 4.5l7 7M11.5 4.5l-7 7"/></svg>
</button>
<button class="mini mini--yes" type="button" data-yes tabindex="-1">Yes</button>
</span>
</span>
</div>
</div>
</div>
</div>
</div>
<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.
26 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 “Follow button with avatars” from Animorio and fit it into my siteEvery digit is a 24 pixel window on a strip with 0-9 repeated twice. To go up from 9 to 0 it moves to position 10 and is then put back at 0 unseen; to go down it starts from 10. Only the changed digits roll, right to left with a stagger, with back.out for the pixel too far and a soft mask above and below.
The pill is a layer that grows from the right inside its slot in the row, which grows with it so nothing overlaps: the three faces (Follow, Following, the question) sit on top of each other and their widths are measured from the words with offsetWidth, which ignores the scale. The black and the light fill are two layers fading into each other, so the colour change never touches the width spring.
The click gesture lives on an inner element: scaleX drops to SQUEEZE in 0.13 seconds and comes back with elastic.out, while the width arrives on its own spring. One element for the width, its child for the scale, so GSAP never mixes the two transforms.
The avatars are absolute and move with x: first a little past their new place, then back on a spring, staggered; yours drops in from above with back.out and a ring in a CSS variable that widens and fades. Every avatar is a horizon in linear-gradient with a sun in radial-gradient, no face.
The question lives inside the pill: the main button stops taking the pointer, focus moves to the round button, Esc closes, the round button’s ring runs down with stroke-dashoffset and closes by itself at the end. aria-pressed, aria-expanded and aria-live tell the state. The pilot’s drawn pointer follows, waits, asks to unfollow and says yes; at the first real touch it stops and starts again after six quiet seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
FOLLOWERS | script.js | 24819 | How many followers the photographer has before the click. |
ACCENT | script.js | #2f5bff | The accent colour: the check, your avatar and the focus ring. |
SQUEEZE | script.js | 0.9 | How much the pill squeezes on click (1 not at all). |
SPRING | script.js | 0.42 | How much the pill bounces after the squeeze (lower is springier). |
ROLL_STAGGER | script.js | 0.09 | Seconds between one rolling digit and the next. |
STEP | script.js | 26 | Step in pixels between one avatar and the next in the row. |
CONFIRM_TIME | script.js | 4 | Seconds the «Unfollow?» question stays open. |
PRESS_SCALE | script.js | 0.955 | How far the pressed pill sinks. |
On a creator’s profile on a social app, a photography platform, a portfolio with a community, a blog or a podcast: the button to follow. The question inside the pill avoids unfollowing by mistake without opening a dialog.
The same animation: if the screen is narrower than the row, the whole row scales down in proportion (worked out again on resize). A tap is the click; hover is not needed.
Nothing moves: the pill changes width without a spring or a squeeze, faces and avatars fade in at their place, the digits change in one step with a fade, the «You» tag appears and fades; the pilot’s pointer is hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.6 KB; the libraries: GSAP 28 KB.
Tested on 11 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.