Skip to content
animorio
IT
All components

Authenticator codes card

Cards, HoverGSAP, CSS onlyMediumCompressed weight: Demo 5.8 KBGSAP 28 KBFreeDownload the zip

The card of an authenticator app: three accounts with a six-digit code and a ring that runs down on the same clock; in the last seconds digits and rings turn warm, then the codes roll into new ones, row after row. A tap copies the code: the mark becomes a tick and the name says “Copied”.

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>
<!--
  "Authenticator codes card" 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>Authenticator codes card</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">
    <!-- an authenticator card: three accounts share one clock, each ring runs down with it,
         the codes turn warm near the end and roll into new ones together; a tap copies a code -->
    <section class="au" data-au aria-label="Authenticator">
      <header class="au__head">
        <span class="au__title">Authenticator</span>
        <span class="au__left" aria-hidden="true">New codes in <b data-left>0</b>s</span>
      </header>
      <div class="au__list" data-list></div>
      <p class="au__live" data-live aria-live="polite"></p>
    </section>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></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.

15 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 “Authenticator codes card” 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 “Authenticator” and the line “New codes in 7s”; below, three accounts, each with its initial’s tile, the name, the six-digit code in two groups and on the right a green ring running down, with the copy mark in its centre. The rings go down together, because there is a single clock. In the last quarter of the time the digits, the rings and the seconds turn orange. When time is up each digit leaves upwards and the new one rises from below with a small bounce, offset from its neighbour and row after row; a thin light crosses the code and the ring snaps back to full. Tapping a row sends the code to the clipboard: the copy mark closes, a tick is drawn in its place, the name rolls to “Copied” and after a moment everything is back as it was.

How it works

One clock for all

A single tween takes a number from 0 to 1 in PERIOD seconds and repeats: from it come the three rings’ stroke-dashoffset, the seconds written at the top and the last-seconds class. On every repeat the codes change.

One cell per digit

Each digit sits in an equal-width cell with hidden overflow: the old one leaves upwards with power2.in, the text changes, the new one rises with back.out. The delay grows digit by digit and row by row, so the change reads as a wave.

The copy, there and back

The tap writes the code to the clipboard, closes the copy mark and draws the tick in the same spot; a delayed call brings everything back. Tapping again before that cancels the old call.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#7cf0c0The colour of the ring and of the tick.
WARNscript.js#ffb057The colour of the last seconds.
PERIODscript.js10How many seconds between code changes (real ones: 30).
LATEscript.js0.25The final share of the time in which the codes turn warm.
ROLLscript.js0.5How many seconds a digit takes to roll into the new one.
LOOPscript.jstrueLeft alone, a pointer copies one code on every round.

Try them in the Playground

When to use it

In the app or extension that generates two-step verification codes, in a password manager, on an account’s security page; and wherever a value expires and renews on a timer: an entry code, a held price, a token.

On phones

The same component: rows and digits shrink with the window’s height, each row stays at least 56 pixels tall and is one whole tap target.

With reduced motion

No rolls, lights or springs: the codes change at once, the rings step down once a second and the copy shows the tick straight away.

Pitfalls

  • The demo’s codes come from a seeded generator, they are not real codes: in a real app the TOTP algorithm computes them from the account’s secret and the time, and the period is 30 seconds.
  • Each row is a button with a label that says service and code; the copy is announced in an aria-live line. The last-seconds colour is not enough on its own: the seconds are written at the top.
  • Copying to the clipboard needs a secure page (https) and a real gesture: inside an iframe without permission it fails silently, and the demo shows the gesture anyway.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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