Skip to content
animorio
IT
All components

Envelope subscribe button

Buttons, Hover, Transitions, SVGGSAP, CSS onlyMediumCompressed weight: Demo 10 KBGSAP 28 KBFreeDownload the zip

The Subscribe button of an invented newsletter, Low Tide Notes, in graphite on black with an edge that catches the light and a cream paper envelope drawn in its tip. Pressed, the pill opens on a spring into the email field and the envelope sits ajar, waiting. On send the address folds into the letter, the letter rises and drops into the envelope, the flap shuts, the apricot stamp lands with a tap, then the envelope crouches and leaves on a diagonal with a thin trail, while the pill closes on “You’re in” with a check drawing itself and the reader count rolling up by one.

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>
<!--
  "Envelope subscribe 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 newsletter Subscribe button with the envelope that seals and flies off</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">
    <!-- one gesture: subscribe. The Subscribe pill of an invented newsletter opens on a spring into the email field;
         on send the address folds into a letter, drops into the drawn envelope, the flap shuts, a stamp lands and the
         envelope leaves on a diagonal with a thin trail, while the pill closes on «You're in» -->
    <section class="pezzo" data-pezzo aria-label="Subscribe to Low Tide Notes">
      <div class="aria" aria-hidden="true">
        <svg class="scia" data-scia-svg>
          <defs>
            <linearGradient id="scia-tinta" gradientUnits="userSpaceOnUse" data-scia-grad>
              <stop offset="0" stop-color="var(--accento)" stop-opacity="0"></stop>
              <stop offset="1" stop-color="var(--accento)" stop-opacity="0.85"></stop>
            </linearGradient>
          </defs>
          <path class="scia__via" data-via d="M0 0"></path>
          <path class="scia__riga" data-scia d="M0 0" stroke="url(#scia-tinta)"></path>
          <path class="scia__riga scia__riga--fine" data-scia2 d="M0 0"></path>
        </svg>
      </div>

      <div class="pill" data-pill>
        <span class="pill__glow" data-glow aria-hidden="true"></span>
        <span class="pill__shine" data-shine aria-hidden="true"></span>

        <button class="pill__layer pill__rest" type="button" data-rest aria-expanded="false" data-autoclic>
          <span class="pill__label" data-label>Subscribe</span>
        </button>

        <form class="pill__layer pill__form" data-form novalidate>
          <label class="sr" for="email">Email address</label>
          <span class="pill__field" data-field>
            <input id="email" data-input type="email" inputmode="email" autocomplete="email" spellcheck="false"
                   placeholder="Your email address" aria-describedby="nota">
          </span>
          <button class="pill__send" type="submit" data-send aria-label="Send">
            <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9.2M8.6 4.4 12.2 8l-3.6 3.6"></path></svg>
          </button>
        </form>

        <button class="pill__layer pill__done" type="button" data-done tabindex="-1">
          <svg class="pill__tick" viewBox="0 0 16 16" aria-hidden="true"><path data-tick d="M3.4 8.5 6.5 11.4 12.6 4.8" pathLength="1"></path></svg>
          <span class="pill__done-text" data-done-text>You’re in</span>
        </button>
      </div>

      <svg class="busta" data-busta viewBox="-2 -16 44 46" aria-hidden="true">
        <defs>
          <linearGradient id="carta" x1="0" y1="0" x2="0" y2="1">
            <stop offset="0" stop-color="var(--carta-alta)"></stop>
            <stop offset="1" stop-color="var(--carta-bassa)"></stop>
          </linearGradient>
          <linearGradient id="lembo" x1="0" y1="0" x2="0" y2="1">
            <stop offset="0" stop-color="var(--carta-alta)"></stop>
            <stop offset="1" stop-color="var(--carta-lembo)"></stop>
          </linearGradient>
        </defs>
        <g data-corpo>
          <rect class="busta__dentro" x="1" y="1" width="38" height="26" rx="3"></rect>
          <path class="busta__lembo-dietro" data-lembo-dietro d="M1.6 1.4 H38.4 L20 16 Z"></path>
          <g class="busta__lettera" data-lettera>
            <rect x="5" y="4" width="30" height="21" rx="1.6"></rect>
            <path d="M9 9.5h14M9 13h20M9 16.5h17"></path>
          </g>
          <path class="busta__tasca" d="M1 5.4 L20 17.2 L39 5.4 V24 a3 3 0 0 1 -3 3 H4 a3 3 0 0 1 -3 -3 Z" fill="url(#carta)"></path>
          <path class="busta__piega" d="M1.8 26 L16.4 15.2 M38.2 26 L23.6 15.2"></path>
          <path class="busta__lembo" data-lembo d="M1.6 1.4 H38.4 L20 16 Z" fill="url(#lembo)"></path>
          <g class="busta__bollo" data-bollo>
            <rect x="29.2" y="18.4" width="6.6" height="5.8" rx="0.8"></rect>
            <path d="M30.6 22.6 32 20.6l1.2 1.3 1.1-0.9"></path>
          </g>
        </g>
      </svg>

      <p class="nota" id="nota" data-nota aria-live="polite">
        <span class="nota__riga" data-riga-ok>Low Tide Notes · Join <span class="num" data-num>4,210</span> readers</span>
        <span class="nota__riga nota__riga--err" data-riga-err></span>
        <span class="nota__riga nota__riga--yay" data-riga-yay>First letter on Friday · reader <span class="num" data-num2>4,211</span></span>
      </p>
    </section>
    <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>

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.

30 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 “Envelope subscribe 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

On black sits a 60 pixel graphite pill, with a one pixel edge catching the light at the top, a fine grain and a faint apricot glow below. In its left tip there is a cream paper envelope with its folds, next to it the word Subscribe; below, in grey, Low Tide Notes · Join 4,210 readers. A drawn pointer moves over it: a light sweeps across the pill, the envelope’s flap lifts a little and the letter peeks out. On click the pill widens on a spring into the email field with the apricot send key on the right, and the envelope stays ajar, waiting. The pointer types ines@fernquay and sends: the ending is missing, the pill shakes, the envelope wobbles, the edge turns red and the line below says Add the ending, like .net. With .mail added the red leaves; sent again, the address shrinks and blurs into the envelope, which grows and opens fully: the letter rises with three written lines, drops back into the pocket, the flap shuts, the envelope gives a small bump and the apricot stamp lands in the corner with a tap. Then the envelope crouches and leaves on a curve, diagonally up to the right, speeding up, tilted, smaller and smaller, with a thin trail following it, and fades away. Meanwhile the pill closes on You’re in with a check drawing itself, the glow below lights up and the line says First letter on Friday · reader 4,211, with the last figure rolling. After a few seconds Subscribe comes back and a new envelope swells into its place.

How it works

Three layers in one pill

The pill holds three stacked layers, the Subscribe button, the form with the input type=email and the send key, and the confirmation button: one shows at a time, with pointer-events and tabIndex only on the live one, and GSAP takes the pill’s width to the measured width of the new state with back.out, so every change is a spring.

The envelope follows the tip

The envelope is an SVG outside the pill (so it can fly away) and sits 31 pixels from its left edge: on every width update a function reads the current width and puts the envelope back in place, plus the lift, scale and tilt offsets kept in a single object.

The flap in front and behind

The flap is a triangle whose tip moves from 16 (shut) to -13 (open). The same path is drawn twice, behind the letter and in front of the pocket: while the tip is above the envelope’s edge the back one shows, so the letter drops in front of the open flap and the shut flap covers it.

The flight on a curve

At take-off a quadratic curve is written from the envelope up to the right, measured on the piece’s real width; the envelope travels it with getPointAtLength and power2.in, takes its tilt from the tangent, and the trail is the same path with a 46 pixel dash whose stroke-dashoffset always ends under the envelope.

The reader count

Each figure is a column from 0 to 9 in a one-line window: once subscribed only the columns that change move, 60 ms apart, with a small overshoot.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#ff9b6aThe colour of the stamp, the send key, the check and the trail.
READERSscript.js4210How many readers the newsletter already has: subscribing adds one.
SPRINGscript.js0.75How long the spring that opens and closes the pill lasts, in seconds.
FLIGHTscript.js1.05How long the envelope’s flight lasts, in seconds.
TILTscript.js16The most degrees the envelope tilts by in flight.
HOLDscript.js2.6How many seconds “You’re in” stays before going back to Subscribe.
TYPINGscript.js0.06Seconds per letter when the pilot types the address.
LABELscript.jsSubscribeThe button’s label.
DONE_LABELscript.jsYou’re inThe label once subscribed.
LOOPscript.jstrueThe pilot plays the story again until someone touches it.

Try them in the Playground

When to use it

At the end of an article, in the footer of a blog, a magazine or a shop, on the landing page of a product collecting newsletter or waiting list sign-ups: wherever an always open email field would be too much and a button that opens when needed is enough.

On phones

The same 60 pixel pill, opened as wide as the box; the envelope flies on a curve measured on the real width, so it stays on screen. A finger taps like the mouse and the keyboard opens with the at sign ready (inputmode=email).

With reduced motion

No springs, shakes or flight: the pill changes width at once and the layers cross-fade, on error only the edge and the line below change, and on send the envelope shuts in place and fades out slowly while the confirmation arrives.

Pitfalls

  • The envelope cannot live inside the pill: the pill clips whatever leaves its round edge and the flight would vanish at once. It sits outside, in the piece, and follows the pill’s width on every frame of the spring.
  • With a single flap path the rising letter went behind the open flap but also behind the shut one, or in front of both: it takes two copies of the same path, one behind and one in front, switched by where the tip is.
  • GSAP writes its transform inline: the shake sits on the pill, the send key’s press on the key, scale and flight on the envelope, the drop on the letter, so none wipes out another.
  • The placeholder and the examples use no real domains: “you@email.com” would be somebody’s address, so the field says Your email address and the pilot types an invented domain.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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