Skip to content
animorio
IT
Back to the library

Webhook retries

SVG, HoverGSAP, CSS onlyMediumCompressed weight: Demo 6.3 KBGSAP 28 KBFreeDownload the zip

A webhook delivery that does not get through at once, in a dark card: a timeline where each wait is twice the one before, 1, 2, 4, 8 seconds, so the attempt ticks drift apart. The line advances, and at every tick an answer comes back: 500, 503, 500, 429 in red with a start of the card, and below the count of how long until the next try. “Retry now” skips the wait. The last attempt gets the 200: the line and the status turn green. Moving over a tick you read that attempt’s answer. Minimal style.

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>
<!--
  "Webhook retries" 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>Webhook retries</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- the retries of a webhook delivery with exponential backoff: a timeline where each wait is twice the one
         before, the failed answers, the one that gets through, and Retry now skipping the wait -->
    <section class="wr" data-wr aria-label="Webhook delivery">
      <header class="wr__head">
        <div class="wr__what"><strong>order.created</strong><span>POST api.northwind.dev/hooks</span></div>
        <span class="wr__pill"><span class="wr__clip"><span data-outstate>Sending</span></span></span>
      </header>

      <div class="wr__line">
        <svg class="wr__svg" data-svg viewBox="0 0 320 64" aria-hidden="true">
          <path class="wr__track" d="M16 40H304"></path>
          <path class="wr__run" data-run d="M16 40H304" pathLength="1"></path>
          <g data-ticks></g>
          <path class="wr__head2" data-headmark d="M0 33v14"></path>
        </svg>
        <div class="wr__hits" data-hits></div>
      </div>

      <div class="wr__now">
        <div class="wr__info"><strong class="wr__clip wr__clip--tall"><span data-outline>Sending attempt 1</span></strong><span class="wr__clip"><span data-outsub>Waiting for the endpoint</span></span></div>
        <button type="button" class="wr__btn" data-go><span class="wr__clip wr__clip--btn"><span data-outbtn>Retry now</span></span></button>
      </div>
    </section>
    <span class="live" aria-live="polite" data-live></span>

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

16 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 “Webhook retries” 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 black, a dark card: at the top, in monospace, the event name “order.created” and the address “POST api.northwind.dev/hooks”; on the right the status pill, “Sending”. Below, a darker panel with a dashed line and five grey ticks: the first ones close, the last ones further and further apart, each with three dots above. At the bottom: “Sending attempt 1”, “Waiting for the endpoint” and the light button “Retry now”, still off. After a moment the first attempt goes out: the tick snaps and turns red, “500” appears above it, the card gives a small start, the pill rolls to “Retrying” and below it says “500 Internal Server Error” and “Attempt 1 of 5. Next try in 0.8 s”, with the tenths going down. A white mark runs along the line leaving a solid red stretch behind; at every tick a new answer comes out, 503, then 500, and the waits double. Moving over a tick already done, it lights up and below you read its answer and how many milliseconds it took. Tapping “Retry now” the mark jumps to the next tick without waiting. At the last tick the answer is “200”: tick and number green, the line and the pill turn green, “Delivered”, “200 OK”, “Delivered on attempt 5, after 15 s”, and the button becomes “Send again”, which starts over.

How it works

The plan of attempts

A list built at the start: for every attempt when it goes out (1, 3, 7, 15 seconds after the first), how long it waited, and what answer it will get. The ticks’ positions come from it, on a slightly squeezed scale so the first ones do not overlap.

A single clock

One number, the delivery’s seconds, runs from one attempt to the next: it draws the solid stretch, moves the mark and writes the countdown.

Skipping the wait

“Retry now” stops the slow run and starts a half-second one to the same tick: the attempt goes out from there like the others.

Looking back

Every tick has a 30-pixel-wide target over it: on hover or reaching it with Tab, the row below shows that attempt instead of the last one.

Values to change

NameFileDefaultWhat it changes
OKscript.js#3ecf8eThe colour of a successful delivery.
FAILscript.js#ff6b5aThe colour of failed attempts.
TRIESscript.js5How many attempts in all: the last one gets through.
PACEscript.js0.55How many real seconds one second of waiting lasts in the demo.
LOOPscript.jstrueLeft alone, the demo’s pointer looks at an attempt, skips the wait and sends again.

Try them in the Playground

When to use it

On an app’s integrations page, in the webhook delivery log, in an API’s documentation to explain how retries work; the same line with doubling waits carries the attempts of a payment, a chat reconnecting, a bounced email being resent or a file saving with no network.

On phones

The card is at most 364 pixels wide and about 235 tall. The line narrows with the card and the ticks with it; the targets over the ticks stay 30 pixels wide and as tall as the panel. The button is 40 pixels tall.

With reduced motion

No run or starts: the attempts come out one after another with no animated wait, the line arrives full and green, texts change in one step. The demo’s pointer does not start.

Pitfalls

  • Success or failure is not told by colour alone: the code is above every tick, the row below writes it in full and every attempt is announced to screen readers.
  • The demo’s waits are shortened (one second lasts a little over half): the numbers written stay the real ones, 1, 2, 4, 8.
  • The solid stretch is drawn with `stroke-dashoffset` between 0 and 1: with GSAP’s pixel rounding it would jump from empty to full.
  • The snapping tick scales around its point on the line with `svgOrigin` in the drawing’s coordinates: it is an element inside the svg.
  • Event, address, codes and times are invented; a real service adds some randomness to the waits, so a thousand deliveries do not all retry together.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.

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

Testing

Tested on 2 December 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