Skip to content
animorio
IT
All components

Card slot pay button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 8.1 KBGSAP 28 KBFreeDownload the zip

The Pay $128.00 button of a checkout, a graphite pill on white with a thin slot cut into its top edge. On tap a cobalt card from a made-up bank, Moraine, comes down tilted, straightens as the light slides over its brushed face and slips into the slot chip first with a small clunk: the pill dips a pixel and a half and the slot's lip catches the light. While it authorises a band of light sweeps the pill, the word Authorizing shimmers in step and a lilac light leaks out of the slot; then the pill flushes green, the tick draws itself, Paid arrives and the card is pushed out on a spring and lifts away.

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>
<!--
  "Card slot pay 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>The Pay button with the card that slides into its slot</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 Pay button of a checkout, with a card slot cut into its top edge. On tap a cobalt card comes down,
         straightens, and slides chip first into the slot; a band of light sweeps the pill while it authorises, the
         tick draws itself, the card is pushed out and lifts away, and the button goes back to rest -->
    <div class="pay" data-pay>
      <!-- the card lives in a window that ends exactly at the slot, so whatever goes lower disappears inside -->
      <div class="win" data-win aria-hidden="true">
        <div class="card" data-card>
          <div class="card__face">
            <span class="card__brush"></span>
            <span class="card__glow"></span>
            <span class="card__sheen" data-sheen></span>
            <span class="card__edge"></span>
            <svg class="card__mark" viewBox="0 0 20 20">
              <path d="M10 1.5 18.5 10 10 18.5 1.5 10Z"/>
              <path d="M10 6 14 10 10 14 6 10Z"/>
            </svg>
            <span class="card__bank">MORAINE</span>
            <svg class="card__chip" viewBox="0 0 40 30">
              <defs>
                <linearGradient id="gold" x1="0" y1="0" x2="1" y2="1">
                  <stop offset="0" stop-color="#f4e2ad"/>
                  <stop offset=".45" stop-color="#c9a95e"/>
                  <stop offset=".7" stop-color="#ead596"/>
                  <stop offset="1" stop-color="#a8853e"/>
                </linearGradient>
              </defs>
              <rect x=".5" y=".5" width="39" height="29" rx="5.5" fill="url(#gold)" stroke="rgba(90,66,20,.55)"/>
              <path d="M.5 10.5h11.5a3 3 0 0 1 3 3v3a3 3 0 0 1-3 3H.5M39.5 10.5H28a3 3 0 0 0-3 3v3a3 3 0 0 0 3 3h11.5M15 15h10M20 .5v9M20 20.5v9" fill="none" stroke="rgba(90,66,20,.5)" stroke-width="1"/>
            </svg>
            <span class="card__num">4417</span>
            <span class="card__exp">09/29</span>
          </div>
        </div>
      </div>

      <button class="pill" type="button" data-pill data-autoclic aria-label="Pay $128.00 with the card ending 4417">
        <span class="pill__skin" aria-hidden="true">
          <span class="pill__grain"></span>
          <span class="pill__wash" data-wash></span>
          <span class="pill__band" data-band></span>
          <span class="pill__edge"></span>
        </span>

        <!-- the slot: a groove with a lit lip, and the light that leaks out of it while the card is inside -->
        <span class="slot" data-slot aria-hidden="true">
          <span class="slot__leak" data-leak></span>
          <span class="slot__groove"></span>
          <span class="slot__lip" data-lip></span>
        </span>

        <span class="row" aria-hidden="true">
          <span class="tick" data-tickbox>
            <svg viewBox="0 0 24 24">
              <circle data-tick-ring cx="12" cy="12" r="10" pathLength="1"/>
              <path data-tick d="M7.5 12.4l3 3 6-6.4" pathLength="1"/>
            </svg>
          </span>
          <span class="words" data-words>
            <span class="word word--pay" data-word="pay">Pay</span>
            <span class="word word--auth" data-word="auth">Authorizing</span>
            <span class="word word--paid" data-word="paid">Paid</span>
          </span>
          <span class="sep" data-sep></span>
          <span class="amount" data-amount>$128.00</span>
        </span>
      </button>
    </div>
    <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.

28 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 “Card slot pay 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

A graphite pill with a fine grain, a 1px edge catching the light and a slot cut into its top, with a light lip. It says Pay and the amount. On hover it rises a pixel, the word widens on the wdth axis and a thread of light comes out of the slot. Tapped, it gives, a cobalt card comes from above tilted and straightens over the slot; then it slips in, speeding up, and stops with a clunk while pill and card bounce a little. The word becomes Authorizing and the pill widens; a band of light sweeps it several times, the word shimmers in step and the slot glows lilac. On approval the pill flushes green, the tick and its ring draw themselves, Paid arrives, the card pops out and flies away. A moment later the button says Pay again.

How it works

The window that ends at the slot

The card is not inside the button: it sits in a window with overflow hidden whose bottom edge is exactly at the slot (bottom computed with calc from --pill-bottom, --pill-h and --slot-y). Whatever goes lower is cut away, so it seems to go into the pill. On the clunk the window dips with the pill, so the cut stays on the slot.

The card straightening

The card comes in with rotationX (TILT), a few degrees of rotation and a little larger, and arrives straight over the slot with back.out, while a slanted highlight crosses its brushed face. Then it goes down far enough to leave only a third outside (measured on the card's real height) in INSERT seconds with power2.in, which speeds up like a pushed card.

The clunk

On arrival pill and window drop 1.5 pixels in 60 ms and come back with elastic.out, the card gives two pixels and settles, and the slot's lip lights up and fades. This settling is what makes you feel the bottom of the slot.

The band of light and the shimmering word

A slanted strip with a lilac and white gradient, in mix-blend-mode screen, crosses the pill SWEEPS times with xPercent; the word Authorizing has its text clipped to a gradient (background-clip: text) whose background-position moves with the same timing, so the light passes from the pill to the letters. The width of the words animates on a spring, measured word by word.

The tick and the way back

Tick and ring have pathLength 1: stroke-dashoffset from 1 to 0. The tick's box grows from zero to 22 pixels and pushes the words on a spring. The card pops out with back.out and flies away; after HOLD seconds everything goes back and the pilot starts again, until someone really touches it (e.isTrusted).

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js'#8d9cff'The colour of the band of light and of the light leaking from the slot.
AMOUNTscript.js'$128.00'The amount on the button.
TILTscript.js28How tilted the card comes in, in degrees.
INSERTscript.js0.42Seconds the card takes to slide into the slot.
SWEEPSscript.js2How many times the band of light sweeps the pill while it authorises.
SWEEPscript.js0.95Seconds of one sweep of the band of light.
SPEEDscript.js1Speed of everything: 2 twice as fast, 0.5 half.
HOLDscript.js2Seconds Paid stays before the button is ready again.
AUTOscript.jstrueThe payment plays by itself until someone touches it.

Try them in the Playground

When to use it

As the final button of a checkout, in an online shop's cart, an app's till or a subscription payment: wherever the payment should feel real, with the card going in, a visible wait and a clear confirmation.

On phones

The same animation at the same sizes: the pill is at most 76% of the screen wide and the box also follows the height, so it fits the phone box. There is no hover: a tap starts the payment.

With reduced motion

Nothing moves: the card fades in already in the slot, Authorizing and Paid fade from one to the other with the tick already drawn, and the card fades out without flying away.

Pitfalls

  • The three words sit on top of each other in a grid: without a hand-animated width the pill took the size of the longest one at once. Each word's width is measured when the fonts load and on resize, and the word box springs from one to the next.
  • On the clunk the pill drops a pixel and a half: if the card's window stayed still, the cut ended above the slot and a line of card showed over the graphite. They move together.
  • Hover widens Pay on the wdth axis: the word box, which clips, widens with it, otherwise the y got cut.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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