Skip to content
animorio
IT
All components

Shield payment loader

Loading, SVGGSAP, CSS onlyMediumCompressed weight: Demo 8.4 KBGSAP 28 KBFreeDownload the zip

The checkout panel of a store, Northloom Supply, in dark glass on a black page. Pressing Pay the white button gives and narrows into a green liquid bar, a light runs around the edge of the panel and three checks write themselves letter by letter: meanwhile the shield draws itself, the lock snaps shut and the shield fills from the bottom with a moving surface. Approved, the light flares and goes out, the lock gives way to a tick, a glint crosses the shield and the bar swells back into the Done button.

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>
<!--
  "Shield payment loader" 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 payment loader with the shield that closes</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">
    <!-- the checkout panel of a store, Northloom Supply. Pressing Pay the button narrows into a liquid bar, a light
         runs around the edge of the panel, the three checks write themselves and the shield builds up: the outline,
         the lock that snaps shut, the fill that rises. Approved, the bar swells back into the Done button -->
    <section class="pay" data-pay aria-label="Checkout">
      <span class="pay__beam" data-beam aria-hidden="true"></span>
      <span class="pay__glow" aria-hidden="true"></span>

      <div class="pay__shield" aria-hidden="true">
        <svg viewBox="0 0 64 72" data-shield>
          <defs>
            <clipPath id="shield-clip"><path d="M32 5 L55 13.5 V33 C55 49.5 45 60.5 32 66.5 C19 60.5 9 49.5 9 33 V13.5 Z"/></clipPath>
            <linearGradient id="shield-fill" x1="0" y1="0" x2="0" y2="1">
              <stop offset="0" stop-color="var(--accent)" stop-opacity="0.42"/>
              <stop offset="1" stop-color="var(--accent)" stop-opacity="0.12"/>
            </linearGradient>
            <linearGradient id="shield-glint" x1="0" y1="0" x2="1" y2="0">
              <stop offset="0" stop-color="#fff" stop-opacity="0"/>
              <stop offset="0.5" stop-color="#fff" stop-opacity="0.55"/>
              <stop offset="1" stop-color="#fff" stop-opacity="0"/>
            </linearGradient>
          </defs>
          <path class="shield__base" d="M32 5 L55 13.5 V33 C55 49.5 45 60.5 32 66.5 C19 60.5 9 49.5 9 33 V13.5 Z"/>
          <g clip-path="url(#shield-clip)">
            <path class="shield__fill" data-fill d=""/>
            <path class="shield__surface" data-surface d=""/>
            <rect class="shield__glint" data-glint x="-30" y="-10" width="22" height="92" transform="skewX(-18)"/>
          </g>
          <path class="shield__line" data-outline pathLength="1" d="M32 5 L55 13.5 V33 C55 49.5 45 60.5 32 66.5 C19 60.5 9 49.5 9 33 V13.5 Z"/>
          <g class="shield__lock" data-lock>
            <path class="shield__shackle" data-shackle d="M26.5 34 V29.5 a5.5 5.5 0 0 1 11 0 V34"/>
            <rect class="shield__body" x="23" y="33.5" width="18" height="14" rx="3.5"/>
            <path class="shield__key" d="M32 39 v3.4"/>
          </g>
          <path class="shield__check" data-tick pathLength="1" d="M22.5 36.5 L29 43 L42 29.5"/>
        </svg>
      </div>

      <p class="pay__amount">$148.00</p>
      <div class="pay__status" aria-hidden="true">
        <span class="pay__status-line" data-status="idle">Pay Northloom Supply</span>
        <span class="pay__status-line" data-status="busy">Securing your payment</span>
        <span class="pay__status-line pay__status-line--ok" data-status="ok">Payment approved</span>
      </div>

      <ol class="pay__steps" data-steps>
        <li class="step" data-step data-now="Encrypting card details" data-done="Card details encrypted">
          <svg class="step__icon" viewBox="0 0 16 16" aria-hidden="true">
            <circle class="step__spin" data-spin cx="8" cy="8" r="5.5" pathLength="1"/>
            <path class="step__tick" data-steptick pathLength="1" d="M4.2 8.3 L6.9 11 L11.9 5.4"/>
          </svg>
          <span class="step__words"><span class="step__base">Encrypting card details</span><span class="step__type" data-type></span><span class="step__done" data-donewords>Card details encrypted</span></span>
        </li>
        <li class="step" data-step data-now="Checking with your bank" data-done="Bank check passed">
          <svg class="step__icon" viewBox="0 0 16 16" aria-hidden="true">
            <circle class="step__spin" data-spin cx="8" cy="8" r="5.5" pathLength="1"/>
            <path class="step__tick" data-steptick pathLength="1" d="M4.2 8.3 L6.9 11 L11.9 5.4"/>
          </svg>
          <span class="step__words"><span class="step__base">Checking with your bank</span><span class="step__type" data-type></span><span class="step__done" data-donewords>Bank check passed</span></span>
        </li>
        <li class="step" data-step data-now="Confirming the payment" data-done="Payment confirmed">
          <svg class="step__icon" viewBox="0 0 16 16" aria-hidden="true">
            <circle class="step__spin" data-spin cx="8" cy="8" r="5.5" pathLength="1"/>
            <path class="step__tick" data-steptick pathLength="1" d="M4.2 8.3 L6.9 11 L11.9 5.4"/>
          </svg>
          <span class="step__words"><span class="step__base">Confirming the payment</span><span class="step__type" data-type></span><span class="step__done" data-donewords>Payment confirmed</span></span>
        </li>
      </ol>

      <div class="pay__meta">
        <span class="pay__card">
          <svg viewBox="0 0 22 15" aria-hidden="true"><rect x="0.6" y="0.6" width="20.8" height="13.8" rx="2.6"/><path d="M0.6 4.6 H21.4"/><path d="M3.6 10.4 H8.4"/></svg>
          Visa ending 4021
        </span>
        <span class="pay__sec">
          <svg viewBox="0 0 12 14" aria-hidden="true"><rect x="1.2" y="6" width="9.6" height="7" rx="1.8"/><path d="M3.4 6 V4.4 a2.6 2.6 0 0 1 5.2 0 V6"/></svg>
          256-bit
        </span>
      </div>

      <div class="pay__foot">
      <button class="pay__btn" type="button" data-btn>
        <span class="pay__fill" data-barfill aria-hidden="true"><span class="pay__shine"></span></span>
        <span class="pay__label pay__label--pay" data-label="pay">Pay $148.00</span>
        <span class="pay__label pay__label--done" data-label="done">
          <svg viewBox="0 0 16 16" aria-hidden="true"><path data-donetick pathLength="1" d="M3.6 8.4 L6.6 11.3 L12.4 5.1"/></svg>
          Done
        </span>
      </button>
      </div>
    </section>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

32 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 “Shield payment loader” 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 a black page a dark glass panel rises slowly, with a thin edge that catches the light and a light grain. At the top a grey shield with an open lock inside, below it $148.00 and ‘Pay Northloom Supply’; then three grey lines (Encrypting card details, Checking with your bank, Confirming the payment), the card ‘Visa ending 4021’, ‘256-bit’ and the white ‘Pay $148.00’ button. The button is pressed: it gives a touch, the words leave upwards and the button narrows into a thin bar; inside it a green liquid advances with a sheen running through it, and a green and white light starts running around the edge of the panel, leaving a glow inside. ‘Securing your payment’ takes the place of the line under the amount. For each check a small arc turns by the line and the letters write themselves in white over their grey copies: while the card is encrypted the green outline of the shield draws itself, while the bank answers the shackle of the lock drops and snaps shut with a small bounce, while the payment is confirmed the shield fills with green from the bottom with a moving surface. As each check ends the arc becomes a tick and the line changes (‘Card details encrypted’, ‘Bank check passed’, ‘Payment confirmed’). At the end the light makes a quick lap and goes out, the shield gives a small jump, the lock leaves and a tick draws itself, a glint crosses it, ‘Payment approved’ appears in green and the bar swells on a spring into the green ‘Done’ button with its tick. Done pressed, the panel fades and comes back as at the start.

How it works

The light only on the edge

The running light is a conic-gradient in a layer as big as the panel with 1 px padding, masked with two linear-gradients composited with exclude (xor in WebKit): only the ring of the edge stays visible. GSAP turns the CSS variable --a from 0 to 360 degrees in a paused endless tween that starts with the payment and speeds up for one lap at approval; a second variable, --warm, lights the inner glow and the green shadow underneath.

The shield in four beats

The shield is an SVG: the outline has pathLength 1 and GSAP animates the stroke-dashoffset attribute from 1 to 0 (not the CSS property, which would override it); the shackle of the lock drops 3.5 units with a tight back.out, and the whole lock squashes to 94% and comes back; the fill is a path rebuilt every frame inside a clipPath shaped like the shield; at approval a slanted rectangle with a white gradient crosses it like a glint.

The liquid that moves

The level of the shield is a number between 0 and 1. GSAP's ticker computes seventeen points of the surface with two sines moving at different speeds, with an amplitude that follows the sine of the level (flat when empty and when full), and writes the same path twice: closed at the bottom for the faded fill, open for the light line of the surface.

Letters over their shadow

Each line has the whole sentence in dark grey and over it the same sentence in white, written by a tween that takes a counter to the full length and cuts the text with slice: the letters light up in place. When the check ends both leave upwards in a line with overflow hidden, and the past tense sentence comes in from below on a spring.

The button that becomes a bar

The button sits in a foot 44 px tall, so the panel does not move: GSAP takes its height to 6 px and its background from white to a transparent track, and the liquid inside advances with scaleX a third per check; a CSS sheen crosses it all the time. At approval the height goes back to 44 with elastic.out and the liquid, already full, becomes the background of the Done button.

Values to change

NameFileDefaultWhat it changes
STEPscript.js1.35The seconds of each of the three checks.
TYPEscript.js0.55The seconds to write the words of a check.
BEAMscript.js1.6The seconds of one lap of the light on the edge.
WAVEscript.js1How much the surface of the liquid in the shield moves (0 is flat).
BOUNCEscript.js1.7How far the springs pass the mark (1 hardly, 3 a lot).
HOLDscript.js2.4The seconds the approved panel waits before the pilot presses Done.
LOOPscript.jstruePay again and again.

Try them in the Playground

When to use it

For the checkout of an online store, the payment page of an app, a subscription, or the booking of a hotel or a ticket: it fills the seconds while the bank answers and says what is going on, with the shield that reassures. It works as a model for any waiting in steps that ends with a confirmation (a transfer, an identity check, an order).

On phones

The same animation with adapted sizes: the panel is 90% of the screen wide, the shield, the amount and the gaps are sized on the height too and everything fits the frame; the button is tapped with a finger.

With reduced motion

Nothing moves or turns: the light on the edge fades in and out without turning, the button becomes the bar at once, the lines appear whole and change with a fade, the lock is already shut, the shield fills without waves, the tick and the Done button fade in.

Pitfalls

  • With stroke-dashoffset written in the CSS the attribute tween did not show: the CSS property wins over the presentation attribute. GSAP sets the starting value as an attribute.
  • The button turning into a 6 px bar made the panel 38 px shorter and made it jump, since it is centred in the page: the button sits in a foot that stays 44 px tall.
  • When a line changed, the old and new sentence overlapped halfway: the line has overflow hidden and the new one starts when the old one is nearly gone.
  • The edge light with a conic-gradient and one mask does not show in Safari: it needs -webkit-mask-composite: xor next to mask-composite: exclude.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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