
The elastic button
Buttons, Hover, Text
A comment in a team app, on white, with two violet @mentions: rest on one and the profile card grows out of the word itself on a short spring, its shadow spreading, with avatar, name, role, local time and numbers arriving inside. Follow turns into Following with a tick drawing itself and one more follower rolling up; moving to the other mention the card glides over and changes person on the way, and it closes on its own shortly after the pointer leaves.
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>
<!--
"Mention profile 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>The profile card that opens from a mention</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>
<!-- a comment in a team app: hovering a mention grows a profile card out of the word itself -->
<article class="comment" data-comment aria-label="Comment in Loomwell">
<header class="comment__head">
<span class="comment__me" aria-hidden="true">RL</span>
<span class="comment__who">Rhea Lind</span>
<span class="comment__when">2 min ago</span>
<span class="comment__where">Onboarding v2</span>
</header>
<p class="comment__text">
Merged the new onboarding.
<button class="mention" type="button" data-mention="maya" aria-haspopup="dialog" aria-expanded="false"><span class="mention__bg" aria-hidden="true"></span><span class="mention__txt">@maya</span></button>
can you check the empty states? And
<button class="mention" type="button" data-mention="tomas" aria-haspopup="dialog" aria-expanded="false"><span class="mention__bg" aria-hidden="true"></span><span class="mention__txt">@tomas</span></button>
the icons look great, ship them on Friday.
</p>
<footer class="comment__foot">
<span>Reply</span><span>Resolve</span><span class="comment__app">Loomwell</span>
</footer>
</article>
<div class="pop" data-pop role="dialog" aria-label="Profile" aria-hidden="true">
<div class="pop__card" data-card>
<div class="pop__body" data-body>
<div class="pop__top">
<span class="avatar" data-avatar><span class="avatar__ring" aria-hidden="true"></span><span class="avatar__ini" data-ini>MO</span></span>
<span class="pop__status" data-status>In a meeting</span>
</div>
<p class="pop__name" data-name>Maya Okoye</p>
<p class="pop__role" data-role>Product designer</p>
<p class="pop__place">
<svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5.6"></circle><path d="M8 5v3.2l2 1.3"></path></svg>
<span data-place>Lisbon, 9:42 am local</span>
</p>
<div class="pop__stats">
<span class="stat"><span class="stat__num" data-followers><span class="roll" data-roll><span data-a>1,284</span><span data-b>1,285</span></span></span><span class="stat__lab">followers</span></span>
<span class="stat"><span class="stat__num" data-docs>86</span><span class="stat__lab">docs</span></span>
</div>
</div>
<div class="pop__actions">
<button class="btn btn--follow" type="button" data-follow>
<span class="btn__fill" aria-hidden="true"></span>
<svg class="btn__tick" viewBox="0 0 16 16" aria-hidden="true"><path data-tick d="M3.6 8.4 6.6 11.2 12.4 4.9"></path></svg>
<span class="btn__lab" data-follow-lab>Follow</span>
</button>
<button class="btn btn--msg" type="button" data-msg>
<svg class="btn__icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 4.2h10v6.4H7.4L4.6 13v-2.4H3z"></path></svg>
<span class="btn__lab" data-msg-lab>Message</span>
</button>
</div>
</div>
</div>
<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.
39 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 “Mention profile card” from Animorio and fit it into my siteGSAP moves the card’s container with x and y, below the mention or above when there is no room below, always inside the stage; the card inside has its transform-origin set exactly on the centre of the mention, so the scale from 0.5 to 1 with back.out looks like it comes out of the word. One element for position and one for scale, so the two transforms never cancel each other.
The shadow is written in the CSS with a variable, --o, multiplying offset, blur and opacity: GSAP takes the variable from 0 to 1 a little slower than the scale, and the card seems to lift off the page as it settles.
Opening waits a moment with a gsap.delayedCall, so that rushing over a mention opens nothing; leaving starts another delayedCall to close, which is cancelled if the pointer enters the card or returns to the mention. If the card is already open on the other mention it does not close: it glides with power3.out and its content leaves, changes and comes back staggered.
The button’s black is a separate layer that withdraws, the tick is a path drawing itself with stroke-dashoffset, and the number sits in a one-line window holding the value and the value plus one, stacked: Following slides them by half their height with back.out. The press squashes the button to 95% and releases it with elastic.out.
A drawn pointer follows a timeline rebuilt on every loop from the real positions of the mention and the buttons: it opens the first card, follows, goes to the second mention, presses Message, leaves and lets it close. At the first real touch or movement it stops; after eight quiet seconds it starts again.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #4f46e5 | The colour of the mention and the avatar’s ring. |
OPEN_DELAY | script.js | 0.12 | The seconds over the mention before the card opens. |
CLOSE_DELAY | script.js | 0.3 | The grace seconds before the card closes. |
OPEN_TIME | script.js | 0.46 | How long the spring that grows the card out of the word lasts. |
BOUNCE | script.js | 1.6 | How far the card overshoots its size before it settles. |
GLIDE_TIME | script.js | 0.5 | How long the card takes to glide from one mention to the other. |
For comments and chats in a team app, mentions in a shared document, author names on a blog or a magazine, the member list of a community.
In the short box the comment moves to the top and the card gets more compact, so it always opens under the mention without covering it; the position is worked out again on every resize. Tapping the mention opens and closes, a tap outside closes.
The card fades in and out already in place, without scaling or gliding; the number changes without rolling, the tick appears without drawing and the drawn pointer is hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.1 KB; the libraries: GSAP 28 KB.
Tested on 25 October 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.