Skip to content
animorio
IT
All components

Send test webhook button

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

A dark pill button for the settings of a developer app: pressed, the label rolls to the event name and a green light leaves the sign, runs along the top edge to the far end (the request) and comes back along the bottom (the answer), while a chip counts the milliseconds. When it lands, green floods the pill from the sign, the hook becomes a tick and the label says ‘200 OK’; after a moment it is ready to send again.

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>
<!--
  "Send test webhook 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>Send test webhook button with a light running round the edge and the 200 that comes back</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 button that sends a test webhook: pressed, the label rolls to the event name and a light leaves the hook
         sign, runs along the top edge to the right (the request) and comes back along the bottom (the answer) while
         a small chip counts the milliseconds; when it lands the pill floods with green from the sign, the hook
         becomes a tick and the label says 200 OK; after a moment it is ready to send again -->
    <button class="hook" type="button" data-hook>
      <span class="hook__body" aria-hidden="true">
        <span class="hook__flood" data-flood></span>
        <span class="hook__light"></span>
      </span>
      <span class="hook__edge" aria-hidden="true"></span>
      <svg class="hook__run" data-run-box aria-hidden="true"><rect data-run pathLength="100"></rect><rect class="hook__run-glow" data-run-glow pathLength="100"></rect></svg>

      <span class="sign" data-sign aria-hidden="true">
        <svg viewBox="0 0 24 24">
          <g data-sign-hook>
            <path d="M9.2 8.6a3.4 3.4 0 1 1 5.9 2.2l2.6 4.5"></path>
            <path d="M17.7 15.3a3.4 3.4 0 1 1-3.4 3.4H8.6"></path>
            <path d="M8.6 18.7a3.4 3.4 0 1 1-2.2-5.9l2.9-4.6"></path>
          </g>
          <path class="sign__tick" data-sign-tick pathLength="1" d="M6.4 12.6 10.4 16.6 17.8 8"></path>
        </svg>
      </span>

      <span class="label"><span class="label__word" data-word>Send test webhook</span></span>

      <span class="time" data-time aria-hidden="true"><span data-ms>0</span> ms</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.

17 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 “Send test webhook 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 white, a dark pill 60 pixels tall with an edge that catches light from above: on the left, in a round seat, the webhook sign (three hooks chasing each other), then the label ‘Send test webhook’. The pointer arrives, the pill lifts by a pixel and a soft light follows it; on press it squeezes slightly and comes back on a spring. The label rolls up and ‘POST order.created’ arrives, narrower; on the right a chip opens on a spring and counts the milliseconds. Meanwhile the sign turns on itself and a green light, with its glow, leaves the sign’s side, runs along the top edge to the right end, stays for a breath and comes back along the bottom edge. When it returns, green floods the pill from the sign, the hook closes and a white tick draws itself in its place, the pill and the chip give a small elastic kick, the shadow turns green and the label says ‘200 OK’, with ‘84 ms’ in the chip. After a couple of seconds the green pulls back, the chip closes, the hook returns with half a spin and the label is ‘Send test webhook’ again. Left alone, a pointer tries it again from the start; with a real hand the button answers every click.

How it works

The edge as a path

Over the pill sits an SVG rectangle as big as the pill, with round corners and pathLength 100: its path starts top left and goes clockwise. The light is a dash 13 hundredths long, moved with stroke-dashoffset; a thicker blurred copy makes the glow.

Out and back

From the pill’s size the code works out at what percentage of the path the two round ends fall. The light goes from the left end to the right one along the top, stays there for 12% of the time and comes back along the bottom: three tweens on the same variable, in one timeline.

The chip and the count

The milliseconds chip is measured once at its natural width and opens from zero with elastic.out; the number rises linearly to LATENCY in 86% of the trip, so it reaches the value a moment before the answer.

The answer

A green circle bigger than the pill, centred on the sign and clipped by the body, scales from 0 to 1: the colour seems to come out of the sign. The hook shrinks and goes, the tick draws itself with stroke-dashoffset, the label rolls to ‘200 OK’.

Ready again

After HOLD seconds the button goes back to its first state by itself: it is an action, not a switch. A click while the light is running does nothing; a click on the answer starts another send at once.

Values to change

NameFileDefaultWhat it changes
EVENTscript.jsPOST order.createdWhat is sent: read while the light runs.
ANSWERscript.js200 OKThe answer that comes back.
LATENCYscript.js84The milliseconds counted in the chip.
ACCENTscript.js#19b36bThe colour of the good answer.
TRIPscript.js1.5How many seconds the light’s trip takes, out and back.
SPRINGscript.js0.8How long the spring of the milliseconds chip lasts, in seconds.
HOLDscript.js2.4How many seconds the answer stays before the button is ready again.
LOOPscript.jstrueLeft alone, a pointer tries it by itself.

Try them in the Playground

When to use it

For the integrations or webhooks page of a developer app, an online shop or an automation tool: the button that sends a test event and shows at once whether the address answers. Also good for ‘Test connection’ or ‘Ping’.

On phones

The same button: the pill takes at most the screen width minus the margins and the long label is cut with an ellipsis. The light’s edge is measured again at every change of width.

With reduced motion

No running light and no springs: the label changes with a fade, the chip appears already open with the number written, the green and the tick fade in.

Pitfalls

  • The path of an SVG rect starts top left after the corner, not at the round end: the positions of the two ends must be worked out from width and height, or the light starts from the wrong point.
  • The light crosses the start of the path: with a dash and a gap that add up to 100 the pattern repeats and the crossing cannot be seen.
  • GSAP writes the transform inline on the button (press, elastic kick): the soft hover light and the green live on child elements.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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