Skip to content
animorio
IT
All components

Request access button

Buttons, Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 6.3 KBGSAP 28 KBFreeDownload the zip

The «Request access» button of a shared document you can’t open yet, with its blurred preview on top. Press it and the lock in the pill snaps shut, the label rolls into «Request sent», the file owner’s avatar settles in on a spring and a thin line runs inside the pill while you wait; then the shackle lifts, the pill widens into «Open document» and the preview comes into focus. You can add a note before sending. Minimal style, on white, with a single burnt orange accent.

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>
<!--
  "Request access 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>Request access button</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">
    <!-- a shared document you cannot open yet: the blurred preview behind, a lock, and the Request access pill.
         Press it: the lock snaps shut, the owner's avatar settles in, a thin line runs while you wait,
         then the shackle lifts, the pill widens into Open document and the preview comes into focus -->
    <section class="card" data-card aria-label="Shared document">
      <div class="doc" data-doc aria-hidden="true">
        <div class="doc__page" data-page>
          <span class="doc__kicker"></span>
          <span class="doc__title"></span>
          <span class="doc__title doc__title--short"></span>
          <span class="doc__chart">
            <i style="--h:.42"></i><i style="--h:.66"></i><i style="--h:.5"></i><i style="--h:.84"></i><i style="--h:.72"></i><i style="--h:.94"></i>
          </span>
          <span class="doc__line"></span>
          <span class="doc__line"></span>
          <span class="doc__line doc__line--short"></span>
        </div>
      </div>

      <div class="panel">
        <div class="file">
          <svg class="file__icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M5 2.5h6.5l3.5 3.5v11.5H5z"/><path d="M11.5 2.5V6H15"/><path d="M7.5 10h5M7.5 13h3.5"/></svg>
          <span class="file__name">Q4 launch plan</span>
          <span class="file__app">Inkwell Docs</span>
        </div>

        <h1 class="panel__title"><span class="roll" data-title><span class="roll__line">You need access</span></span></h1>
        <p class="panel__sub"><span class="roll" data-sub><span class="roll__line">Ask the owner to let you in.</span></span></p>

        <div class="owner" data-owner>
          <span class="avatar" aria-hidden="true">ML</span>
          <span class="owner__text"><span class="owner__label">Owner</span><span class="owner__name">Maya Lund</span></span>
        </div>

        <div class="note" data-note>
          <button class="note__toggle" type="button" data-note-toggle aria-expanded="false">
            <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 3.5v9M3.5 8h9" data-plus/></svg>
            <span>Add a note</span>
          </button>
          <div class="note__box" data-note-box>
            <label class="sr" for="nota">Note for Maya</label>
            <input id="nota" class="note__field" data-note-field type="text" maxlength="60" placeholder="Hi Maya, I'm on the launch team" autocomplete="off">
          </div>
        </div>

        <button class="pill" type="button" data-pill>
          <span class="pill__face" data-face>
            <svg class="lock" viewBox="0 0 16 16" aria-hidden="true">
              <path class="lock__shackle" data-shackle d="M5 7.2V5.4a3 3 0 0 1 6 0v1.8"/>
              <rect class="lock__body" x="3.4" y="7.2" width="9.2" height="6.6" rx="1.6"/>
              <path class="lock__hole" d="M8 9.8v1.6"/>
            </svg>
            <span class="roll pill__roll" data-label><span class="roll__line">Request access</span></span>
          </span>
          <span class="pill__wait" data-wait aria-hidden="true"><span data-wait-run></span></span>
        </button>
        <p class="sr" aria-live="polite" data-live></p>
      </div>
    </section>
  </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.

27 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Request access button” 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

A card with the blurred preview of «Q4 launch plan» from Inkwell Docs and, below it, «You need access», «Ask the owner to let you in.», «Add a note» and the orange «Request access» pill with its lock. Press it and the pill sinks to 0.97, the lock snaps shut, the pill turns dark and says «Request sent» with a thin line running inside, the title rolls, Maya Lund’s ML avatar arrives. A few seconds later the shackle lifts, the pill turns orange again and widens into «Open document», the title says «You’re in» and the preview comes into focus.

How it works

Three states

The state is a single word, locked, sent or open: the click sends the request or, once open, goes back to the start; Esc resets from any state.

The pill follows its label

Before changing the label the width is measured, measured again after, and GSAP springs from one to the other, then clears the fixed width.

The lock

The shackle is its own path inside the svg: it drops a hair with back.out when it snaps shut and rises 4.5 px when access is granted.

The wait

No dots: a thin white line runs along the bottom of the pill, repeating, until access arrives (a GSAP delayedCall, never setTimeout).

The preview

The blurred page is drawn with shapes and lines: GSAP takes the blur from 4 to 0 px and the opacity to 1, with a small upward bounce.

Values to change

NameFileDefaultWhat it changes
WAITscript.js2.6Seconds of waiting before the owner grants access.
PRESSscript.js0.97Scale of the pill while pressed.
SNAPscript.js3Pixels the shackle drops when the lock snaps shut.
LIFTscript.js4.5Pixels the shackle rises when access is granted.
SPRINGscript.js0.55How springy the avatar and the note are (lower means more bounce).
BLURscript.js4Pixels of blur on the locked preview.
AUTO_PAUSEscript.js7Seconds of quiet before the demo plays by itself again.

Try them in the Playground

When to use it

On the page of a document, a project or a shared folder the visitor can’t open yet: in docs and design apps, back offices, team workspaces.

On phones

Everything is in em and the size depends on both the width and the height of the window, so the card fits the phone box. A tap works like a click.

With reduced motion

No springs or movement: the labels, the avatar, the note and the preview change with a fade, the waiting line stays still and the lock changes position without a snap.

Pitfalls

  • The pill width is measured before and after the label changes: animating without measuring leaves it at the old size.
  • The shackle moves with y inside the svg, not with a transform on the whole svg, or the whole lock moves.
  • The waiting line has repeat: -1: it has to be killed when access arrives or when you go back.
  • There is deliberately no presence dot on the avatar: only the initials.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 6.3 KB; the libraries: GSAP 28 KB.

Testing

Tested on 26 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