Skip to content
animorio
IT
All components

Face ID pay button

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

The button that confirms a payment in a premium wallet, Halden, on black: a graphite glass pill with the face recognition glyph in a round well, Confirm with Face ID and the amount. Tapped, the glyph redraws stroke by stroke and a band of mint light scans it while another crosses the pill. The first try does not recognise the face: the glyph turns coral, the mouth goes flat and the pill shakes sideways. On the second the four corners close on a spring and become one check, the mint spreads from the well and the words widen into Paid.

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>
<!--
  "Face ID 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 Face ID pay button with the corners that become a check</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 wallet app (Halden): a graphite glass pill with the face glyph in a round well, the words
         and a small chip. Tapped, the glyph draws itself stroke by stroke, a band of light scans it, and either the face
         is not recognised (a shake, try again) or the four corners close on a spring into a check and the pill widens
         into Paid -->
    <button class="pay" type="button" data-pay aria-describedby="pay-live">
      <span class="pay__glass" aria-hidden="true"></span>
      <span class="pay__tint" data-tint aria-hidden="true"></span>
      <span class="pay__glow" aria-hidden="true"></span>
      <span class="pay__sweep" aria-hidden="true"><i data-sweep></i></span>

      <span class="fid" data-fid aria-hidden="true">
        <span class="fid__ring" data-fid-ring></span>
        <svg class="fid__svg" viewBox="0 0 44 44">
          <defs>
            <linearGradient id="fid-band" x1="0" y1="0" x2="0" y2="1">
              <stop offset="0" stop-color="#fff" stop-opacity="0"/>
              <stop offset="0.5" stop-color="#fff" stop-opacity="1"/>
              <stop offset="1" stop-color="#fff" stop-opacity="0"/>
            </linearGradient>
            <mask id="fid-mask" maskUnits="userSpaceOnUse" x="0" y="0" width="44" height="44">
              <rect data-band x="0" y="-16" width="44" height="16" fill="url(#fid-band)"/>
            </mask>
          </defs>
          <g class="fid__base" data-glyph>
            <g id="fid-copy">
            <path class="fid__corner" data-corner pathLength="1" d=""/>
            <path class="fid__corner" data-corner pathLength="1" d=""/>
            <path class="fid__corner" data-corner pathLength="1" d=""/>
            <path class="fid__corner" data-corner pathLength="1" d=""/>
            <g class="fid__face" data-face>
              <path data-part pathLength="1" d="M15.5 15.5v3.2"/>
              <path data-part pathLength="1" d="M28.5 15.5v3.2"/>
              <path data-part pathLength="1" d="M22.4 15.6v8.2c0 1.3-0.7 1.9-2 1.9h-0.6"/>
              <path data-part data-mouth pathLength="1" d="M16.6 29.8Q22 33.8 27.4 29.8"/>
            </g>
            </g>
          </g>
          <g class="fid__lit" data-lit mask="url(#fid-mask)">
            <use href="#fid-copy"/>
          </g>
        </svg>
        <span class="fid__band" data-band-glow></span>
      </span>

      <span class="pay__words" data-words>
        <span class="pay__layer" data-layer="rest">
          <span class="pay__t">Confirm with Face ID</span>
          <span class="pay__s">Pay $248.00 to Marlow Supply</span>
        </span>
        <span class="pay__layer" data-layer="scan">
          <span class="pay__t">Scanning</span>
          <span class="pay__s">Look at your screen</span>
        </span>
        <span class="pay__layer pay__layer--error" data-layer="error">
          <span class="pay__t">Face not recognized</span>
          <span class="pay__s">Tap to try again</span>
        </span>
        <span class="pay__layer" data-layer="retry">
          <span class="pay__t">Try again</span>
          <span class="pay__s">Pay $248.00 to Marlow Supply</span>
        </span>
        <span class="pay__layer pay__layer--paid" data-layer="paid">
          <span class="pay__t">Paid $248.00</span>
          <span class="pay__s">Marlow Supply · receipt sent</span>
        </span>
      </span>

      <span class="chip" data-chip aria-hidden="true">
        <svg class="chip__arrow" data-chip-arrow viewBox="0 0 16 16"><path d="M3.4 8h8.6M8.6 4.4L12.2 8 8.6 11.6"/></svg>
        <svg class="chip__spin" data-chip-spin viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.4" pathLength="1"/></svg>
        <svg class="chip__receipt" data-chip-receipt viewBox="0 0 16 16"><path d="M4.4 2.6h7.2v10.8l-1.8-1.1-1.8 1.1-1.8-1.1-1.8 1.1zM6.4 6h3.2M6.4 8.6h3.2"/></svg>
      </span>
    </button>
    <p class="sr" id="pay-live" 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.

27 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 “Face ID 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

On a black page there is a graphite glass pill 64 pixels tall, with a thin edge that catches the light along the top and a light grain. On the left, in a round well cut into the glass, our own face recognition glyph: four rounded corners, two eyes, the nose and the smile. Beside it ‘Confirm with Face ID’ and under it ‘Pay $248.00 to Marlow Supply’; on the right a small round chip with an arrow. Under the pointer a soft light follows it on the glass; pressed, the button gives a touch and comes back on a spring. Tapped, the words become ‘Scanning’, the arrow gives way to a spinning mint arc, the corners breathe in towards the middle and the glyph redraws stroke by stroke; a band of mint light goes down and back up over the face and the strokes it touches turn white, while a glint crosses the whole pill. The first try fails: the glyph and the well turn coral, the mouth goes flat and the pill shakes sideways with smaller and smaller swings (the face a beat later), ‘Face not recognized, Tap to try again’; then it calms down on ‘Try again’. On the second try the face folds towards the middle, the four corners close on a spring and slide into one another until they are a single mint check, which passes the mark by a pixel and settles; the mint spreads through the glass from the well, the edge takes it, the pill takes a small breath and the words widen on the width axis into ‘Paid $248.00’, with the receipt in the chip. After a while everything goes back to rest.

How it works

Corners and check from the same points

Each corner is a path of five points: the start, the point before the bend, the bend's control (Q), the point after and the end. The check is written with five points too, the middle three all on its knee. So every corner can become the check: one value m (0 corners, 1 check) moved by GSAP, and every frame the points are interpolated and the d is rewritten. The two bottom corners go to the check reversed, so they do not cross, and each one starts a moment after the last.

A real spring as an ease

The closing uses a hand written ease: the response of a damped spring normalised between 0 and 1. It passes one by a little, so the points go a pixel past the check and come back: the overshoot comes from physics, not from a keyframe. Before closing a second value pulls the corners towards the middle for a breath.

The light that scans the strokes

The glyph is there twice: once in its colour and once as a white copy made with use, masked by a rectangle with a transparent, white, transparent gradient. GSAP moves the rectangle's y attribute down and up: only the strokes under the band light up. Above it a mint CSS band does the same trip in screen, and a slanted glint crosses the pill.

Drawn stroke by stroke

Every stroke has pathLength 1, so stroke-dasharray 1 1 and stroke-dashoffset from 1 to 0 draw all of it, whatever shape it has at that moment; the attribute is animated, not the CSS property. First the corners, staggered, then the eyes, the nose and the mouth. The mouth is a Q curve whose control goes up and down: a smile, flat in the error.

The words that widen

The five lines of words sit on top of each other; their width is measured with scrollWidth and the box goes to it on the spring, with the pill following. Paid is measured already at font-stretch 112 percent: GSAP takes it from 94 to 112 on Mona Sans's wdth axis, together with the width.

Values to change

NameFileDefaultWhat it changes
AMOUNTscript.js'248.00'The amount in dollars, in the button's words.
SCANscript.js1.5The seconds the scan lasts: the band goes down and back up in this time.
FAIL_FIRSTscript.jstrueThe first try does not recognise the face and the second goes through; with false it pays at once.
BOUNCEscript.js0.62The springs: lower bounces more (0.4), higher settles without passing the mark (1).
SHAKEscript.js8The pixels of the sideways shake when the face is not recognised.
HOLDscript.js2.6The seconds on Paid before going back to rest.
LOOPscript.jstrueThe pilot pays by itself, again and again, until someone touches the button.

Try them in the Playground

When to use it

For the last step of a payment in a banking app, a wallet, an online shop checkout or the booking of a hotel or a ticket: the button that confirms with the face and tells at a glance whether it went through. It also works to unlock a password vault or a private area, by changing the words, and as a showcase of a fintech app on a landing page.

On phones

The same animation with adapted sizes: the pill stays 64 pixels tall and never goes past the width of the screen, the words get a little tighter under 360 pixels and, if there is not enough room, the width of the words stops before the edge; it is tapped with a finger and the press gives as with a mouse.

With reduced motion

Nothing moves: no shake and no springs, the band of light fades in and out, the check takes the corners' place at once, the face fades away, the words and the colours change with a fade.

Pitfalls

  • The white copy of the strokes made with use takes the class styles of the original: if the stroke colour sat on the paths' class, the copy would stay grey too. The colour sits on the groups and the paths inherit it, so the copy takes the white of its group.
  • With the bottom corners sent to the check the same way as the others, halfway the strokes crossed into an X: they go to the check reversed.
  • GSAP's transform on the button (press and shake) would wipe out a CSS scale: only GSAP moves the button, the light under the pointer is a child with its own variables.
  • Measuring the Paid words before widening them gave a pill too narrow: the width is measured with the words already at font-stretch 112, and the animation starts from 94.

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