Skip to content
animorio
IT
Back to the library

Post insights

SVG, HoverGSAP, CSS onlyMediumCompressed weight: Demo 5.6 KBGSAP 28 KBFreeDownload the zip

How one post did over a week. On top the reach, counting up to 18,420 accounts. Below, the seven-day line of the chosen reaction and the four reactions as bars: Likes, Comments, Shares, Saves. Move from one to another and the line is not redrawn: each of its points slides to the new height, one after the other, and it changes colour; the label of the best day follows.

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>
<!--
  "Post insights" 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>Post insights</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 insights of one social post: the reach counts up, four reactions as bars, and a seven-day line
         that changes shape as you move from one reaction to another -->
    <section class="pi" data-pi aria-label="Post insights">
      <header class="pi__head">
        <span class="pi__thumb" aria-hidden="true"></span>
        <div class="pi__meta">
          <h2 class="pi__title">Studio tour</h2>
          <p class="pi__sub">Video · posted 7 days ago</p>
        </div>
        <div class="pi__reach">
          <output class="pi__big" data-reach>0</output>
          <span class="pi__small">accounts reached</span>
        </div>
      </header>

      <div class="pi__chart">
        <svg viewBox="0 0 300 84" preserveAspectRatio="none" aria-hidden="true">
          <defs><linearGradient id="pi-fill" x1="0" y1="0" x2="0" y2="1"><stop offset="0" class="pi__stop-a"></stop><stop offset="1" class="pi__stop-b"></stop></linearGradient></defs>
          <path class="pi__area" data-area></path>
          <path class="pi__line" data-line></path>
        </svg>
        <span class="pi__peak" data-peak></span>
        <div class="pi__days" aria-hidden="true"><span>Sat</span><span>Sun</span><span>Mon</span><span>Tue</span><span>Wed</span><span>Thu</span><span>Fri</span></div>
      </div>

      <div class="pi__rows" data-rows role="radiogroup" aria-label="Reaction"></div>
    </section>

    <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.

20 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 “Post insights” 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 light ground, a white card: the post’s thumbnail (a coral and violet gradient), the title “Studio tour”, when it went out and, on the right, the reach, which on opening counts from zero to 18,420. In the middle a panel with a smooth line over seven days, a veil of colour beneath and a dark label on the best day (“610 likes”). Below, four rows: the reaction’s name, a bar as long as its share of the total and the number, all counting and growing together at the start. Hover Comments and the row lights up, while in the chart the line’s seven points go to the comments’ heights one after the other, with a wobble that dies away; line and veil go from violet to coral and the label slides to the new best day. The same for Shares and Saves, each with its colour and its shape.

How it works

One line for four series

The path is worked out every frame from seven heights between 0 and 1, with a Catmull-Rom spline. Changing reaction means taking those seven heights to the new values: the shape changes with no jump.

One point after another

Each height has its own tween, three hundredths of a second later than the one before, on an elastic: the line moves like a rope shaken from the left.

Each series on its own scale

Likes are in the hundreds and shares in the tens: each series is divided by its maximum, so all use the chart’s height; the real value is given by the peak label.

Rows that are buttons

The four reactions are a radiogroup: with a mouse just hover, with a finger tap, with the keyboard use the arrows.

Values to change

NameFileDefaultWhat it changes
REACHscript.js18420How many accounts the post reached: the big number that counts at the start.
MORPHscript.js0.8How many seconds the line takes to change shape from one reaction to another.
SPRINGscript.js1How elastic the line is when it changes: 0.3 = stiff, 2 = very elastic.
LOOPscript.jstrueLeft alone, the demo’s pointer moves over the four reactions.

Try them in the Playground

When to use it

On a post’s page inside a social tool, in the weekly summary of a marketing dashboard, on a creator’s profile. The shape-changing line suits any place where a few series over the same period are compared.

On phones

The same card, as wide as the screen: the chart stretches horizontally without distorting the line’s thickness, and the four rows are tapped to change reaction.

With reduced motion

Numbers and bars are already at their values; on a new reaction the line and label jump straight to the new shape. The demo does not move by itself.

Pitfalls

  • All the numbers are made up. Each series is on its own scale: fine for seeing the trend, not for comparing the heights of two reactions; that is what the bars are for.
  • The svg stretches with preserveAspectRatio none: without vector-effect: non-scaling-stroke the line would get thicker horizontally.
  • The peak label is placed in pixels over the svg: work it out again on resize and when the font arrives.
  • With a very elastic line the points briefly pass the edge: the panel has room on top and the svg does not clip.
  • On hover the reaction changes at once: on a long list you need a small delay, or crossing it makes the chart dance.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 21 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 animations