
The star rating
Ratings, SVG, Hover
The ‘Unlock early access’ button for an online shop’s members-only Black Friday: a near-black pill on white with a small line lock. On hover the lock gives a little shake and a thin light runs along the edge; pressed, the shackle lifts and swings on its pivot, lime floods the pill from the lock, the pill widens, the label rolls to ‘−40% unlocked’ and a real countdown starts with rolling figures, then ‘Shop the sale’ arrives with the arrow. A small × locks it again.
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>
<!--
"Black Friday 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>Black Friday early access button with the lock that opens</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">
<!-- the members-only button of an online shop on Black Friday: a near-black pill with a small line lock on the
right. Pressed, the shackle lifts and swings open on its pivot, the lime floods the pill from the lock, the
pill widens, the label rolls to the discount and a real countdown starts, then Shop the sale with the arrow.
A small close button (or a few seconds in the demo) locks it again -->
<div class="bf" data-wrap>
<span class="bf__glow" aria-hidden="true"></span>
<span class="bf__body" aria-hidden="true">
<span class="bf__fill" data-fill></span>
<span class="bf__sheen" data-sheen></span>
<span class="bf__light"></span>
</span>
<span class="bf__edge" aria-hidden="true"></span>
<span class="bf__ray" data-ray aria-hidden="true"></span>
<button class="bf__btn" type="button" data-btn data-autoclic aria-pressed="false" aria-describedby="bf-note">
<span class="bf__text">
<span class="line line--top"><span class="line__in" data-top>Unlock early access</span></span>
<span class="line line--sub" id="bf-note"><span class="line__in" data-sub>Black Friday · members only</span></span>
</span>
<span class="seat" data-seat aria-hidden="true">
<svg class="lock" viewBox="0 0 24 24">
<g data-lock>
<g data-lift>
<g data-arc>
<path class="lock__arc" d="M8.6 13.4V8.3a3.4 3.4 0 0 1 6.8 0v3"></path>
</g>
</g>
<rect class="lock__body" x="5.8" y="11.1" width="12.4" height="9.2" rx="2.6"></rect>
<path class="lock__hole" d="M12 14.6v2.2"></path>
</g>
</svg>
</span>
</button>
<button class="bf__close" type="button" data-close aria-label="Lock the offer again" tabindex="-1">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M8 8l8 8M16 8l-8 8"></path></svg>
</button>
</div>
<p class="sr" data-live aria-live="polite"></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>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.
18 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 “Black Friday button” from Animorio and fit it into my siteIn the SVG the shackle sits inside two groups: the outer one lifts by 2.6 units, the inner one rotates by SWING degrees with svgOrigin 8.6 13.4, the foot of the long leg, the real pivot. The long leg goes into the lock body, drawn after it and filled with the seat colour, so it stays attached as it lifts. A third group, the whole lock, shakes round the centre of the body.
The accent colour is a layer inside the pill’s body, cut by a clip-path circle: its centre is worked out in percent where the lock will sit once the pill is wide, and the radius goes from 0 to 120%. Closing, the centre is read back from the style and the circle goes back to 0.
Widths in pixels from the window (at most the width minus 32): the pill and the button inside widen together with back.out, the button 44 pixels less to leave room for the ×, which is a separate button. On resize the widths are set again, even half way through.
The end of the offer is fixed when the page opens (ENDS). The GSAP ticker compares the figures with the real second every frame and rolls only those that changed: each figure has its own window with overflow hidden, the old one rises and fades, the new one comes from below with a pixel of overshoot.
A conic-gradient with a single light band, seen through a one-pixel ring (mask with content-box and exclude): GSAP turns the --a variable from minus 40 to 320 degrees once, when the pointer arrives.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #d4ff3a | The colour that fills the pill when it opens. |
DISCOUNT | script.js | 40 | The discount that unlocks, in percent. |
CTA | script.js | Shop the sale | The label that comes after the discount. |
ENDS | script.js | 2d 06:12:09 | How long is left before the offer ends when the page opens. |
WIDEN | script.js | 60 | By how many pixels the unlocked pill widens. |
SWING | script.js | 32 | By how many degrees the shackle swings on its pivot. |
SPRING | script.js | 1 | How lively the springs are: 0.4 calm, 2 very bouncy. |
RESET | script.js | 5 | After how many seconds the demo locks again by itself (0 = stays open). |
For the Black Friday or sale page of an online shop, for early access kept for newsletter subscribers or members, for a timed drop or a presale: the button that makes you feel you opened something and shows at once how long is left.
The same button: the widths always stay inside the screen minus the margins. On touch there is no light following the pointer nor the hover shake; the rest is the same, and the × is 30 pixels wide.
No springs, no swings and no rolling lines: the lime fades in, the pill is wide at once, the lock is already open, the labels and figures change with a fade.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.0 KB; the libraries: GSAP 28 KB.
Tested on 19 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.
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.