Skip to content
animorio
IT
Back to the library

Full-page article card

Transitions, ImagesGSAP, CSS onlyAdvancedCompressed weight: Demo 10 KBGSAP 28 KBFreeDownload the zip

The home of a made-up journal, Quietfield, with three story cards. Tap a card and the whole card becomes the page: the photo grows into the header, the title slides into place and grows without changing its line breaks, the other cards step back and the text rises line by line. You go back with the cross or by pulling the page down, and it returns into its card with a small settle.

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>
<!--
  "Full-page article card" 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 article card that opens into the full page</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 home of a made-up journal, Quietfield: three story cards. A card grows into the whole page, its photo
         becoming the header and its title sliding into place; pull the page down, or press the cross, and it goes
         back into its card -->
    <header class="testa" data-testa>
      <a class="marchio" href="#" aria-label="Quietfield">
        <svg class="marchio__segno" viewBox="0 0 24 24" aria-hidden="true"><path d="M3 15.5c2.2 0 2.2-1.6 4.5-1.6s2.3 1.6 4.5 1.6 2.3-1.6 4.5-1.6 2.3 1.6 4.5 1.6"/><path d="M3 19.5c2.2 0 2.2-1.6 4.5-1.6s2.3 1.6 4.5 1.6 2.3-1.6 4.5-1.6 2.3 1.6 4.5 1.6"/><path d="M12 4.2v7.3M8.6 8.4 12 4.2l3.4 4.2"/></svg>
        <span>Quietfield</span>
      </a>
      <nav class="voci" aria-label="Sections">
        <a href="#">Stories</a><a href="#">Field guides</a><a href="#">About</a>
      </nav>
      <a class="iscriviti" href="#">Subscribe</a>
    </header>

    <section class="sezione" aria-label="This week">
      <div class="sezione__testa" data-stesta>
        <h1 class="sezione__titolo">This week</h1>
        <span class="sezione__conto">3 new stories</span>
      </div>

      <div class="griglia" data-griglia>
        <article class="card" data-card tabindex="0" role="button" aria-label="Open: The quiet coast, out of season">
          <div class="card__foto" data-foto>
            <img src="costa.webp" alt="A rocky shore with snow at sunset, the sun low over a calm fjord" width="960" height="640" decoding="async" data-img>
          </div>
          <div class="card__testo">
            <span class="card__tag" data-tag>Travel</span>
            <h2 class="card__titolo" data-titolo>The quiet coast, out of season</h2>
            <span class="card__meta">6 min read</span>
          </div>
          <span class="card__freccia" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M7 17 17 7M9 7h8v8"/></svg></span>
        </article>

        <article class="card" data-card tabindex="0" role="button" aria-label="Open: Slow mornings in a small kitchen">
          <div class="card__foto" data-foto>
            <img src="cucina.webp" style="object-position: 62% 50%" alt="A small kitchen in morning light: a coffee pot on the table by the window, a kettle on the stove" width="960" height="641" decoding="async" data-img>
          </div>
          <div class="card__testo">
            <span class="card__tag" data-tag>Living</span>
            <h2 class="card__titolo" data-titolo>Slow mornings in a small kitchen</h2>
            <span class="card__meta">4 min read</span>
          </div>
          <span class="card__freccia" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M7 17 17 7M9 7h8v8"/></svg></span>
        </article>

        <article class="card" data-card tabindex="0" role="button" aria-label="Open: Walking the high ridge before dawn">
          <div class="card__foto" data-foto>
            <img src="cresta.webp" style="object-position: 70% 50%" alt="A snowy mountain ridge catching the first pink light before dawn" width="1024" height="610" decoding="async" data-img>
          </div>
          <div class="card__testo">
            <span class="card__tag" data-tag>Outdoors</span>
            <h2 class="card__titolo" data-titolo>Walking the high ridge before dawn</h2>
            <span class="card__meta">8 min read</span>
          </div>
          <span class="card__freccia" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M7 17 17 7M9 7h8v8"/></svg></span>
        </article>
      </div>
    </section>

    <!-- the open page: one element that grows from the card -->
    <div class="lettore" data-lettore hidden>
      <div class="lettore__foto" data-lfoto></div>
      <div class="lettore__scorri" data-lscorri>
        <div class="lettore__spazio" data-lspazio></div>
        <div class="lettore__colonna" data-lcol>
          <span class="lettore__tag" data-ltag></span>
          <h2 class="lettore__titolo" data-ltitolo></h2>
          <div class="lettore__meta" data-lmeta>
            <span class="autore__viso" data-lviso></span>
            <span class="autore__nome"><b data-lautore></b><span data-ldata></span></span>
          </div>
          <div class="lettore__corpo" data-lcorpo></div>
        </div>
      </div>
      <span class="lettore__presa" data-lpresa aria-hidden="true"><span></span></span>
      <button class="lettore__chiudi" data-lchiudi type="button" aria-label="Close the story">
        <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6.5 6.5l11 11M17.5 6.5l-11 11"/></svg>
      </button>
    </div>

    <svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true"><path d="M5 2.8v16.4l4.2-4 2.8 6.2 2.9-1.3-2.8-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 “Full-page article card” 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 a warm white background there is the home of Quietfield, a made-up journal: at the top the mark with green waves, the links Stories, Field guides and About and the Subscribe pill; below the heading This week and three white cards, each with its real photo (the snowy rocks of a coast at sunset, a small kitchen with a glass coffee pot on the table by the window, a snowy ridge catching the first pink light before dawn), the green label, the title and the reading time. With the pointer over it a card lifts with a softer shadow, the photo moves a touch closer and an arrow appears in the corner. Tapped, the card squeezes slightly and then the whole card grows to fill the page: the round corners straighten, the photo widens into the header and meanwhile eases back a touch, from as close as it was under the pointer to its own size, the title slides into place and grows without changing its line breaks, and at the end drops one pixel and settles. Meanwhile the other cards and the header step back and fade, the author with their initials comes up from below, the article text rises line by line out of its masks, with a quote in green, and at the top right the cross spins in. When you scroll, the photo moves up more slowly than the text. To close you press the cross, which turns a quarter under the pointer, or pull the page down: it follows the hand, shrinks and rounds its corners; let go before ninety pixels and it springs back up, past that it goes back into its card. The text fades, the page narrows down to the card, the photo gets small again, the title returns to its place, the other cards rise again and the card takes its place back with a small elastic settle. A drawn pointer opens a story, reads a little, goes back to the top and closes it by pulling it down, then opens another and closes it with the cross.

How it works

A page that starts from the card

The open page is a single element, absolutely positioned above the grid. On opening the card is measured with getBoundingClientRect and the page starts with its same position, width, height and radius; GSAP takes left, top, width and height to the whole stage with expo.out. At the end the sizes are removed and a class pins it with inset: 0, so it follows every resize by itself.

The title that grows without changing its line breaks

The page title gets the width of the card title divided by the ratio between the two type sizes: the lines break in the same places, and going from one to the other becomes a scale with transform-origin at the top left plus a move. The move is the difference between where the title sits in the card and where it sits in the page, measured once with the page already full size.

The photo that becomes the header

The photo is an image with object-fit cover copied from the card: its box goes from the card’s size to the full width and almost half the height, and the image inside goes from scale 1.05, like the card under the pointer, to 1, slower than the box, so it seems to pull back as it widens. On top, a thin dark layer grows through a CSS variable so the cross stays readable.

The text line by line

With the page already at its final size each paragraph is split into its real lines: every word in a span, grouped by offsetTop, every line in a mask with overflow hidden. The lines rise from yPercent 105 to 0 one after another; once they are in, the text goes back to normal, so a resize rewraps it by itself.

Pull down to close

With the scroll at the top, the pointer (with a mouse anywhere, with a finger on the grip at the top) moves the page by half the pull and shrinks it by up to 16 percent with transform-origin at the top, rounding its corners. Let go before the threshold and it springs back with elastic.out; past it, the closing starts from there and takes y and scale back to zero and one along with the card’s shape.

Values to change

NameFileDefaultWhat it changes
OPEN_TIMEscript.js0.78The seconds in which the card becomes the page.
CLOSE_TIMEscript.js0.66The seconds in which the page goes back into the card.
RECEDEscript.js0.94How much the other cards shrink while one opens.
LINE_STAGGERscript.js0.045The seconds between one line of text and the next.
PULL_CLOSEscript.js90The pixels to pull down for the page to close.
HEADERscript.js0.46The height of the header photo, as a share of the page height.
READscript.js1.6The seconds the drawn pointer stays reading.

Try them in the Playground

When to use it

For the home of a blog, a magazine or a site’s news section: whoever taps a story sees the card turn into the article and always knows where it came from, and goes back with the same gesture as phone apps.

On phones

The same animation with adapted sizes: under 620 pixels the cards become rows with a square photo on the left, and the square photo widens into the header; the page closes by pulling down the grip at the top or with the cross.

With reduced motion

No growing and no movement: the page fades in already open, with all its text, and closes with a fade; the other cards fade and come back without moving.

Pitfalls

  • The title’s scale works only if it breaks in the same places: that is why the page title’s width is computed from the card’s, and the type size goes down if that width would not fit in the column.
  • The text column is white so it covers the photo when you scroll, but while the page grows it would cover the bottom of the photo: while the page moves, the column turns transparent.
  • The lines are split with the page at its final size and then stitched back together: left split, a resize would have kept them with the words of the old width.
  • The photo box changes proportions while it grows (from almost square to long and low): with object-fit cover the image stays full without stretching, and in the two photos with the subject to one side object-position keeps it in view even in the phone’s square thumbnail.

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 7 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 animations