
The colour columns
Hover, SVG
The sign-in card of a made-up notes app, Keel: you unlock it by drawing a pattern across nine dots. The line starts on the first dot, follows your finger like a stretched band and snaps to every dot it crosses, which swells on a spring; a dot skipped in the middle is taken on its own. A wrong pattern turns soft red, the grid shakes two pixels, the tries counter rolls and the line pulls back; the right one lights up blue, the dots gather to the centre, the lock opens and the card says «Welcome back». Minimal style, a single accent.
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>
<!--
"Pattern lock" 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>Pattern lock</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>
<!-- The pattern unlock of a made-up notes app, Keel. Drag across the nine dots: the line starts on the first dot,
follows the pointer like a stretched band and snaps to every dot it crosses (a dot skipped in the middle is taken
on its own, like on a phone). Let go: a wrong pattern turns soft red, the grid shakes and the line pulls back;
the right one lights up, the dots gather to the centre, the lock opens and the card says welcome back. -->
<main class="stage">
<section class="card" data-card aria-label="Keel, unlock with your pattern">
<header class="card__top">
<svg class="lock" data-lock viewBox="0 0 24 24" aria-hidden="true">
<path class="lock__shackle" data-shackle d="M8 11V8.2a4 4 0 0 1 8 0V11"/>
<rect class="lock__body" x="5.5" y="11" width="13" height="9.5" rx="2.6"/>
<path class="lock__hole" d="M12 14.6v2.2"/>
</svg>
</header>
<div class="views">
<div class="view view--lock" data-view-lock>
<h1 class="title">Draw your pattern</h1>
<p class="hint" aria-live="polite">
<span class="hint__msg" data-msg>to unlock Keel</span>
</p>
<div class="pad" data-pad>
<svg class="grid" data-grid viewBox="0 0 300 300" role="img" aria-label="Nine dots to connect">
<g data-shadows></g>
<path class="trail" data-trail d=""/>
<g data-dots></g>
</svg>
</div>
<p class="tries"><span class="tries__slot"><span class="tries__col" data-col><span>3</span><span>2</span><span>1</span><span>3</span></span></span><span class="tries__label">tries left</span></p>
</div>
<div class="view view--hello" data-view-hello aria-hidden="true">
<span class="avatar" data-avatar><span class="avatar__text">MR</span></span>
<h2 class="hello" data-hello>Welcome back, Mara</h2>
<p class="meta" data-meta>Keel · 14 notes since Friday</p>
</div>
</div>
</section>
<svg class="pointer" data-pointer viewBox="0 0 20 20" aria-hidden="true"><path d="M4 2.5v13.2l3.6-3.4 2.4 5.4 2.3-1-2.4-5.3 5-.3z"/></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>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.
25 values to change
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Pattern lock” from Animorio and fit it into my siteThe grid is an SVG with a 300 by 300 viewBox and the nine dots at 50, 150 and 250: everything is computed in those units, so the pointer is brought into the grid by dividing by its real width, and the demo holds at any size.
The line is a single path rebuilt on every move: the dots taken plus the tail to the pointer. A dot is taken when the pointer passes within SNAP of it; the thickness goes from LINE_THICK to LINE_THIN as the line gets longer.
Between the last dot and the new one, if row and column are both an even distance apart, there is a dot in the middle: it is taken first, like on a phone, and the pattern stays the one the finger really drew.
On release the pattern is compared with PATTERN. Wrong: soft red, ±SHAKE pixel keyframes on the grid and the line pulling back through a tween on the shown fraction, switching off the dots it uncovers. Right: every dot flies to the centre with the line following, then the padlock swings around its right post with svgOrigin and the card changes view.
| Name | File | Default | What it changes |
|---|---|---|---|
PATTERN | script.js | "0-1-2-4-6-7-8" | The right pattern, dots counted from the top left (this one is a Z). |
SNAP | script.js | 36 | How close the pointer must pass to take a dot, on a 300 grid. |
LINE_THICK | script.js | 8 | The line thickness when it is short. |
LINE_THIN | script.js | 4.5 | The line thickness once it has crossed the whole grid. |
SHAKE | script.js | 2 | How many pixels the grid shakes when the pattern is wrong. |
HOLD | script.js | 2.8 | How many seconds the welcome stays before the lock comes back. |
AUTOPLAY | script.js | true | A pointer draws a wrong pattern and then the right one on its own, until you draw. |
--accent | style.css | #2f6df6 | The colour of the right pattern and of the avatar. |
--wrong | style.css | #e2564f | The soft red of the wrong pattern. |
On the lock screen of a notes app, a journal, a bank or a wallet, as an alternative to a passcode; on an app’s page to show sign-in with a gesture; anywhere a login faster than a password is needed.
The card and the grid are sized on width and height (min of vw and vh, with clamp), so they fit whole in the phone box; the finger draws the pattern as on a real phone, and the page does not scroll while you drag (touch-action: none).
No springs, shakes or flights: the dots switch on and off without swelling, the line appears whole, the grid does not shake and the card fades to the welcome; the automatic pointer is not shown.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.3 KB; the libraries: GSAP 28 KB.
Tested on 30 November 2026
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.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.