Skip to content
animorio
IT
All components

Resolve comment button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.9 KBGSAP 28 KBFreeDownload the zip

A comment in a document review, on white, in the style of clean product interface pieces: the compact card with a drawn avatar, one line of text and two replies, and below it the Resolve button, 60 pixels tall. On hover the check draws itself in grey and the comment gets a green outline; pressed, the comment crumples in height into a pill and slides into the button, which swallows it, fills green from the icon and becomes «Resolved» with a stroke-drawn check. The button rises to the centre and a small Undo pops out beside it which, pressed, brings the comment back out on a spring.

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>
<!--
  "Resolve comment button" 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 Resolve button that closes the comment</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>
    <!-- one gesture: resolve the thread. The comment crumples in height and slides into the button,
         which widens into Resolved with a drawn check; a small Undo pops out beside it and brings the comment back -->
    <div class="frame" data-inquadra>
      <div class="col" data-col>
        <div class="slot" data-slot>
          <article class="card" data-card aria-label="Comment by Maya Lindqvist">
            <header class="card__head" data-part>
              <span class="av" aria-hidden="true">
                <svg viewBox="0 0 32 32">
                  <defs><clipPath id="av-clip"><circle cx="16" cy="16" r="16"></circle></clipPath></defs>
                  <g clip-path="url(#av-clip)">
                    <rect width="32" height="32" fill="#e7e4fb"></rect>
                    <path d="M4.5 33c1.2-6.6 5.6-10.2 11.5-10.2S26.3 26.4 27.5 33Z" fill="#5a57c9"></path>
                    <path d="M13.3 20.4h5.4v3.6a2.7 2.7 0 0 1-5.4 0Z" fill="#e3b192"></path>
                    <circle cx="16" cy="14.2" r="6.1" fill="#f0c4a5"></circle>
                    <path d="M9.6 15.2C9 9.6 11.9 6.6 16.3 6.6c4.2 0 6.8 2.8 6.3 8.3-1-2.6-3.4-4.6-6.6-4.8-1.7 2.2-4.2 3.6-6.4 5.1Z" fill="#2c2420"></path>
                    <path d="M22.6 14.9c.7 2.6.3 5-1 6.6.4-2 .6-4.2 1-6.6Z" fill="#2c2420"></path>
                  </g>
                </svg>
              </span>
              <span class="card__who"><b>Maya Lindqvist</b><time>2h</time></span>
              <span class="card__tag">Pricing page</span>
            </header>
            <p class="card__text" data-part>Tighten the gap above pricing?</p>
            <footer class="card__replies" data-part data-replies>
              <span class="mini" data-mini>
                <span class="mini__av mini__av--a" title="Jonah Okafor"><svg viewBox="0 0 20 20"><path d="M3 21c.8-4 3.6-6.2 7-6.2s6.2 2.2 7 6.2Z" fill="#e07a52"></path><circle cx="10" cy="8.8" r="3.9" fill="#b97a55"></circle><path d="M6 8.6c-.2-2.8 1.5-4.4 4-4.4s4.3 1.6 4 4.4c-.6-1.2-1.8-1.9-4-1.9S6.6 7.4 6 8.6Z" fill="#231a16"></path></svg></span>
                <span class="mini__av mini__av--b" title="Rosa Vidal"><svg viewBox="0 0 20 20"><path d="M3 21c.8-4 3.6-6.2 7-6.2s6.2 2.2 7 6.2Z" fill="#3d72d6"></path><circle cx="10" cy="8.9" r="3.9" fill="#f3cfb3"></circle><path d="M5.7 10.6C5.3 6.6 7.2 4.5 10 4.5s4.7 2.1 4.3 6.1c-.5-1.6-1-2.6-1.6-3.2-1.6.4-3.6.4-5.4-.4-.8.8-1.3 2-1.6 3.6Z" fill="#c9974e"></path></svg></span>
              </span>
              <span class="card__count">2 replies</span>
              <span class="card__last">· last 12m ago</span>
            </footer>
          </article>
        </div>

        <div class="row" data-row>
          <button class="resolve" type="button" data-resolve aria-pressed="false">
            <span class="resolve__bg" aria-hidden="true"></span>
            <span class="resolve__fill" data-fill aria-hidden="true"></span>
            <span class="resolve__ico" data-ico aria-hidden="true">
              <svg viewBox="0 0 24 24">
                <circle class="ring" data-ring cx="12" cy="12" r="8.6"></circle>
                <path class="tick" data-tick d="M8.3 12.4l2.6 2.6 5-5.4"></path>
              </svg>
            </span>
            <span class="labels" data-labels>
              <span class="label" data-l="resolve">Resolve</span>
              <span class="label" data-l="resolved">Resolved</span>
            </span>
          </button>
          <span class="undo-slot" data-undo-slot>
            <button class="undo" type="button" data-undo tabindex="-1" aria-hidden="true">
              <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M5.6 4.2 3 6.8l2.6 2.6"></path><path d="M3.4 6.8h6a3.4 3.4 0 0 1 0 6.8H7.6"></path></svg>
              <span>Undo</span>
            </button>
          </span>
        </div>
      </div>
      <p class="sr" aria-live="polite" data-live></p>
    </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.

21 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 “Resolve comment button” 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 there is the comment of Maya Lindqvist, made up, on the «Pricing page» of a document: the avatar drawn in SVG, the name, «2h», the line «Tighten the gap above pricing?» and below two replies with their small faces. Hovering the card darkens its border, the two faces part a little and «2 replies» turns black. Below sits the white Resolve pill with an empty circle, 60 pixels tall: on hover it rises a pixel and a half, the check draws itself in grey inside the circle and the comment gets a green outline, as if to say what is about to close; pressed, it squashes and the shadow tightens. On click the comment’s lines fold upwards and vanish, the card crumples in height down to an empty pill, which slides down and tucks itself behind the button. The button swallows it with a squash, the green spreads from the icon, the icon turns a quarter and settles, the check redraws in white and the label rolls to «Resolved»; then the button springs up to the centre and a small «Undo» with a turning-back arrow pops out from behind it. Press Undo and the Undo goes back in, the green withdraws into the icon and the pill comes out of the button, widens back into the card with a bounce and the lines return one after the other. The drawn pointer does it all by itself and stops at the first touch.

How it works

The card leaves the flow

Before moving, the card switches to absolute position at its own size and the container keeps the height: real top, left, width, height and radius can then be animated, with no scale distorting the corners.

The crumple

The lines fold with scaleY 0.8 from the top and fade staggered; the card drops to 34 pixels high keeping its bottom still, then moves to the button’s rectangle, inset by 8 pixels a side, with power3.in, and disappears behind it because the button row has a higher z-index.

The button that swallows

On arrival the button goes to scaleX 1.06 and scaleY 0.9 and springs back with elastic.out; the green is a layer under the label with a clip-path circle growing from the icon’s centre, and the check is a stroke with stroke-dasharray 12 that draws itself.

The row’s FLIP

When the comment leaves, the row would jump to the centre: its top is measured, the comment hidden, the top measured again, and the row starts from the difference and goes to zero with back.out. The same, in reverse, when the comment comes back.

The Undo that pops out

The Undo sits in a zero-width slot next to the button: the slot widens to the Undo’s width plus the gap, so the group recentres by itself, while the Undo comes out from behind the button from x −44 and scale 0.55 on a spring.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#17a05dThe colour of the resolved button, the check and the warning outline.
AUTHORscript.jsMaya LindqvistThe name of the person who wrote the comment.
COMMENTscript.jsTighten the gap above pricing?The comment, on a single line (a long one ends with an ellipsis).
CRUMPLEscript.js0.52The seconds the comment takes to crumple and slide into the button.
BOUNCEscript.js1.6How much the button, the Undo and the returning comment bounce.
HOLDscript.js2.1The seconds the autopilot shows «Resolved» before pressing Undo.

Try them in the Playground

When to use it

For the comments of a document editor, a design tool, a code review, a project tracker or a client portal: anywhere a discussion is closed with a click and you want to be able to take it back.

On phones

The block is 92 per cent of the screen wide up to 340 pixels and 204 tall; under 360 pixels the «Pricing page» tag disappears so the name has room, and a long comment ends with an ellipsis. A tap does what a click does; the hover preview stays for the mouse.

With reduced motion

No crumple, springs or slides: the comment fades out and back in, the green fills the button almost at once, the label changes without rolling, the Undo fades in and the drawn pointer stays hidden.

Pitfalls

  • A fromTo inside a timeline renders its start at once: the check already drawn by the hover vanished the instant of the click and the icon turned before being swallowed. With immediateRender: false they start only at their moment.
  • The green withdrawing by closing its circle towards the icon turns into a solid dot in the last frames: it fades while shrinking and goes back to opaque only once the circle is closed.
  • Animating the card with scaleY squashes its corners and text: the card leaves the flow and its real sizes are animated, while the container keeps its height.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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