Skip to content
animorio
IT
All components

Article paywall

Dialogs, Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 8.7 KBGSAP 28 KBFreeDownload the zip

The paywall of an essay in Northwind, a made-up magazine, on white: the start of the article fading out and the plans card rising on a spring, the price rolling between Monthly and Yearly with the ‘2 months free’ tag lighting up, three perks with checkmarks drawing themselves and the Start reading button. Pressed, the ring spins, the check arrives, the card drops away, the fade lifts and the rest of the story comes in from a blur, while the padlock at the top opens.

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>
<!--
  "Article paywall" 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>Article paywall</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/newsreader@5.3.0/opsz.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- the paywall of an essay in a made-up magazine, Northwind: the excerpt fades out, the plans card rises on a
         spring, the price rolls between monthly and yearly, and Start reading opens the rest of the story -->
    <article class="art" data-art aria-label="The slow economics of small harbours">
      <header class="art__head">
        <div class="art__row">
          <span class="art__kicker">Essays</span>
          <span class="status" data-status>
            <svg class="status__lock" viewBox="0 0 12 14" aria-hidden="true">
              <path class="status__shackle" data-shackle d="M3.4 6.2V4.3a2.6 2.6 0 0 1 5.2 0v1.9"/>
              <rect class="status__body" x="1.6" y="6.2" width="8.8" height="6.4" rx="1.6"/>
            </svg>
            <span class="roll" data-roll="status"><span class="roll__line">Members</span></span>
          </span>
        </div>
        <h1 class="art__title">The slow economics of small harbours</h1>
        <p class="art__by"><span class="art__avatar" aria-hidden="true">IV</span>By Ines Varga<span class="art__date">21 Nov, 9 min read</span></p>
      </header>

      <div class="art__body" data-body>
        <p class="art__p">Porthallow’s ferry still leaves at seven, whether or not anyone is waiting. The harbour master keeps the ledger in pencil, and the café opens only when the boats come in.</p>
        <p class="art__p art__more" data-more>For twenty years the village has run on one rule: nothing is bought that cannot be mended on the quay. Nets, engines, even the chapel bell have been patched by the same three families, and the accounts show it.</p>
        <p class="art__p art__more" data-more>What looks like stubbornness from the road is, on paper, one of the most resilient small economies on the coast. The numbers start with the fish, but they do not end there.</p>
        <p class="art__p art__more" data-more>Ines Varga spent a winter on the quay with the ledger, a tide table and the people who keep both. This is what she found, month by month.</p>
      </div>

      <button class="relock" type="button" data-relock tabindex="-1">
        <svg viewBox="0 0 12 14" aria-hidden="true"><path d="M3.4 6.2V4.3a2.6 2.6 0 0 1 5.2 0v1.9"/><rect x="1.6" y="6.2" width="8.8" height="6.4" rx="1.6"/></svg>
        Lock again
      </button>

      <section class="wall" data-wall role="dialog" aria-label="Subscribe to keep reading">
        <span class="wall__shine" aria-hidden="true"></span>
        <div class="wall__top">
          <h2 class="wall__title">Keep reading with <em>Northwind</em></h2>
          <div class="plans" role="group" aria-label="Billing" data-plans>
            <span class="plans__thumb" data-thumb aria-hidden="true"></span>
            <button class="plans__opt is-on" type="button" aria-pressed="true" data-plan="month">Monthly</button>
            <button class="plans__opt" type="button" aria-pressed="false" data-plan="year">Yearly</button>
          </div>
        </div>

        <div class="price">
          <p class="price__main">
            <span class="roll roll--big" data-roll="amount"><span class="roll__line">$8</span></span>
            <span class="roll roll--per" data-roll="per"><span class="roll__line">/ month</span></span>
            <span class="tag" data-tag><span class="tag__shine" data-tag-shine aria-hidden="true"></span>2 months free</span>
          </p>
          <p class="price__sub"><span class="roll" data-roll="sub"><span class="roll__line">Billed monthly, cancel anytime</span></span></p>
        </div>

        <ul class="perks">
          <li class="perk" data-perk><svg viewBox="0 0 16 16" aria-hidden="true"><path pathLength="1" d="M3.5 8.4l2.9 2.9 6.1-6.4"/></svg>Every essay, no limits</li>
          <li class="perk" data-perk><svg viewBox="0 0 16 16" aria-hidden="true"><path pathLength="1" d="M3.5 8.4l2.9 2.9 6.1-6.4"/></svg>The audio edition, read by the authors</li>
          <li class="perk" data-perk><svg viewBox="0 0 16 16" aria-hidden="true"><path pathLength="1" d="M3.5 8.4l2.9 2.9 6.1-6.4"/></svg>The Sunday letter from the editors</li>
        </ul>

        <button class="cta" type="button" data-cta data-autoclic>
          <span class="cta__face" data-face>
            <span class="cta__icon" aria-hidden="true">
              <svg class="cta__arrow" data-arrow viewBox="0 0 16 16"><path d="M3 8h9M8.5 4.3L12.2 8l-3.7 3.7"/></svg>
              <svg class="cta__spin" data-spin viewBox="0 0 16 16"><circle cx="8" cy="8" r="5.6" pathLength="1"/></svg>
              <svg class="cta__check" viewBox="0 0 16 16"><path data-check pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"/></svg>
            </span>
            <span class="roll" data-roll="cta"><span class="roll__line">Start reading for $8</span></span>
          </span>
        </button>
      </section>
    </article>
    <p class="sr" aria-live="polite" data-live></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>

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.

39 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 “Article paywall” 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 white, the start of an essay from Northwind magazine: the ‘Essays’ label in crimson and, on the right, the grey ‘Members’ pill with a closed padlock; the serif headline, ‘The slow economics of small harbours’, the author with her initials in a circle, the date and the reading time; then the first lines with a drop cap, which fade into the white after three lines. From below the plans card rises on a spring, with a soft layered shadow and a thin crimson line of light running once along its top edge: ‘Keep reading with Northwind’, next to it the Monthly / Yearly pill with its white thumb, the big price ‘$8 / month’, the unlit ‘2 months free’ tag, the line ‘Billed monthly, cancel anytime’, three perks with checkmarks drawing one after the other and the dark ‘Start reading for $8’ button with its arrow. Choosing Yearly the thumb slides with a small squash, the price rolls to ‘$80 / year’, the line below to ‘$6.67 a month, billed yearly’, the tag lights up with a glint running across it and the button rolls to ‘$80’ too. Pressed, the button gives under the finger and comes back on a spring, its label rolls to ‘Unlocking the story’ and the arrow makes way for a ring spinning on itself; then the check arrives, the button fills with crimson and says ‘Welcome in, enjoy the story’. The card drops away, the fade lifts slowly, the two hidden paragraphs come in from a blur one after the other and at the top the padlock opens, the pill turns crimson and says ‘Unlocked’. At the bottom ‘Lock again’ appears, which puts everything back.

How it works

The fade is a mask

The article body is a window of fixed height with a mask-image: black down to --keep, transparent 4.2 em further down. Locked, --keep is 2.6 em; unlocking, GSAP takes the CSS variable to 40 em in a second and a half and the fade slides down until it is gone, without touching the text.

The card rises on a spring

The plans card sits at the bottom of the article, over the fade. It comes in from y 62% with back.out(1.5), then a one-pixel line of light runs along its top edge and the perks’ checkmarks draw themselves with stroke-dashoffset, 0.09 seconds apart (autoRound off, so they really draw).

The rolling windows

Price, period, the line below, the button label and the status sit in windows with hidden overflow: the new line comes up from below on a spring, the old one leaves at the top, and the window’s width goes from the old size to the new one, so nothing jumps sideways. Going from yearly to monthly they roll the other way.

The pill’s thumb

The white thumb of Monthly / Yearly takes its position and width from the chosen button (offsetLeft, offsetWidth) and travels there with back.out, squashing a little in height as it runs. On resize it snaps back into place without animating.

Unlocking

The button gives to 0.97 and comes back with elastic.out; the arrow leaves, the ring (the whole svg, with transformOrigin at its centre) spins until the answer comes, then the check draws itself and a crimson wash fills the button. The card drops away, the mask lifts and the hidden paragraphs come in from blur(6px), 0.16 seconds apart. The padlock at the top swings its shackle open around its right leg with svgOrigin.

Values to change

NameFileDefaultWhat it changes
MONTHLYscript.js8The monthly price, in dollars.
YEARLYscript.js80The yearly price, in dollars (twelve months minus the free ones).
FREE_MONTHSscript.js2 months freeThe tag next to the yearly price.
RISEscript.js1.5How far the plans card overshoots when it rises (0 = no bounce).
UNLOCK_TIMEscript.js1.1The seconds the ring spins before the story opens.
FADEscript.js4.2How long the fade over the excerpt is, in em.
LOOP_PAUSEscript.js3.4The seconds the open story stays before the loop locks it again.
--accentostyle.css#b3243bThe one accent colour: the tag, the checks, the unlocked button and the open padlock.

Try them in the Playground

When to use it

At the end of the excerpt of a members-only article: a magazine, a blog with a paid newsletter, an online newspaper, a course or an archive where the first lines are free and the rest unlocks.

On phones

Everything is in em and the size depends on both the width and the height of the window, so the article with its card fits whole in the phone box. Below 380 pixels the ‘2 months free’ tag and the date hide. A tap does what a click does.

With reduced motion

No movement or springs: the card fades in and out, lines crossfade without rolling, the ring does not spin, the fade goes in an instant and the paragraphs fade in.

Pitfalls

  • The fade is a mask-image with a CSS variable: GSAP animates it only if the variable already has a value in the same unit (2.6em → 40em), otherwise it jumps.
  • The spinning ring is the whole svg, an HTML element: transformOrigin 50% 50%. With svgOrigin the pivot would move and the ring would swing in a circle instead of turning on itself.
  • An inline-grid window with two lines inside takes the width of the longer one and then snaps when the old one goes: the width is animated by hand from the old size to the new line’s.
  • GSAP rounds the values it reads from CSS to whole pixels: with pathLength 1 the checks would appear all at once. autoRound is turned off at the top of the script.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Newsreader (font variabile) 5.3.0.

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

Testing

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