Skip to content
animorio
IT
All components

Mention profile card

Cards, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.1 KBGSAP 28 KBFreeDownload the zip

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.

The code

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>

Playground

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

Or ask your AI assistant for it

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 site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a white background there is Rhea Lind’s comment in Loomwell, an invented team app: «Merged the new onboarding. @maya can you check the empty states? And @tomas the icons look great, ship them on Friday.», with both mentions in violet. Rest on a mention and, after a moment, a pale violet lozenge lights up under the word and the profile card grows out of it: it scales from the mention on a spring that goes just past its size, its shadow spreading as it settles, and the content arrives line by line. There is the avatar with initials and a thin ring opening out, the status (In a meeting, Focusing), the name, the role, the city with local time, followers and docs, and two buttons. Follow, in black, squashes when pressed and comes back on an elastic: the black withdraws, a tick draws itself, the label becomes Following and the follower count rolls up by one, briefly coloured. Message says Draft open for a moment. If the pointer enters the card it stays open; moving to the other mention it glides over and changes person on the way; leaving, it closes after a short grace period, shrinking back towards the word. A drawn pointer does it all by itself and starts again; it also really works, with the mouse, with touch (tap the mention to open, outside to close) and with the keyboard (Tab, Enter, Esc).

How it works

A card born from the word

GSAP 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 that spreads

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.

Open, stay, close

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.

Follow and the rolling number

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.

The autopilot

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.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#4f46e5The colour of the mention and the avatar’s ring.
OPEN_DELAYscript.js0.12The seconds over the mention before the card opens.
CLOSE_DELAYscript.js0.3The grace seconds before the card closes.
OPEN_TIMEscript.js0.46How long the spring that grows the card out of the word lasts.
BOUNCEscript.js1.6How far the card overshoots its size before it settles.
GLIDE_TIMEscript.js0.5How long the card takes to glide from one mention to the other.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • With scale and position on the same element, gliding from one mention to the other cancelled the opening spring: the container moves, the card inside scales.
  • Without the opening delay, moving the mouse across the text to go elsewhere opened cards in bursts; without the closing grace, crossing the few pixels between the word and the card closed it.
  • The transform-origin has to be worked out every time, because the card shifts sideways to stay inside the stage and the centre of the mention is no longer its own centre.

Libraries

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.

Testing

Tested on 25 October 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All components