Skip to content
animorio
IT
Back to the library

Design comment pins

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

A mockup under review with the comments attached to the design as pins: hovering a pin opens the bubble with who wrote what, on the side where there is room. A click on the design drops a new pin with a bounce and the comment types itself letter by letter; “Resolve” closes it into a green tick and the count rolls.

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>
<!--
  "Design comment pins" 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>Design comment pins</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 mockup under review: the comments are pins on the design, a pin opens its bubble on hover,
         a click on the design drops a new pin, Resolve closes it into a tick -->
    <section class="cp" data-cp aria-label="Design review">
      <header class="cp__head">
        <div class="cp__titles">
          <h1>Landing v4</h1>
          <p class="cp__count"><span data-count>2 comments</span></p>
        </div>
        <button class="cp__add" type="button" data-add><svg viewBox="0 0 14 14" aria-hidden="true"><path d="M7 2.500v9M2.500 7h9"></path></svg>Comment</button>
      </header>
      <div class="cp__canvas" data-canvas>
        <svg class="cp__mock" viewBox="0 0 312 216" preserveAspectRatio="none" aria-hidden="true">
          <defs><linearGradient id="cp-g" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#e4e1ff"></stop><stop offset="1" stop-color="#ffe3d6"></stop></linearGradient></defs>
          <rect x="16" y="15" width="26" height="8" rx="4" fill="#17181d"></rect>
          <rect x="200" y="16" width="26" height="6" rx="3" class="m"></rect><rect x="234" y="16" width="26" height="6" rx="3" class="m"></rect><rect x="268" y="13" width="28" height="12" rx="6" class="m"></rect>
          <rect x="16" y="50" width="120" height="13" rx="4" fill="#17181d"></rect>
          <rect x="16" y="69" width="96" height="13" rx="4" fill="#17181d"></rect>
          <rect x="16" y="94" width="128" height="6" rx="3" class="m"></rect><rect x="16" y="106" width="104" height="6" rx="3" class="m"></rect>
          <rect x="16" y="126" width="62" height="22" rx="11" class="a"></rect>
          <rect x="86" y="126" width="54" height="22" rx="11" class="o"></rect>
          <rect x="166" y="44" width="130" height="112" rx="14" fill="url(#cp-g)"></rect>
          <circle cx="262" cy="74" r="13" fill="#ffffff" opacity="0.7"></circle>
          <path d="M166 142l34-36 26 24 24-18 46 40v-10a14 14 0 0 1-14 14H180a14 14 0 0 1-14-14Z" fill="#ffffff" opacity="0.55"></path>
          <rect x="16" y="176" width="86" height="26" rx="8" class="s"></rect><rect x="113" y="176" width="86" height="26" rx="8" class="s"></rect><rect x="210" y="176" width="86" height="26" rx="8" class="s"></rect>
        </svg>
        <span class="cp__ripple" data-ripple aria-hidden="true"></span>
        <div class="cp__bubble" data-bubble role="status">
          <p class="cp__who"><b data-who>Mara K.</b><span data-when>2 h</span></p>
          <p class="cp__msg"><span data-msg></span></p>
          <button class="cp__resolve" type="button" data-resolve><svg viewBox="0 0 14 14" aria-hidden="true"><path d="M3 7.300l2.700 2.700L11 4.300"></path></svg>Resolve</button>
        </div>
      </div>
      <span class="cp__say" data-say aria-live="polite"></span>
    </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.

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 “Design comment pins” 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 pale grey: at the top “Landing v4”, “2 comments” and the “Comment” button; below, a white card holding a drawn page (menu, a two-line headline, two buttons, a gradient image, three tiles). On the design, two purple pins with initials, “MK” and “JO”, dropped at the opening with a bounce. Hover a pin and it grows while a dark bubble opens beside it, starting from its point: the name, how long ago, the comment and “Resolve”. The bubble goes right or left, where there is room, and above if there is none. A click on an empty spot of the design drops a new pin, which squashes slightly and leaves a ring on the page; the count rolls into “3 comments” and in the bubble the comment types itself, with a caret. With “Resolve” the pin turns green, the initials make way for a tick drawing itself, then the pin withdraws into its point and the count returns to “2 comments”.

How it works

Pins in percentages

Each pin is a button placed with left and top as percentages of the card: its point is the bottom left corner, and it scales from there (transform-origin 0% 100%).

The bubble

There is only one: on opening it takes the pin’s texts, measures where there is room (right, left, above) and grows on a spring from the spot nearest the pin.

The new pin

It drops with bounce.out from 40 pixels higher, settles in scale and a ring widens on the spot; then a tween on a number types the comment one letter at a time.

Resolve

The initials become a tick drawn with the dashoffset, the colour goes green with a transition and the pin scales to zero towards its point.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#6a5cf6The colour of the pins and of the mockup’s button.
DONEscript.js#1fb86cThe colour of the resolved pin.
AUTHORscript.jsAda R.Who writes the new comments: the initials go into the pin.
NOTEscript.jsThree cards feel crowded on mobile.The new comment that types itself in the demo.
TYPEscript.js22How many letters per second it types.
SPRINGscript.js1How much the pins and the bubble bounce: 0.3 = a little, 2 = a lot.
LOOPscript.jstrueLeft alone, the demo’s pointer reads the two comments, leaves a new one and resolves it.

Try them in the Playground

When to use it

In tools where a piece of work is reviewed together: mockups and prototypes, page previews, PDFs, photos, floor plans, videos paused on a frame. On a studio’s or an agency’s site, to show how work with clients goes.

On phones

The same card, 312 pixels wide and 216 tall at most: the pins follow the design because they are in percentages, the bubble opens on tap and moves to the side where there is room.

With reduced motion

The pins appear in place without dropping, the bubble fades in, the new comment is already written and the resolved pin vanishes at once. The demo does not move by itself.

Pitfalls

  • The comments and the people are made up, and the new one types itself: in a real app the bubble holds a text field and the pin only stays if the comment is sent.
  • The pins carry the writer’s initials, not an order number: that way it stays clear whose comment it is even when one in the middle is resolved.
  • The bubble’s position is in pixels: it has to be recomputed on resize while it is open.
  • From the keyboard the pins are buttons and focus opens the bubble; the “Comment” button leaves a pin at a preset spot, because the click on the design cannot be done with keys.
  • The hover that opens the bubble only applies where there is a pointer; on a phone it opens on tap and closes by tapping the design.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 23 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