Skip to content
animorio
IT
Back to the library

Password generator

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

A text animation inside a real interface piece: the password generator of an invented password manager, a dark card with the password in a recessed well. Every character shuffles through other glyphs and then lands in place, letters in white, numbers in blue, symbols in amber. The length slider adds characters at the end, the Symbols switch re-rolls only the places that change, the strength and the bits follow, and Copy sweeps a selection over the password and 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>
<!--
  "Password generator" 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 password generator with the shuffling characters</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 password generator of an invented password manager, Keyhaven, on a dark card. The password sits in a
         recessed well: every character shuffles through other glyphs before it lands, letters in white, numbers in
         blue, symbols in amber. Sliding the length adds or takes away characters, the Symbols switch re-rolls only the
         places that change, Copy selects the password and says Copied. A soft light on the edge goes where the action is -->
    <section class="gen" data-gen aria-label="Password generator">
      <span class="gen__spot" aria-hidden="true"></span>
      <span class="gen__edge" aria-hidden="true"></span>
      <div class="gen__body">
        <header class="gen__head">
          <span class="gen__app">
            <svg class="gen__logo" viewBox="0 0 24 24" aria-hidden="true">
              <defs>
                <linearGradient id="gen-logo" x1="0" y1="0" x2="1" y2="1">
                  <stop offset="0" stop-color="#8ea6ff"/>
                  <stop offset="1" stop-color="#4c63e6"/>
                </linearGradient>
              </defs>
              <rect x="1" y="1" width="22" height="22" rx="7" fill="url(#gen-logo)"/>
              <rect x="1.5" y="1.5" width="21" height="21" rx="6.5" fill="none" stroke="rgba(255,255,255,0.35)"/>
              <circle cx="12" cy="10" r="3.1" fill="#0d0f16"/>
              <path d="M10.6 12.2h2.8l0.7 5.2h-4.2z" fill="#0d0f16"/>
            </svg>
            <span class="gen__title">Generate password</span>
          </span>
          <span class="gen__site">arcline.app</span>
        </header>

        <div class="gen__well" data-well>
          <span class="gen__sel" data-sel aria-hidden="true"></span>
          <p class="gen__pw" data-pw aria-hidden="true"></p>
          <span class="gen__sheen" aria-hidden="true"><span class="gen__sheen-band" data-sheen></span></span>
        </div>

        <div class="gen__meter" data-meter>
          <span class="gen__bars" aria-hidden="true"><i></i><i></i><i></i><i></i></span>
          <span class="gen__grade"><span class="gen__word" data-word>Strong</span><span class="gen__bits"><span data-bits>0</span> bits</span></span>
        </div>

        <div class="gen__row">
          <span class="gen__k" id="gen-len">Length</span>
          <div class="gen__slider" data-slider role="slider" tabindex="0" aria-labelledby="gen-len" aria-valuemin="8" aria-valuemax="32" aria-valuenow="16">
            <span class="gen__track"><span class="gen__fill"></span></span>
            <span class="gen__thumb"></span>
          </div>
          <span class="gen__len" data-len>16</span>
        </div>

        <div class="gen__opts">
          <button class="gen__opt is-on" type="button" data-opt="digits" aria-pressed="true">
            <span>Numbers</span><span class="gen__sw" aria-hidden="true"><span class="gen__knob"></span></span>
          </button>
          <button class="gen__opt" type="button" data-opt="symbols" aria-pressed="false">
            <span>Symbols</span><span class="gen__sw" aria-hidden="true"><span class="gen__knob"></span></span>
          </button>
        </div>

        <div class="gen__actions">
          <button class="gen__regen" type="button" data-regen aria-label="Generate a new password">
            <svg class="gen__regen-icon" data-regen-icon viewBox="0 0 20 20" aria-hidden="true">
              <path d="M15.6 7.4A6.2 6.2 0 0 0 4.3 7"/>
              <path d="M15.9 3.6v3.9H12"/>
              <path d="M4.4 12.6A6.2 6.2 0 0 0 15.7 13"/>
              <path d="M4.1 16.4v-3.9H8"/>
            </svg>
          </button>
          <button class="gen__copy" type="button" data-copy>
            <span class="gen__copy-face" data-face>
              <svg class="gen__copy-icon" viewBox="0 0 16 16" aria-hidden="true">
                <g data-copy-icon>
                  <rect x="5.2" y="5.2" width="8" height="8" rx="2"/>
                  <path d="M10.8 3.4A1.9 1.9 0 0 0 9 2.4H4.4a2 2 0 0 0-2 2V9a1.9 1.9 0 0 0 1 1.7"/>
                </g>
                <path class="gen__check" data-check pathLength="1" d="M3.2 8.4l3 3 6.6-6.8"/>
              </svg>
              <span class="gen__copy-words" data-words>Copy password</span>
            </span>
            <span class="gen__clear" data-clear aria-hidden="true"></span>
          </button>
        </div>
      </div>
    </section>
    <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.

29 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 “Password generator” 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 near black page, with a cold light above, a warm one below and a little grain, a dark card rises: the Keyhaven icon, ‘Generate password’ and the site it is for, arcline.app. In the middle sits a well, recessed like dark glass. The round regenerate button turns half a turn and the password comes in: every character runs through other grey glyphs and then lands in its colour, dropping a pixel and lighting up for an instant; letters are white, numbers blue, symbols amber, and a glint crosses the well. Below, four bars tell the strength, ‘Strong’ and ‘93 bits’ counting up. The length slider glides from 16 to 24: the new characters arrive at the end one after another, the word turns into ‘Excellent’ and the bits climb. Then ‘Symbols’ goes on: the switch snaps over on a spring and only the places that become symbols shuffle again, the others stay. Finally ‘Copy password’ is pressed: it gives and comes back on an elastic, a blue selection sweeps over the password, the icon makes way for a checkmark that draws itself, the label turns into ‘Copied’ and a thin line at the bottom of the button runs out until the clipboard clears. Then the symbols go off, the length goes back to 16 and the loop starts again with a new password. A light on the card's edge always goes where something happens, and with a mouse it follows the pointer; the character under the pointer rises by two pixels. Everything really works: the slider drags, the switches toggle, Copy copies.

How it works

One character, one span

The password is a row of 1ch wide spans in a monospace face, inside a wrapping flex: every character moves on its own and the line does not wobble when a letter changes.

Fixed random numbers for every place

Every place has its own random numbers, worked out from seed, place and use with a small hash: they say whether a letter, a number or a symbol goes there and which. Lengthening only adds places at the end; turning symbols on only changes the places whose number falls in the symbols' band. Regenerating means changing the seed.

The shuffle in a single ticker

A single gsap.ticker watches every moving character: from its start time (staggered 0.03 s apart) it shows a random glyph every 50 ms in grey, at its end time it puts the real one in its colour and a tween drops it 3 px with a back.out and lights it with a brightness filter.

Strength and bits

The bits are the length times the base 2 logarithm of the possible glyphs (49 letters, 8 numbers, 12 symbols): a tween on an object counts them, and a data-level attribute colours the four bars with a different transition delay for each.

Copy and the edge light

Pressing Copy a selection is measured over the password and opens with scaleX from the left, the label changes with a small blur and the check draws itself with stroke-dashoffset. The edge light is a radial gradient in a box masked down to 1 px, moved by two quickTo calls toward the control in use.

Values to change

NameFileDefaultWhat it changes
START_LENGTHscript.js16The length of the password at the start.
LONG_LENGTHscript.js24The length the slider glides to on its own.
SCRAMBLEscript.js0.42How long each character shuffles before it lands, in seconds.
STAGGERscript.js0.03The wait between one character and the next, in seconds.
COPIED_HOLDscript.js2.4How long Copied stays, in seconds.
GLOWscript.js1How bright the light on the edge is.
SPEEDscript.js12 = the walk on its own twice as fast, 0.5 = half.
LOOPscript.jstrueRepeats the walk.

Try them in the Playground

When to use it

For the sign up form of an app or an online service, for a password manager, for the security page of an account: wherever a new password has to feel solid and easy to copy.

On phones

The same animation with adapted sizes: the card is as wide as the screen allows, the well, the buttons and the gaps shrink with the height and the password uses a slightly smaller size; the slider drags with a finger and the edge light follows the controls.

With reduced motion

Nothing moves: the characters do not shuffle but change with a fade, the slider and the switches go straight to their place, the selection and the Copied label fade in and the edge light stays on.

Pitfalls

  • If the random characters depend only on the seed, lengthening or turning symbols on reshuffles the whole password: every place needs its own fixed random numbers, so only the ones that must change do.
  • A monospace face at 1ch per span keeps the line still while it shuffles; with a proportional face the neighbouring letters wobble at every glyph.
  • The timed walk starts from the page's load event, not from the script: that way the poster and the video always land on the same moment.

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 2 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 animations