Skip to content
animorio
IT
All components

Social post share fan

Cards, Hover, SVGGSAP, CSS onlyMediumCompressed weight: Demo 6.7 KBGSAP 28 KBFreeDownload the zip

A social post in a white card, with a Share button that opens its four channels in a fan above itself: copy link, message, email, repost. The chosen channel drops back into the button, which turns violet, says what happened and bumps the share count by one.

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>
<!--
  "Social post share fan" 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>Social post share fan</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">
    <!-- a social post whose Share button opens its channels in a fan above itself: pick one and it flies
         back into the button, the label says what happened and the share count goes up by one -->
    <article class="post" data-post>
      <div class="post__body" data-body>
        <header class="post__head">
          <span class="post__avatar" aria-hidden="true">MI</span>
          <span class="post__who"><b>Mara Ilves</b><span>@mara.outside, 2h</span></span>
        </header>
        <p class="post__text">Finally mapped the whole ridge loop. Fourteen kilometres, two river crossings, zero signal. Route notes are up.</p>
        <p class="post__tags"><span>Trail notes</span><span>14 km</span></p>
      </div>
      <footer class="post__bar">
        <span class="post__stat" data-body>
          <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 19.500s-6.800-4.100-6.800-9.100A3.700 3.700 0 0 1 12 8.300a3.700 3.700 0 0 1 6.800 2.100c0 5-6.800 9.100-6.800 9.100Z"></path></svg>128
        </span>
        <span class="post__stat" data-body>
          <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 6.500h14v9.500h-7.500L8 19v-3H5Z"></path></svg>24
        </span>
        <span class="post__share">
          <span class="post__fan" data-fan></span>
          <button class="post__btn" type="button" data-share aria-expanded="false" aria-label="Share this post">
            <span class="post__icons" aria-hidden="true">
              <svg data-icon="share" viewBox="0 0 24 24"><path d="M12 14.500V4.500M8.300 8 12 4.300 15.700 8M6 12.500v5.300A1.700 1.700 0 0 0 7.700 19.500h8.600A1.700 1.700 0 0 0 18 17.800v-5.300"></path></svg>
              <svg data-icon="close" viewBox="0 0 24 24"><path d="M7 7l10 10M17 7 7 17"></path></svg>
              <svg data-icon="done" viewBox="0 0 24 24"><path d="M6 12.600 10.300 16.800 18 8"></path></svg>
            </span>
            <span class="post__roll"><span data-count>31</span></span>
          </button>
        </span>
      </footer>
      <span class="post__say" data-say aria-live="polite"></span>
    </article>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.

18 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Social post share fan” 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 white, a post’s card: the disc with initials, name and handle, three lines about a mountain loop, two tags, and below the row of numbers: likes, comments and on the right the Share pill with its count, 31. On press the pill turns dark, the arrow spins into a cross, the rest of the post steps back and four white discs leave from under the button for their places on an arc, one after the other, with a bounce: copy link right above, then message, email and repost towards the left. On hover each disc turns dark, grows a little and shows its name. Pick one and the others fold while the chosen one drops back into the button: the pill turns violet with a tick, jolts, and in place of the number it says what happened, “Link copied” or “Reposted”; a moment later it is light again and the count is one higher. A tap outside or Esc closes the fan without sharing.

How it works

The fan is an arc

Each channel has an angle: the first sits almost straight above the button, the others open to the left in equal steps. Cosine and sine of the angle times the radius give the place; change radius and spread and the fan redraws.

They all leave from under the button

The discs sit at a point in the middle of the button, behind it. GSAP throws them to their places on an elastic spring offset by a few hundredths, and calls them back in reverse order.

The chosen channel drops back

On a choice the others fold quickly and the chosen one returns to the button, accelerating; only when it lands does the pill change colour, jolt and roll its label, so the count seems to rise under its weight.

A real menu

The button has aria-expanded, the channels are buttons with their names and can be tabbed to only while the fan is open; Esc closes it and returns focus to the button.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#7a4dffThe colour of the button after a share and of the avatar.
RADIUSscript.js88How far from the button the channels open, in pixels.
SPREADscript.js108How wide the fan is, in degrees.
BOUNCEscript.js1How much the channels bounce as they open: 0.3 = stiff, 2 = very springy.
LOOPscript.jstrueLeft alone, the demo’s pointer opens the fan and picks a channel.

Try them in the Playground

When to use it

In the feed of a social network or community, under a personal blog post, on an event or recipe card. The same fan suits any button with a few close actions: add, react, export.

On phones

The same card, as wide as the screen. The discs are 46 pixels wide and well apart, so a thumb hits them; a tap outside closes the fan.

With reduced motion

The channels appear already in place and vanish at once, the pill changes colour and label with no bounce, and the count goes up right away. The demo does not move by itself.

Pitfalls

  • Person, post and numbers are made up; the channel icons are drawn by us and generic, not logos of real services.
  • The button sits on the right of the card: the fan opens above and to the left, never towards the edge, or the discs would leave a phone screen.
  • Closed discs stay in the DOM: they must leave the Tab order (tabindex -1) and be hidden with visibility, or the keyboard lands on invisible buttons.
  • The button’s bounce is GSAP’s: a CSS transition on the same element’s transform would chase every frame and make it mushy.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 6.7 KB; the libraries: GSAP 28 KB.

Testing

Tested on 20 November 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