Skip to content
animorio
IT
All components

Hold to applaud button

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

A dark pill button for the end of an article: a tap is one clap, holding it down brings claps faster and faster. At every clap the two hands meet and come back on a spring, golden dashes burst round them, a ring fills towards the maximum, the count on the right goes up and a bubble above says how many are yours. On release the bubble flies off and the label says thanks.

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>
<!--
  "Hold to applaud 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>Applaud button to press and hold with the count that climbs</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">
    <!-- an applause button for the end of an article: a tap is one clap, holding it down claps faster and faster; at
         every clap the two hands meet and spring back, short lines burst round them, a ring fills towards the most
         you can give, the count on the right goes up and a small bubble above says how many are yours -->
    <button class="clap" type="button" data-clap aria-label="Applaud this article">
      <span class="clap__body" aria-hidden="true"><span class="clap__warm" data-warm></span><span class="clap__light"></span></span>
      <span class="clap__edge" aria-hidden="true"></span>

      <span class="seat" data-seat aria-hidden="true">
        <svg class="seat__ring" viewBox="0 0 54 54"><circle class="seat__track" cx="27" cy="27" r="25"></circle><circle class="seat__arc" data-ring cx="27" cy="27" r="25" pathLength="1"></circle></svg>
        <svg class="seat__burst" data-burst viewBox="0 0 54 54"><path d="M27 4.5V0.5M9.6 10.4 6.8 7.6M44.4 10.4l2.8-2.8M3.8 25H0M54 25h-3.8"></path></svg>
        <span class="seat__disc">
          <svg viewBox="0 0 24 24">
            <g data-hand="l"><rect x="3.2" y="11.4" width="3.8" height="5.8" rx="1.9" transform="rotate(-26 5.1 14.3)"></rect><rect x="6.2" y="5.4" width="5.4" height="13.4" rx="2.7"></rect><path d="M8.9 8.6v3.2"></path></g>
            <g data-hand="r"><rect x="17" y="11.4" width="3.8" height="5.8" rx="1.9" transform="rotate(26 18.9 14.3)"></rect><rect x="12.4" y="5.4" width="5.4" height="13.4" rx="2.7"></rect><path d="M15.1 8.6v3.2"></path></g>
          </svg>
        </span>
      </span>

      <span class="label"><span class="label__word" data-word>Applaud</span></span>
      <span class="total"><span data-total>248</span></span>

      <span class="mine" data-mine aria-hidden="true"><span data-mine-n>+1</span></span>
    </button>
    <p class="sr" data-live aria-live="polite"></p>

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

16 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 “Hold to applaud 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

In the middle, on black, a dark pill 60 pixels tall with an edge that catches light: on the left, in a round seat, two hands drawn in line, open in a V; then the label ‘Applaud’ and on the right the number of claps, 248. The pointer arrives, the pill lifts by a pixel and a soft light follows it. One tap: the hands close and open again with a bounce, five golden dashes burst round the seat and fade, the number hops and becomes a golden 249, the hands take the gold colour, a ring starts filling round the seat and above a golden bubble with ‘+1’ springs up. Holding down, the pill stays squeezed and the claps come by themselves, slow at first then fast: the bubble jolts and counts, the ring grows, the pill warms with a golden light from the hands’ side and the label rolls to ‘Keep holding’. At the maximum the pill shakes its head and says ‘That is the most’. On release it comes back on a spring; a moment later the label says ‘Thank you’, the bubble rises and fades, and then ‘Applaud’ returns, with the count kept. Left alone, a pointer gives one clap, then holds, and after a while everything goes back to 248.

How it works

One clap

clap() does everything for a single clap: the two SVG groups of the hands rotate from OPEN degrees to zero in 70 milliseconds and return with elastic.out; the dashes scale from 0.72 to 1.16 and fade; number, bubble and ring advance by one.

Holding down

On pointerdown the first clap goes and a gsap.delayedCall prepares the next: the wait starts at SLOW and at every clap is multiplied by 0.84, down to FAST. On release the pending call is cancelled.

The heat

One variable, from 0 to 1 (your claps divided by MAX), drives the ring, the golden veil inside the pill and the coloured shadow below: the more you clap, the more the button lights up.

The bubble and the thanks

The bubble comes in once on a spring, then only jolts at each clap. Seven tenths of a second after the last clap a timeline changes the label to THANKS, makes the bubble rise and fade and puts the first label back.

From the keyboard too

Space and Enter do the same: keydown starts (ignoring the key’s auto-repeat), keyup ends.

Values to change

NameFileDefaultWhat it changes
TOTALscript.js248The claps the article already has.
MAXscript.js30How many claps one person can give.
SLOWscript.js0.3Holding down: the seconds between the first claps.
FASTscript.js0.07Holding down: the seconds between claps at full speed.
ACCENTscript.js#ffc94dThe colour of the applause.
OPENscript.js18By how many degrees the hands are open at rest.
THANKSscript.jsThank youThe label after the applause.
LOOPscript.jstrueLeft alone, a pointer tries it by itself.

Try them in the Playground

When to use it

At the bottom of an article on a blog, an online magazine or a newsletter, instead of the usual like: readers can say how much they liked it, not just whether. Also good under a portfolio project or a recipe.

On phones

The same button, to hold with a finger: the long-press menu is turned off on the button and the text cannot be selected. No light following the pointer.

With reduced motion

The hands do not move and the dashes do not burst: at each clap only the number, the bubble (with a fade) and the ring change. The pill does not squeeze.

Pitfalls

  • On a phone a long press opens the system menu and selects text: user-select none, touch-action manipulation and a stopped contextmenu on the button are needed.
  • A finger leaving the button while pressing must stop the claps: besides pointerup, pointerleave, pointercancel and blur are listened to.
  • The hands rotate round the base of the palm (svgOrigin at the bottom), not round their centre: otherwise they look like two wipers.

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