
The elastic button
Buttons, Hover, Text
A black pill button, Get the app, on white: under the pointer it springs open into a small white card with the app icon, a QR code and two store buttons. The QR modules arrive in waves from the centre to the edges, after the three corner squares; then a viewfinder tightens, a blue scan line passes twice and the line below says the link has reached the phone. When the pointer leaves, the card folds back into the pill.
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>
<!--
"Get the app QR button" 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 Get the app button that reveals a QR code</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" data-stage>
<!-- a black pill that springs open into a small card with a QR code: the modules arrive in waves from the centre,
a scan line passes over them, and the card folds back into the pill when the pointer leaves -->
<div class="slot" data-slot>
<div class="app" data-app>
<button class="app__pill" type="button" data-pill aria-expanded="false" aria-controls="app-card">
<svg class="app__phone" viewBox="0 0 20 20" aria-hidden="true"><rect x="5.5" y="2.5" width="9" height="15" rx="2.4"></rect><path d="M8.6 14.6h2.8"></path></svg>
<span class="app__label" data-label>Get the app</span>
<svg class="app__chev" data-chev viewBox="0 0 20 20" aria-hidden="true"><path d="M7.5 5.5 12 10l-4.5 4.5"></path></svg>
</button>
<div class="card" id="app-card" data-card role="group" aria-label="Download Nimbli">
<div class="card__head" data-row>
<span class="card__icon" aria-hidden="true">
<svg viewBox="0 0 32 32"><path d="M8 20.5c3.2-7.5 6.4-9.8 8-9.8 2.6 0 2 6.8 4.6 6.8 1.4 0 2.4-1.6 3.4-3.4"></path></svg>
</span>
<span class="card__name">
<strong>Nimbli</strong>
<small>Daily habits, kept light</small>
</span>
<button class="card__close" type="button" data-close aria-label="Close">
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M6 6l8 8M14 6l-8 8"></path></svg>
</button>
</div>
<div class="qr" data-qr data-row>
<svg class="qr__code" data-code viewBox="0 0 29 29" aria-hidden="true"></svg>
<span class="qr__badge" data-badge aria-hidden="true">
<svg viewBox="0 0 32 32"><path d="M8 20.5c3.2-7.5 6.4-9.8 8-9.8 2.6 0 2 6.8 4.6 6.8 1.4 0 2.4-1.6 3.4-3.4"></path></svg>
</span>
<span class="qr__scan" data-scan aria-hidden="true"></span>
<svg class="qr__frame" data-frame viewBox="0 0 100 100" preserveAspectRatio="none" aria-hidden="true">
<path d="M2 16V6a4 4 0 0 1 4-4h10M84 2h10a4 4 0 0 1 4 4v10M98 84v10a4 4 0 0 1-4 4H84M16 98H6a4 4 0 0 1-4-4V84"></path>
</svg>
</div>
<p class="card__hint" data-row>
<span class="card__say" data-say>Scan with your phone</span>
<span class="card__sub" data-sub>Free on iOS and Android</span>
</p>
<div class="card__stores" data-row>
<a class="store" href="#ios" data-store="ios">
<svg viewBox="0 0 20 20" aria-hidden="true"><rect x="6" y="2.8" width="8" height="14.4" rx="2.2"></rect><path d="M9 4.9h2"></path></svg>
<span>iOS</span>
</a>
<a class="store" href="#android" data-store="android">
<svg viewBox="0 0 20 20" aria-hidden="true"><rect x="5.6" y="2.8" width="8.8" height="14.4" rx="1.6"></rect><path d="M8.4 14.9h3.2"></path></svg>
<span>Android</span>
</a>
</div>
</div>
</div>
</div>
<p class="note" data-note>Nimbli · 4.8 from 12k ratings</p>
<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>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
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 “Get the app QR button” from Animorio and fit it into my siteThe pill and the card are the same black box: GSAP animates its width, height and corner radius, with back.out for the spring and the height starting six hundredths after the width. Inside, the white card is inset by one pixel and appears once the box, while growing, has already turned white: the pixel left on the edge then darkens slightly into a thin grey outline. Closing does the opposite, and the empty box turns black again as it shrinks.
The code is a 29 by 29 grid in an SVG: the three corner squares with their eye, the alternating timing rows, the alignment square at the bottom right, a hole in the middle for the icon and the rest at random from a generator that always starts from the same seed. Each module is a rect with transform-box fill-box, so it scales from its own centre.
Each module knows its distance from the centre, divided by the corner’s distance; GSAP’s stagger is a function returning that distance times WAVE seconds, plus a small offset different for each module, so the wave never looks like a perfect circle. The corners arrive first, with a wider bounce.
The viewfinder tightens from 1.08 to 1 with back.out, the line goes down and up across the QR’s height measured in pixels, the modules lighten in a row as it passes and the viewfinder beats once before the line changes. Lines change by rising: they leave five pixels upwards and come in from six below on a spring.
The card takes its size from the window (at most 272 by 336) and the QR what is left, worked out again on resize even with the card open. The autopilot is a new timeline every round, with positions read at the right moment: it opens, watches the scan, presses iOS and leaves. At the first real touch it stops.
| Name | File | Default | What it changes |
|---|---|---|---|
LABEL | script.js | Get the app | The label of the closed button. |
APP_NAME | script.js | Nimbli | The app’s name. |
TAGLINE | script.js | Daily habits, kept light | The grey line under the name. |
HINT | script.js | Scan with your phone | The line under the QR code. |
ACCENT | script.js | #2f6bff | The colour of the scan line and the viewfinder. |
SPRING | script.js | 1.3 | How much the card bounces as it opens. |
WAVE | script.js | 0.6 | The seconds the modules take from the centre to the edges. |
SCAN_TIME | script.js | 1.1 | The seconds of one pass of the scan line. |
On an app’s landing page, in the header of a site that also has an app, in a service’s footer, next to a ticket or a booking to open on the phone.
The card takes the screen width minus 32 pixels and the height there is, the QR shrinks down to 96 pixels; it all works itself out again when the window changes. A tap opens and closes like a click, and a tap outside the card closes it.
The pill becomes the card and back without a spring, the modules all fade in together, the scan line does not move: only the viewfinder lights up and the lines change with a fade.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.5 KB; the libraries: GSAP 28 KB.
Tested on 25 October 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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
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.