Skip to content
animorio
IT
Back to the library

Author byline card

HoverGSAP, CSS onlyMediumCompressed weight: Demo 5.8 KBGSAP 28 KBFreeDownload the zip

The head of a blog post: under the title, the byline is a small pill with the avatar, the name and the reading time. Under the pointer the pill grows and becomes the author’s card: avatar and name get bigger, the bio, the counting numbers and the Follow button come in, and pressed the button turns its plus into a tick and adds one reader. On leaving it closes back into the pill.

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>
<!--
  "Author byline 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>Article byline that opens into the author card with the bio and the Follow 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">
    <!-- the head of a blog post: under the title, the byline is a small pill; under the pointer it grows into the
         author's card, with the bio, the numbers counting and the Follow button, and closes again when you leave -->
    <article class="post">
      <p class="post__kicker">Essay</p>
      <h1 class="post__title">The slow web is quietly coming back</h1>

      <div class="author" data-author>
        <button class="author__head" type="button" data-head aria-expanded="false" aria-controls="author-more">
          <span class="avatar" data-avatar aria-hidden="true"><span>MK</span></span>
          <span class="author__id">
            <span class="author__name" data-name>Mira Kovac</span>
            <span class="author__meta roll"><span data-meta>6 min read</span></span>
          </span>
        </button>
        <div class="author__more" id="author-more" data-more>
          <p class="author__bio" data-in>Writes about small tools, personal sites and software that takes its time.</p>
          <dl class="author__stats" data-in>
            <div><dt>Essays</dt><dd data-essays>48</dd></div>
            <div><dt>Readers</dt><dd><span data-readers>12,408</span></dd></div>
          </dl>
          <button class="follow" type="button" data-follow data-in aria-pressed="false">
            <svg viewBox="0 0 16 16" aria-hidden="true"><path class="follow__plus" data-plus d="M8 3.4v9.2M3.4 8h9.2"></path><path class="follow__tick" data-tick pathLength="1" d="M3.6 8.4 6.6 11.2 12.4 4.9"></path></svg>
            <span class="roll"><span data-word>Follow</span></span>
          </button>
        </div>
      </div>
    </article>
    <p class="sr" data-live aria-live="polite"></p>

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

23 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 “Author byline 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 paper-coloured background, the head of an article: the “Essay” label, the title on two lines and below it the byline, a white pill with a round avatar with initials, the name and “6 min read”. Moving over it (or touching it) the pill widens and lengthens with a small bounce until it becomes a card: the avatar goes from 28 to 46 pixels, the name grows, next to it “6 min read” rolls to “Essayist”; then, from below and one after the other, come the bio, two boxes with counting numbers (essays and readers) and the dark “Follow” button. Pressed, the plus rotates and disappears, a tick draws itself, the button turns light with an orange edge and says “Following”, and the readers go up by one. Leaving with the pointer everything goes back into the pill, faster than it opened.

How it works

One box only

Pill and card are the same element with hidden overflow: closed it is as wide as its content and 44 pixels tall, open it is WIDTH wide and auto tall. GSAP takes width and height from one measure to the other with back.out; the two pixel widths are measured again at every resize.

Avatar and name

While the box grows, the avatar goes from 28 to 46 pixels and the name from 13.5 to 16: they are tweens of width, height and font-size, not scale, so the text next to them moves by itself and nothing overlaps.

The content and Follow

Bio, numbers and button come in with opacity and a 10-pixel rise, staggered by 0.07 seconds; the numbers count with power2.out. Follow is a button with aria-pressed: the plus rotates 90 degrees and fades, the tick draws itself with stroke-dashoffset, the word rolls.

Values to change

NameFileDefaultWhat it changes
WIDTHscript.js300How wide the open card is, in pixels (never more than the column).
OPENscript.js0.55How many seconds to open.
CLOSEscript.js0.4How many seconds to close.
READERSscript.js12408The author’s readers: following adds one.
READscript.js6 min readThe text next to the name when closed.
ROLEscript.jsEssayistThe text next to the name when open.
ACCENTscript.js#df5327The colour of the avatar and of the followed button.
LOOPscript.jstrueLeft alone, a pointer opens it, follows and leaves.

Try them in the Playground

When to use it

For a blog with several authors, a magazine, a newsletter or a community: the reader finds out who wrote the piece without leaving the page. It also suits a review’s byline, a commenter’s name, a team member in a list.

On phones

The same article head, with a smaller title and the card at most as wide as the column; there is no hover, the byline opens and closes on tap.

With reduced motion

No growing or bounces: the card is open or closed at once, the content fades in, the numbers are already at their value.

Pitfalls

  • The article head has the height of the open card: without it, the growing byline would push title and page at every pass.
  • The lower part has a fixed width (that of the open card): if it followed the box while it widens, the bio would wrap differently on every frame.
  • There is a button inside the card, so the byline cannot be a button containing it: the button is only the row with avatar and name (aria-expanded), the rest is a separate region. It also opens on keyboard focus and closes with Esc.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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