Skip to content
animorio
IT
Back to the library

Audience headline

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

The opening of a made-up piece of software, Tessly, on warm white: above the headline a pill switch asks who you are, Designers, Engineers, Founders or Everyone. Pick one and the word leaves its pill and flies into the headline, growing to full size, while the old one drops letter by letter and the line makes room on a spring; the subtitle rewrites itself word by word, the button changes its verb and the number below counts to its value.

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>
<!--
  "Audience headline" 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 headline that changes for the reader</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 hero of a made-up workspace, Tessly: pick who you are in the switch above and the chosen word flies out of
         its chip into the headline, while the subtitle, the button and the number below rewrite themselves for you -->
    <section class="hero" data-hero aria-label="Tessly">
      <div class="seg" role="tablist" aria-label="I am one of" data-seg>
        <span class="seg__pill" data-segpill aria-hidden="true"></span>
        <button class="chip" role="tab" data-chip type="button">
          <svg class="chip__icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 1.8 12.6 6.4 8 14.2 3.4 6.4Z"/><path d="M8 14.2V8.6"/><circle cx="8" cy="7.4" r="1.2"/></svg>
          <span class="chip__label">Designers</span>
        </button>
        <button class="chip" role="tab" data-chip type="button">
          <svg class="chip__icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M5.4 4.2 1.8 8l3.6 3.8"/><path d="M10.6 4.2 14.2 8l-3.6 3.8"/><path d="M9.2 2.8 6.8 13.2"/></svg>
          <span class="chip__label">Engineers</span>
        </button>
        <button class="chip" role="tab" data-chip type="button">
          <svg class="chip__icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6.2"/><path d="M10.6 5.4 9 9 5.4 10.6 7 7Z"/></svg>
          <span class="chip__label">Founders</span>
        </button>
        <button class="chip" role="tab" data-chip type="button">
          <svg class="chip__icon" viewBox="0 0 16 16" aria-hidden="true"><circle cx="5.8" cy="5.6" r="2.2"/><circle cx="11.2" cy="6.4" r="1.8"/><path d="M1.8 13.2c.5-2.4 2-3.6 4-3.6s3.5 1.2 4 3.6"/><path d="M10.4 9.8c1.9-.3 3.3.8 3.8 3"/></svg>
          <span class="chip__label">Everyone</span>
        </button>
      </div>

      <h1 class="title" data-title>
        <span class="title__mask"><span class="title__line" data-line>The workspace</span></span>
        <span class="title__mask"><span class="title__line" data-line>for <span class="slot" data-slot aria-live="polite"></span></span></span>
      </h1>
      <span class="title misura" data-measure aria-hidden="true"></span>

      <p class="sub" data-sub></p>

      <div class="actions" data-actions>
        <a class="btn btn--primary" href="#" data-cta>
          <span class="btn__roll" data-roll><span class="btn__label" data-label></span></span>
          <svg class="btn__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9.5"/><path d="M8.6 4 12.6 8l-4 4"/></svg>
        </a>
        <a class="btn btn--ghost" href="#" data-ghost><span class="btn__label">Book a demo</span></a>
      </div>

      <p class="proof" data-proof><span class="proof__num" data-count>0</span> <span class="proof__who" data-who></span> <span class="proof__rest">plan their work in <span data-brand>Tessly</span></span></p>

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

22 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 “Audience headline” 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, in the middle, sits the opening of Tessly, a made-up work tool. At the top a light grey switch with four pills, each with its own small drawn icon: Designers (a pen nib), Engineers (code brackets), Founders (a compass) and Everyone (two people); the chosen one sits on a white pill with a soft shadow. Below, large, the headline on two lines, The workspace / for designers, with the last word in blue; then the grey subtitle, a black Start designing button with an arrow, a light Book a demo and a small line: 4,200 design teams plan their work in Tessly. When you pick another pill, the white pill slides over with a small bounce and its icon nods; the word leaves the label, small and grey, and flies into the headline growing large and blue, while the old one drops letter by letter with a slight turn and the line narrows or widens on a spring. At the same time the subtitle fades upwards and the new one rises word by word, the button rolls its verb (Start building, Start shipping, Start for free) and stretches as needed, and the number counts to its value. A drawn pointer tries every pill one after the other, then moves to the button and presses it; it stops as soon as you touch the page. It works with mouse, touch and the keyboard arrows.

How it works

A switch with a sliding pill

The four choices are buttons with the tab role inside a grey container; a single white pill, absolutely positioned, takes the position and width of the active choice (offsetLeft and offsetWidth) through GSAP with a back.out, so it bounces by a breath when it arrives. The keyboard arrows move to the next choice.

Where the word will land

Before the flight the word’s slot in the headline takes its new width for an instant, measured on a hidden twin of the headline; the landing rectangle is read and the old width put back, all before the next frame. Then the width moves to the new one on a spring and the centred line slides with it.

The flight from the pill to the headline

A twin of the word, already at headline size, starts scaled down over the pill label and in its grey. In one timeline x, y and scale travel to the landing point on different curves, so the flight draws a slight arc, and the colour turns blue; on arrival the twin gives way to the real word, split into letters that settle by a pixel.

Everything else rewrites

The old letters drop half a line, turning six degrees each way in turn. The subtitle is split into words: the old ones rise and blur away, the new ones come up from below one after the other. The button verb rolls inside a window that stretches to the new size, and the number counts with a tween on an object, written with toLocaleString.

The pointer that uses it

A drawn pointer goes to each pill, presses it (it shrinks and so does the pill), waits and moves on to the next; then it tries the button and starts again. It is a chain of tweens and delayedCalls that reads the real position every time, so it holds even if the window changes size; the first real touch switches it off.

Values to change

NameFileDefaultWhat it changes
BRANDscript.js'Tessly'The name of the made-up software, written under the buttons.
FLIGHTscript.js0.62The seconds the word takes to fly from its pill to the headline.
SPRINGscript.js1.5How much the white pill and the word’s slot bounce (0 = not at all).
LETTER_STAGGERscript.js0.022The seconds between one letter and the next as the old word drops.
STAYscript.js2.6The seconds the drawn pointer stays on each choice.

Try them in the Playground

When to use it

For the opening of the landing page of a piece of software, an app or a service that speaks to different people: visitors say who they are and the page answers them, with the right headline, subtitle, button and number, without four different pages.

On phones

The same animation with adapted sizes: the headline is measured on the width and height of the screen, the pill icons disappear below 380 pixels so the four choices fit on one line, and the flight starts from the pill you touch.

With reduced motion

No flight, no falling letters and no springs: the new word fades in in its place, the white pill jumps straight to the choice, the subtitle and the verb cross-fade and the number is right at once.

Pitfalls

  • The landing point must be read with the word’s slot already at its new width: the line is centred, and read before the change the word would land off to one side.
  • The flying twin has the headline’s size and starts scaled down with scale: if it grew through font-size, the browser would redo the layout on every frame and the text would shake.
  • The drawn pointer is not a repeating timeline: with positions computed only once, after a resize it would press empty space.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 25 October 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