Skip to content
animorio
IT
All components

Upgrade to Pro foil button

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

The Upgrade to Pro button of Sablo, a made-up notes app, on black: a matte graphite pill. Held down, a sheet of brushed silver is stamped onto it from left to right, like the foil a printer presses onto a card: the hot edge of the die runs on its front, the label stays pressed into the metal and a small ring counts the hold. Let go too early and the foil lifts and peels back. Held to the end, the foil is stamped: the pill swells and settles, a light runs across the silver, the label rolls to You’re Pro, the badge gets its tick and the plan opens below with its three perks.

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>
<!--
  "Upgrade to Pro foil 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 Upgrade to Pro button with the silver foil stamped as you hold it</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>
    <!-- the Upgrade to Pro button of Sablo, a made-up notes app: hold it and a sheet of brushed silver foil is
         stamped onto the matte pill from left to right, as a printer stamps foil onto a card. Let go too early and
         the foil peels back; hold to the end and it is stamped, the label becomes You're Pro and the plan opens below -->
    <div class="fit" data-fit>
      <div class="col">
        <button class="btn" type="button" data-btn aria-describedby="hint" aria-label="Hold to upgrade to Sablo Pro">
          <span class="btn__matte" aria-hidden="true">
            <span class="btn__glint" data-glint></span>
          </span>

          <!-- the foil: the same pill in brushed silver, revealed by a clip from the left -->
          <span class="foil" data-foil aria-hidden="true">
            <span class="foil__brush"></span>
            <span class="foil__band" data-band></span>
            <span class="foil__edge" data-edge></span>
          </span>

          <!-- two copies of the content: light on the matte, dark and debossed on the foil -->
          <span class="face face--matte" data-face-matte aria-hidden="true">
            <svg class="badge" viewBox="0 0 24 24"><path class="badge__hex" d="M12 2.6 20.1 7.3v9.4L12 21.4 3.9 16.7V7.3z"/><path class="badge__p" d="M10 16.2V8h3.1a2.5 2.5 0 0 1 0 5H10"/><path class="badge__tick" data-tick-matte d="M8.2 12.3l2.6 2.6 5-5.3"/></svg>
            <span class="label"><span class="label__win" data-win-matte><span class="label__a">Upgrade to Pro</span><span class="label__b">You’re Pro</span></span></span>
            <span class="hold" data-hold-matte><svg viewBox="0 0 20 20"><circle class="hold__track" cx="10" cy="10" r="7.5"/><circle class="hold__fill" data-ring cx="10" cy="10" r="7.5" pathLength="100"/></svg><span class="hold__word">Hold</span></span>
          </span>
          <span class="face face--foil" data-face-foil aria-hidden="true">
            <svg class="badge" viewBox="0 0 24 24"><path class="badge__hex" d="M12 2.6 20.1 7.3v9.4L12 21.4 3.9 16.7V7.3z"/><path class="badge__p" data-p-foil d="M10 16.2V8h3.1a2.5 2.5 0 0 1 0 5H10"/><path class="badge__tick" data-tick-foil d="M8.2 12.3l2.6 2.6 5-5.3"/></svg>
            <span class="label"><span class="label__win" data-win-foil><span class="label__a">Upgrade to Pro</span><span class="label__b">You’re Pro</span></span></span>
            <span class="hold" data-hold-foil><svg viewBox="0 0 20 20"><circle class="hold__track" cx="10" cy="10" r="7.5"/><circle class="hold__fill" cx="10" cy="10" r="7.5" pathLength="100" style="stroke-dashoffset:0"/></svg><span class="hold__word">Hold</span></span>
          </span>
        </button>

        <p class="hint" id="hint" data-hint>Press and hold to stamp</p>

        <!-- the plan, opening under the stamped button -->
        <section class="plan" data-plan aria-hidden="true" aria-label="Sablo Pro">
          <div class="plan__in" data-plan-in>
            <div class="plan__head">
              <span class="plan__name">Sablo Pro</span>
              <span class="plan__price"><b>$8</b><span>/ month, billed yearly</span></span>
            </div>
            <ul class="plan__perks">
              <li data-perk><svg viewBox="0 0 16 16"><path d="M3.5 8.4l2.9 2.9 6.1-6.4"/></svg>Unlimited notebooks and history</li>
              <li data-perk><svg viewBox="0 0 16 16"><path d="M3.5 8.4l2.9 2.9 6.1-6.4"/></svg>Offline sync on every device</li>
              <li data-perk><svg viewBox="0 0 16 16"><path d="M3.5 8.4l2.9 2.9 6.1-6.4"/></svg>Shared spaces for up to 5 people</li>
            </ul>
          </div>
        </section>

        <p class="sr" aria-live="polite" data-live></p>
      </div>
    </div>

    <!-- the drawn pointer of the autopilot -->
    <svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2v15.6l4.3-4.1 2.7 6.2 2.6-1.1-2.7-6.1h5.9z"/></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>

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.

31 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 “Upgrade to Pro foil 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

In the middle, on black, a 60 pixel matte graphite pill with a thread of light on its top edge: on the left a hexagonal badge with Sablo’s P, in the middle Upgrade to Pro, on the right a small ring with the word Hold. On hover a cool glint lights up inside the graphite and follows the pointer. Pressed and held (Space or Enter too), the pill sinks a touch and a sheet of brushed silver is stamped onto it from the left, with the fine lines of the brushing and the bands of light of the metal; the hot edge of the die, white and blue, runs on its front with a light chasing it. The label, the badge and the ring pass onto the silver pressed into the metal, dark with a lip of light below, while the ring fills. Let go before the end, the pill springs back, the edge cools and the foil lifts and peels back from its front, a little faster at the end; below it reads Hold a little longer. Held to the end, the foil is stamped: the edge flares and fades, the pill swells and settles on an elastic, a light runs across the whole silver, the label rolls to You’re Pro, the ring goes, in the badge the P gives way to a tick that draws itself, and below opens the Sablo Pro plan, 8 dollars a month, with a thread of silver on its edge and three perks rising one after the other with their tick. Over the silver the light follows the pointer, as on real foil. Pressed again, the foil lifts off from the right and the free plan comes back. A drawn pointer does the round by itself: a short hold that peels back, a full hold, the light on the silver, then everything goes back.

How it works

Two faces and one variable

The button holds two copies of the same content: a light one on the graphite and a dark one pressed into the silver. A single CSS variable, --p from 0 to 1, clips the silver and the dark face from the left with clip-path inset and the light face from the other side, so the border between them is always the same front.

The brushed silver

The foil is a slanted gradient of five silvers, with a repeating-linear-gradient of one pixel lines in overlay on top for the brushing, an inner shade below and a white thread above. The pressed label has a light text-shadow below and a dark one above, the trick of blind stamping.

Holding

On press GSAP takes --p from where it is to 1 in HOLD seconds times what is left, so a second press starts again where the foil peeled. The hot edge and the light read the same position. Letting go early, another tween takes --p back to 0 with power2.in, faster the less foil there was.

The stamp

At 1 one timeline: the edge flares and goes, the pill goes to BUMP and back with elastic.out, a blurred band of light crosses the silver, the two label windows rise one line together with back.out, the P fades and the tick draws itself with stroke-dashoffset, and the plan opens from zero height to its size.

Press, keyboard and pilot

Pointer capture keeps the press even if the finger slides off; Space and Enter do the same with keydown and keyup without repeats. The drawn pilot calls the same functions and stops at the visitor’s first real gesture.

Values to change

NameFileDefaultWhat it changes
HOLDscript.js1.35Seconds to hold before the foil is fully stamped.
PEELscript.js0.55Seconds for the foil to peel back when you let go too early.
BUMPscript.js1.035How much the pill swells when the foil is stamped (1 = not at all).
SPRINGscript.js1How springy the pill, the label and the plan are.
GLINTscript.js0.55How bright the light crossing the silver is.
PRICEscript.js8The monthly price of the plan, in dollars.
IDLEscript.js1.2Seconds before the drawn pointer starts by itself.
LOOPscript.jstrueLeft alone, the pilot does the round again.

Try them in the Playground

When to use it

On an app’s pricing page or settings, in an account, in a gentle paywall: the button to move to the paid plan, where holding avoids the accidental click. Without the plan below it suits any important confirmation, like publishing or sending.

On phones

The same animation: the finger holds just like the mouse (pointer capture holds even if the finger slides), and if button and plan do not fit the screen minus 24 pixels the script scales them down just enough, recalculating on resize.

With reduced motion

Nothing moves: the foil does not slide in but fades in while you hold, the pill does not swell, the label changes without rolling and the plan fades in already open.

Pitfalls

  • A single face with the colour changing under the foil is not enough: the text must be light on the graphite and dark on the silver at the same moment, hence two faces clipped by the same variable.
  • With data-autoclic the preview would have clicked the button and stopped the pilot: the round is done by the drawn pilot, which stops only at a real gesture (isTrusted).

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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