Skip to content
animorio
IT
All components

QR code sign-in

Forms, Hover, TransitionsGSAP, CanvasMediumCompressed weight: Demo 7.9 KBGSAP 28 KBFreeDownload the zip

QR code sign-in for an app on a TV or a computer: the code builds itself cell by cell from the centre outwards, a thin scan line sweeps over it and a time frame wears away around it. Once scanned, the code blurs and the avatar of whoever read it springs into the middle; a small ring waits for the confirm on the phone, then the check draws itself and the title says «Welcome back, Ada». If nobody scans it the code expires, the «New code» pill lights up and the pattern folds back into the centre to grow a new one. Minimal style, on black, with a single periwinkle accent; made-up brand.

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>
<!--
  "QR code sign-in" 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>QR code sign-in</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/geist-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- signing in on a TV or a computer with your phone: the QR code builds itself from the centre outwards, a thin
         scan line sweeps over it, the time frame wears away around it. Scanned, the code blurs and the avatar of
         who scanned it lands in the middle, a small ring waits for the phone, then the check draws itself.
         An unscanned code expires and rebuilds itself with a new pattern. -->
    <section class="card" data-card aria-label="Sign in with your phone">
      <span class="card__light" data-light aria-hidden="true"></span>

      <header class="head">
        <span class="app" aria-hidden="true">
          <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="7.2"/><path d="M12 4.8v14.4M5.6 9.2c4.2 2.2 8.6 2.2 12.8 0"/></svg>
        </span>
        <h1 class="head__title"><span class="roll" data-title><span class="roll__line">Sign in with your phone</span></span></h1>
        <p class="head__sub"><span class="roll" data-sub><span class="roll__line">Scan it with the Fathom app.</span></span></p>
      </header>

      <button class="code" type="button" data-code aria-label="QR code: press to simulate a scan">
        <svg class="code__time" data-time-svg viewBox="0 0 100 100" aria-hidden="true">
          <rect class="code__time-track" x="1" y="1" width="98" height="98" rx="9" ry="9"/>
          <rect class="code__time-run" data-time x="1" y="1" width="98" height="98" rx="9" ry="9" pathLength="1"/>
        </svg>
        <span class="code__plate" data-plate>
          <canvas class="code__canvas" data-canvas aria-hidden="true"></canvas>
          <span class="code__scan" data-scan aria-hidden="true"></span>
        </span>
        <span class="code__middle" aria-hidden="true">
          <span class="mark" data-mark>
            <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="7.2"/><path d="M12 4.8v14.4M5.6 9.2c4.2 2.2 8.6 2.2 12.8 0"/></svg>
          </span>
        </span>
        <span class="code__middle" aria-hidden="true">
          <span class="who" data-who>
            <span class="who__avatar">AM</span>
            <svg class="who__ring" data-ring viewBox="0 0 48 48"><circle class="who__ring-track" cx="24" cy="24" r="21"/><circle class="who__ring-arc" cx="24" cy="24" r="21" pathLength="1"/></svg>
          </span>
        </span>
        <span class="code__middle" aria-hidden="true">
          <span class="done" data-done>
            <svg viewBox="0 0 24 24"><path data-check d="m7 12.4 3.3 3.3L17.2 8.6" pathLength="1"/></svg>
          </span>
        </span>
        <span class="code__middle" aria-hidden="true">
          <span class="expired" data-expired>
            <svg viewBox="0 0 24 24"><path d="M18.6 9.4A7 7 0 1 0 19 13.4"/><path d="M19.4 4.8v4.8h-4.8"/></svg>
          </span>
        </span>
      </button>

      <p class="status"><span class="roll" data-status><span class="roll__line">Waiting for a scan</span></span></p>

      <div class="foot">
        <p class="timer" data-timer-wrap>Code refreshes in <span class="timer__n" data-timer>0:30</span></p>
        <button class="pill" type="button" data-refresh>
          <span class="pill__face">
            <svg class="pill__icon" data-refresh-icon viewBox="0 0 16 16" aria-hidden="true"><path d="M12.6 6.4A5 5 0 1 0 13 9.4"/><path d="M13.2 3.2v3.4H9.8"/></svg>
            <span>New code</span>
          </span>
        </button>
      </div>
      <a class="alt" href="#" data-alt>Use a password instead</a>
      <p class="sr" aria-live="polite" data-live></p>
    </section>
  </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

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 “QR code sign-in” 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 dark card with the Fathom mark, «Sign in with your phone» and the QR code on a light plate. The code grows cell by cell from the centre, with its three corner squares, and the app mark settles in the middle; a periwinkle line sweeps up and down over the code while the frame around it wears away and «Code refreshes in 0:06» counts below. In the preview the code is read: it blurs, the mark goes and the AM avatar springs into its place, «Scanned by Ada M.» and then «Confirm on your phone» with a ring spinning around the avatar. A moment later the avatar gives way to a periwinkle disc with the check drawing itself, and the title becomes «Welcome back, Ada». Then a new code nobody reads: the frame runs out, the code dims, the renew sign appears in the middle, «Code expired», the «New code» pill lights up and, pressed, spins its arrow, and the pattern folds back into the centre to grow a different one.

How it works

Our own code, on canvas

A 25 by 25 grid filled from a seeded random number, with the three corner squares, the timing line, the small square and an empty middle for the mark. It is drawn on a canvas measured on resize, at the screen density up to 2.

From the centre outwards

A single number p goes from 0 to 1; every cell knows how far it is from the centre and appears when p reaches it, with a small back.out curve on its size. To fold the code back p returns to 0.

Everything on one centre

Mark, avatar, check and renew sign sit in four layers with inset 0 and place-items center over the same square: GSAP scales and fades them without ever moving them, so the centre is never lost. The ring spins as a whole svg with transformOrigin 50% 50%.

The time frame

A rounded rectangle with pathLength 1 around the code: its strokeDashoffset goes from 0 to −1 in LIFE seconds, and the same number writes the seconds left (autoRound off).

Playing by itself

A timeline calls the scan, then a new code that expires and the button that renews it; any click, tap or key stops it and restarts it after AUTO_PAUSE seconds.

Values to change

NameFileDefaultWhat it changes
BUILDscript.js1.1Seconds the code takes to build from the centre outwards.
SCANscript.js2.2Seconds for a round trip of the scan line.
LIFEscript.js6Seconds a code stays valid in the preview before it expires.
CONFIRMscript.js1.8Seconds waiting for the confirm on the phone.
BLURscript.js6Pixels of blur on the code once read.
SPRINGscript.js0.5How springy the avatar and the check are (lower means more bounce).
PRESSscript.js0.96Scale of the code and the pill while pressed.
AUTO_PAUSEscript.js6Seconds of quiet before the demo plays by itself again.

Try them in the Playground

When to use it

On the sign-in screen of a TV app, a streaming service, the desktop version of an app mostly used on the phone: wherever typing a password with a remote or on another screen is a pain.

On phones

Everything is in em and the size depends on both the width and the height of the window, and the code is at most a third of the screen high, so the card fits the phone box; on short screens the line under the title goes. A tap on the code works like a scan.

With reduced motion

No growing cells, sweeping lines, springs or spinning rings: the code fades in already whole, the avatar, the check and the renew sign fade in, the ring stays still and the labels cross-fade. The time frame still wears away, because it is information.

Pitfalls

  • Whatever has to sit in the middle of the code is a layer with inset 0 and place-items center: GSAP scales and fades it but never moves it, or the centre is lost.
  • The ring spins as a whole svg: transformOrigin 50% 50%, never svgOrigin on the svg itself.
  • The frame and the check draw with strokeDashoffset: the block turning autoRound off is needed, or they jump.
  • The canvas is measured again with a ResizeObserver and redrawn where it is: the demo window changes height while you watch.
  • The code is drawn by us and leads nowhere: a real one needs a library that generates it from the data.

Libraries

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

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

Testing

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