Skip to content
animorio
IT
All components

Page feedback

Ratings, Hover, TransitionsGSAP, CSS onlyEasyCompressed weight: Demo 5.1 KBGSAP 28 KBFreeDownload the zip

The «Was this helpful?» box at the foot of a help page, pared down to a white pill with two small chips, Yes and No: on press the colour of the chosen answer floods out from under the chip and fills the whole pill on a spring, the question steps aside and a drawn tick and the thank-you take its place. «Undo» pours the colour back into the chip it came from.

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>
<!--
  "Page feedback" 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 page feedback that fills from your answer</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">
    <!-- one gesture: the answer you press fills the whole pill and becomes the thank-you -->
    <div class="fb" data-fb role="group" aria-label="Page feedback">
      <span class="fb__fill" data-fill aria-hidden="true"></span>
      <div class="fb__ask" data-ask>
        <span class="fb__q" data-q>Was this helpful?</span>
        <span class="fb__chips">
          <button class="fb__chip" type="button" data-choice="yes"><span class="fb__chipword">Yes</span></button>
          <button class="fb__chip" type="button" data-choice="no"><span class="fb__chipword">No</span></button>
        </span>
      </div>
      <div class="fb__done" data-done aria-hidden="true">
        <svg class="fb__tick" viewBox="0 0 20 20" aria-hidden="true"><path data-tick d="M5 10.4 8.6 14 15.2 6.6"/></svg>
        <span class="fb__thanks" data-thanks>Thanks for the feedback</span>
        <span class="fb__rule" data-rule aria-hidden="true"></span>
        <button class="fb__undo" type="button" data-undo tabindex="-1">Undo</button>
      </div>
      <span class="fb__live" aria-live="polite" data-live></span>
    </div>
  </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

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 “Page feedback” 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, alone in the middle, there is a white pill with a light grey hairline and the faintest shadow: inside, the question «Was this helpful?» and two grey chips, Yes and No. Hovering a chip lifts it by a pixel, darkens it a touch and opens its word up on the width axis. On press the chip gives, and its colour is already underneath: green for Yes, black for No. From there the colour spreads until it fills the whole pill, while the question slides back and the other chip shrinks away. When the colour reaches the edges the pill takes the hit, squashes by a pixel and settles on a spring; meanwhile a tick draws itself, goes a hair too far and comes back, and the thank-you rises in narrow and opens up. Beside it, past a thin rule, sits «Undo»: press it and the thank-you leaves, the colour pours back into the chip it came from and the question returns, with the other chip a beat later. Until someone touches it, the pill answers by itself, once yes and once no.

How it works

The colour under the chip

The fill is a single absolute span inside the pill, which has overflow hidden and a full radius. On press it is placed exactly over the pressed chip, measured with offsetLeft and offsetTop walking up to the pill (those measures ignore running transforms), and the chip turns transparent: it looks as if the chip itself took the colour.

The flood

The fill goes from that box to the whole pill’s by animating left, top, width and height with expo.inOut: it starts slowly, as if the colour were pushing, and reaches the edges decisively. At the end width and height switch to 100%, so resizing the window never leaves it short.

The pill taking the hit

When the colour touches the edges the pill goes to scaleX 1.012 and scaleY 0.965 in 0.12 seconds and back to 1 with elastic.out: that is the one-pixel squash. The tick draws with strokeDashoffset down to minus 0.8, a hair past the end, and returns to zero.

The thank-you coming in narrow

The thank-you rises from 10 pixels below with the wdth axis at 78 and the weight at 420 and lands at 100 and 540 with back.out; the thin rule grows in height and «Undo» arrives from the right last. Both rows sit in the same grid cell, so the pill never changes width.

The way back

Undo walks the same road backwards: it measures the chip at rest, takes the fill back into its box with the same curve and only then turns it off, while the chip gets its grey back; the question and the other chip return with back.out, a tenth of a second apart.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#1f7a57The colour that fills the pill after Yes.
NO_COLORscript.js#0b0c0eThe colour that fills the pill after No.
QUESTIONscript.jsWas this helpful?The question on the pill.
THANKS_YESscript.jsThanks for the feedbackThe line after Yes.
THANKS_NOscript.jsWe will make it betterThe line after No.
SPRINGscript.js1How springy the flood and the pill are: 0.4 calm, 2 very bouncy.
SPEEDscript.js1The speed of everything: 2 twice as fast, 0.5 half.
HOLDscript.js2.4How many seconds the thank-you stays when the pill answers by itself.
AUTOscript.jstrueThe pill answers by itself until someone touches it.

Try them in the Playground

When to use it

At the foot of a help center article, a documentation page or an assistant’s answer: it asks for an opinion in a single tap and says thanks without opening anything.

On phones

On the phone the pill, the chips and the text take their size from the screen (clamp on the shorter side) and fit even at 320 pixels; there is no hover, everything else is the same.

With reduced motion

The colour fills the pill with a fade, without spreading, and the question and the thank-you swap with a fade; no springs or movement.

Pitfalls

  • The chips sit inside a row with position relative: their offsetLeft is measured from there, not from the pill. It has to be summed walking up the offsetParents to the pill, otherwise the colour starts shifted to the left.
  • The fill has to be measured with offsetLeft and offsetWidth, not getBoundingClientRect: during the press the chip is at scale 0.92 and the pill is squashing, so the on-screen box would be smaller than the real one.
  • At the end of the flood the pixel width and height have to be replaced by 100%: turning the phone changes the pill’s width and the colour would stay short on one side.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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