Skip to content
animorio
IT
All components

Recovery codes card

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

The last step of two-factor sign in for an invented account app, Halden, like a Dribbble shot: a graphite card on black with a grain, one pixel edges that catch the light and a single mint accent. The ten recovery codes wait under frosted glass; a tap on Reveal lifts it like a blind and the letters roll and land like a split-flap board. Copy sends the codes flying into the button, Download drops the .txt file, a used code gets crossed out, and the box at the bottom unlocks Continue on a spring.

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>
<!--
  "Recovery 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>The two-factor recovery codes card that flips into view</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/jetbrains-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- the recovery codes card of Halden, an invented account app, at the end of turning on two-factor sign in.
         The ten codes wait under a frosted cover; one touch lifts it like a curtain and every letter flips into place
         like a split-flap board. Copy sends the codes flying into the button, Download drops the .txt file into its
         tray, one code is already used and crossed out, and the box at the bottom unlocks Continue on a spring -->
    <div class="wrap" data-wrap>
      <section class="card" data-card aria-labelledby="rc-title">
        <header class="head">
          <span class="badge" aria-hidden="true">
            <svg viewBox="0 0 24 24" fill="none">
              <path d="M12 2.8 19 5.6v5.6c0 4.6-3 8.2-7 9.9-4-1.7-7-5.3-7-9.9V5.6l7-2.8Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
              <circle cx="12" cy="10.4" r="1.9" stroke="currentColor" stroke-width="1.5"/>
              <path d="M12 12.3v3.2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
            </svg>
          </span>
          <div class="head__txt">
            <h1 id="rc-title">Save your recovery codes</h1>
            <p>Lost your phone? Each code signs you in once.</p>
          </div>
          <span class="chip">
            <svg viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M3.5 8.4 6.4 11.2 12.5 5" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>
            2FA on
          </span>
        </header>

        <div class="vault" data-vault>
          <ul class="codes" data-codes aria-label="Recovery codes"></ul>
          <div class="cover" data-cover>
            <button class="reveal" type="button" data-reveal>
              <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
                <path d="M2.6 12C4.6 7.9 8 5.8 12 5.8s7.4 2.1 9.4 6.2c-2 4.1-5.4 6.2-9.4 6.2s-7.4-2.1-9.4-6.2Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
                <circle class="reveal__pupil" cx="12" cy="12" r="2.8" stroke="currentColor" stroke-width="1.5"/>
              </svg>
              <span>Reveal codes</span>
            </button>
            <span class="cover__hint">Make sure no one is looking</span>
          </div>
          <i class="vault__sheen" data-sheen aria-hidden="true"></i>
        </div>

        <div class="actions">
          <button class="act" type="button" data-copy aria-label="Copy codes">
            <span class="act__face" data-face><span class="act__icon" aria-hidden="true">
              <svg class="i-copy" viewBox="0 0 20 20" fill="none">
                <rect x="6.5" y="6.5" width="9.5" height="9.5" rx="2.2" stroke="currentColor" stroke-width="1.4"/>
                <path d="M13.2 4.4V4.2A2.2 2.2 0 0 0 11 2H5.2A2.2 2.2 0 0 0 3 4.2V10c0 1.2 1 2.2 2.2 2.2h.2" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
              </svg>
              <svg class="i-ok" viewBox="0 0 20 20" fill="none">
                <path d="M4.5 10.4 8.2 14l7.3-7.6" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" pathLength="1" stroke-dasharray="1" stroke-dashoffset="1"/>
              </svg>
            </span>
            <span class="act__words"><span class="act__rest">Copy</span><span class="act__done">Copied</span></span></span>
          </button>
          <button class="act" type="button" data-download aria-label="Download codes as a text file">
            <span class="act__face" data-face><span class="act__icon" aria-hidden="true">
              <svg class="i-down" viewBox="0 0 20 20" fill="none">
                <path class="i-down__arrow" d="M10 3v8.6M6.4 8.2 10 11.8l3.6-3.6" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>
                <path class="i-down__tray" d="M3.4 12.6v1.6c0 1.2 1 2.2 2.2 2.2h8.8c1.2 0 2.2-1 2.2-2.2v-1.6" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
              </svg>
              <svg class="i-ok" viewBox="0 0 20 20" fill="none">
                <path d="M4.5 10.4 8.2 14l7.3-7.6" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" pathLength="1" stroke-dasharray="1" stroke-dashoffset="1"/>
              </svg>
            </span>
            <span class="act__words"><span class="act__rest">Download</span><span class="act__done">Saved .txt</span></span></span>
            <span class="file" data-file aria-hidden="true">
              <svg viewBox="0 0 16 20" fill="none"><path d="M2.5 2.5h7l4 4v11h-11v-15Z" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/><path d="M9.5 2.5v4h4M5 10.5h6M5 13h6M5 15.5h3.5" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>
              <span>halden-codes.txt</span>
            </span>
          </button>
        </div>

        <div class="meta">
          <span><b data-left>9</b> of 10 left</span>
          <span class="meta__sep" aria-hidden="true">·</span>
          <span>Generated 6 Nov 2026</span>
        </div>

        <footer class="foot">
          <label class="tick" data-tick>
            <input type="checkbox" data-saved>
            <span class="tick__box" aria-hidden="true">
              <svg viewBox="0 0 16 16" fill="none"><path d="M3.6 8.3 6.6 11.2 12.4 5.1" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" pathLength="1" stroke-dasharray="1" stroke-dashoffset="1"/></svg>
            </span>
            <span class="tick__words">I've saved these codes</span>
          </label>
          <button class="go" type="button" data-go disabled>
            <span class="go__glow" aria-hidden="true"></span>
            <span class="go__words">Continue</span>
            <svg class="go__arrow" viewBox="0 0 20 20" fill="none" aria-hidden="true"><path d="M4 10h11M11 5.8 15.2 10 11 14.2" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>
          </button>
        </footer>
        <div class="flyers" data-flyers aria-hidden="true"></div>
      </section>
    </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.

31 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 “Recovery 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 a black page a graphite card rises, with a very fine grain, a thread of mint light on its top edge and deep layered shadows. At the top a shield with a keyhole on a mint glass tile, the title Save your recovery codes, the line Lost your phone? Each code signs you in once and the 2FA on tag with its check. Below, in a darker well, the ten recovery codes in two columns, covered by frosted glass with the Reveal codes button and the warning Make sure no one is looking. On a tap the button squashes, the eye's pupil widens, and the glass lifts like a blind from the bottom up: as soon as a row is free, every letter of every code rolls through a few random letters with the split line of the flaps, then stops on its own on a spring, staggered from the others. A mint light sweeps over the well, and a line draws through the fourth code, with Used beside it. Then Copy squashes, the nine good codes light up and fly one after the other into the button on an arc, shrinking; the button swells a little and becomes Copied with a check drawing itself. Download squashes, its arrow dips, the word falls away and from the top the file halden-codes.txt arrives, settles on a spring and then drops through the button, which becomes Saved .txt. At the bottom the box I've saved these codes squashes and fills with mint with a check, and Continue, off until now, lights up from its centre on a spring, swells and its arrow takes a step forward; on a tap the arrow leaves to the right and comes back from the left. After a while everything goes back, the glass comes down and the letters shuffle; the round starts again. Every button works by hand too: Copy really copies the codes to the clipboard and Download really downloads the file.

How it works

Every letter is a window

The codes are built by the script, letter by letter: each letter is a span one line tall with hidden overflow, and the real letter sits inside. The dash stays still. While the glass is down, each window shows a random letter from the codes' alphabet (without 0, O, 1 and I, which get mixed up).

The blind that frees the rows from the bottom

The frosted glass is a veil with backdrop-filter over the well; to lift it GSAP takes its clip-path from inset(0 0 0 0) to inset(0 0 100% 0), so its lower edge rises. The moment each row starts is worked out from the blind's duration and the row's position, from the last row to the first, so the letters start rolling right when the edge uncovers them.

The split-flap board

Each letter has its own timeline: FLIPS short steps, in each a random letter comes in from above with yPercent and a little transparency, while a one pixel line across the middle of the window (a CSS variable animated by GSAP) shows the split of the flaps. The last step sets the right letter on a spring and the line goes away. Letters in the same row start 18 thousandths apart and take one, two or three more turns depending on their place.

A real spring as the ease

Every settle uses the same function: a damped oscillator, 1 minus e to the minus d times t times the cosine of 2.5 pi times t. At t equal to 1 the cosine is zero, so the spring lands exactly in place at the end of the tween after passing the mark only once: the one pixel overshoot. SPRING changes the damping.

Codes flying to the clipboard and the falling file

For Copy the script measures where each code sits and where the button's icon sits inside the card; a copy of each code leaves its place and heads to the icon with two separate tweens, x with power2.in and y with back.in, which together draw an arc. The Download file lives inside the button, which hides its overflow: it comes in from the top, settles and drops out of the bottom, so it never covers the words around.

Values to change

NameFileDefaultWhat it changes
CODESscript.jsK7QD-M4XP 9HTR-2WVB PL3N-8KEF Z6YC-QJ5R 4MBW-T9HS RX8E-VN2K C5JP-7LDA W2FU-K6QM 8TGH-3ZYN E9VS-P4CJThe ten codes, split by spaces.
USEDscript.js4Which code is already used and crossed out, from 1 to 10; 0 for none.
FLIPSscript.js7How many random glyphs each letter rolls through before it lands.
FLAPscript.js0.045How many seconds one roll of a letter lasts.
CURTAINscript.js0.95How many seconds the frosted glass takes to lift.
SPRINGscript.js1How springy every settle is: 0.5 calm, 2 very bouncy.
AUTOscript.jstrueReveals, copies, downloads and continues by itself until someone touches the card.

Try them in the Playground

When to use it

In the last step of turning on two-factor sign in for an app, an online bank, a password manager, a crypto wallet or any account: when the user has to save the recovery codes before moving on. The glass keeps the codes away from prying eyes, Copy and Download put them somewhere safe and the box makes people pause before Continue.

On phones

On the phone the card takes almost the whole width and every size follows the screen's height too, so it fits whole even in the short preview box; the 2FA on tag hides to leave room for the title. A tap instead of a click on every button. The rest is the same.

With reduced motion

Nothing moves: the glass fades away and the codes appear already in place, the line over the used code is already drawn, the buttons change word and icon with a fade, with no flying codes and no falling file, and the box and Continue light up with a fade.

Pitfalls

  • The .txt file was born above the Download button and for a moment covered the line Generated 6 Nov 2026: it now lives inside the button, which hides its overflow, comes in from the top and drops out of the bottom, and the button's word slides away before it arrives.
  • The file was centred with translateX(-50%) in the CSS and GSAP, when animating it, wiped that transform: the file jumped to the right. GSAP now holds the centre with xPercent and yPercent.
  • With sizes in pixels the card was right on the computer but came out below the phone's preview box, 410 tall: every size is in em on a font size that is the smaller of a share of the width and a share of the height, so the card shrinks whole.
  • Letters rolling all at once looked like noise: each row starts when the edge of the blind uncovers it, the letters in a row are staggered and take a different number of turns, so the eye reads a wave rising from the bottom.

Libraries

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

Compressed with gzip, the three demo files weigh 11 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