Skip to content
animorio
IT
Back to the library

Selection box headline

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

The portfolio opening of Atla, a made-up design studio in Oslo, in the premium style of Dribbble shots: the top bar with the wordmark, the links, the studio clock ticking and Available for work, then the big variable title ‘Atla designs brands people keep.’. The craft word sits inside a selection box like in a design tool, with four handles and the axis label: when the craft changes the old letters thin out and slip up out of the box, the box widens or narrows on a spring, the new letters rise wide and heavy and settle, the label counts the weight and the width, and the project card beside it changes its work, client and count along with the word.

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>
<!--
  "Selection box 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>Atla, an independent design studio in Oslo</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 opening of the portfolio of a made-up two-person design studio, Atla, in Oslo: the top bar with the
         wordmark, the links, the studio clock and Available for work, then the big variable title "Atla designs brands
         people keep." The craft word sits inside a selection box with four handles, like in a design tool: when the
         craft changes the old letters squeeze thin and slip up out of the box, the box springs to the new width, the
         new letters rise wide and heavy and settle, the axis label counts the weight, and the project card beside the
         title changes with the word -->
    <section class="site" data-site aria-label="Atla, design studio">
      <span class="site__grain" aria-hidden="true"></span>
      <span class="site__glow" data-glow aria-hidden="true"></span>

      <header class="bar">
        <a class="brand" href="#" aria-label="Atla home">
          <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 19.5 12 4.5l8 15"></path><path d="M7.4 13.6h9.2"></path></svg>
          <span class="brand__name">Atla</span>
        </a>
        <nav class="links" aria-label="Main"><a href="#">Work</a><a href="#">Studio</a><a href="#">Journal</a></nav>
        <p class="clock" aria-label="Studio time in Oslo">
          <span class="clock__city">Oslo</span>
          <span class="clock__t" data-clock></span>
        </p>
        <a class="avail" href="#" data-avail>
          <span class="avail__face">
            <svg viewBox="0 0 16 16" aria-hidden="true"><rect x="2.4" y="3.2" width="11.2" height="10.4" rx="2.6"></rect><path d="M2.4 6.6h11.2M5.4 1.8v2.6M10.6 1.8v2.6M6 10.1l1.4 1.3L10.2 8.6"></path></svg>
            <span>Available for work</span>
          </span>
        </a>
      </header>

      <div class="hero">
        <div class="hero__text">
          <p class="eyebrow"><span>Independent studio</span><span class="eyebrow__sep" aria-hidden="true"></span><span>Since 2019</span></p>
          <h1 class="title" data-title aria-live="polite" aria-label="Atla designs brands people keep.">
            <span class="title__line title__line--lead" aria-hidden="true">Atla designs</span>
            <span class="title__line title__line--word" aria-hidden="true">
              <span class="sel" data-sel>
                <span class="sel__box" data-box>
                  <span class="sel__frame"></span>
                  <span class="h h--tl"></span><span class="h h--tr"></span><span class="h h--bl"></span><span class="h h--br"></span>
                </span>
                <span class="sel__mask" data-mask></span>
                <span class="sel__tag" data-tag><span class="sel__axis">wght</span><span class="sel__num" data-wght>780</span><span class="sel__axis">wdth</span><span class="sel__num" data-wdth>100</span></span>
              </span>
            </span>
            <span class="title__line title__line--tail" aria-hidden="true">people keep<span class="title__stop">.</span></span>
          </h1>
        </div>

        <a class="proj" href="#" data-proj aria-live="polite">
          <span class="proj__stack proj__stack--b" aria-hidden="true"></span>
          <span class="proj__stack proj__stack--a" aria-hidden="true"></span>
          <span class="proj__card" data-card>
            <span class="proj__art" data-arts aria-hidden="true">
              <span class="art art--brand" data-art>
                <span class="art__sun"></span><span class="art__wave"></span><span class="art__wave art__wave--2"></span><span class="art__wave art__wave--3"></span>
              </span>
              <span class="art art--ui" data-art>
                <span class="art__phone"><span class="art__bal"></span><span class="art__bar"></span><span class="art__bar art__bar--s"></span><span class="art__chart"><i></i><i></i><i></i><i></i><i></i></span></span>
              </span>
              <span class="art art--type" data-art><span class="art__aa">Aa</span><span class="art__base"></span></span>
              <span class="art art--pack" data-art>
                <span class="art__tub"><span class="art__lid"></span><span class="art__label"></span></span>
              </span>
            </span>
            <span class="proj__info">
              <span class="proj__kind"><span class="proj__roll" data-kind></span></span>
              <span class="proj__client"><span class="proj__roll" data-client></span></span>
              <span class="proj__more">
                <span>Case study</span>
                <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 11.5 11.5 4.5M6.2 4.5h5.3v5.3"></path></svg>
              </span>
            </span>
          </span>
        </a>
      </div>

      <footer class="foot">
        <div class="crafts" data-crafts role="tablist" aria-label="What the studio designs"></div>
        <p class="count"><span class="count__n" data-count></span><span class="count__l" data-countl>projects</span></p>
      </footer>
    </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.

34 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 “Selection box 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 ground sits the home page window of Atla, a made-up design studio in Oslo. At the top, the bar: the wordmark, the Work, Studio and Journal links, the time in Oslo with the seconds digits rolling and the black Available for work pill with a calendar. Below, the big title in variable Mona Sans on three lines: Atla designs, the craft word, people keep with a blue full stop. The craft word is heavy and sits inside a one pixel blue selection box, with four square handles at the corners and the blue axis label beside it, wght 760 and wdth 100, like a selected text layer in a design tool. On the right the project card, with two more cards peeking out below like a stack: a drawing of the work, the kind and the year, the client and the round case study button. At the bottom the Brands, Interfaces, Type and Packaging tabs with the white pill under the chosen one and a thin blue line filling up, and on the right the number of projects. When the craft changes, the box flashes, the handles swell and come back on a spring, the old letters one after another lose weight, squeeze and slip up out of the box; the box takes the width of the new word with a small bounce and the label follows; the new letters rise from below wide and thin, gain more weight than they need and settle, the width lands a hair under 100 and comes back, and all the while the label counts the real axis values. The card dips for a moment, the new drawing opens in a circle from the corner (the sun over the sea of Nordlys Ferries, the Tidal Bank app, the Fjell Radio typeface, the Smør butter tub), the kind and the client slide up and the project count rolls. Moving over the tabs or tapping the word changes the craft; left alone, it goes round by itself.

How it works

The font axes on two variables per letter

Each letter is a span whose font-variation-settings reads two CSS variables, --w for weight and --d for width. GSAP animates the variables letter by letter with a stagger: the old ones go to weight 240 and width 75 as they rise, the new ones start at 240 and 125, pass through 880 with keyframes and land at 760 and 100 with a back.out that dips a breath under 100.

The box that measures the word before it arrives

After document.fonts.load the new word is set out of sight at its final weight and its width is read; the box, the mask with hidden overflow and so the label beside them go to that size on a spring. The handles are children of the box: they move with it and swell on their own. On resize the size is measured again.

One timeline per word, card included

The change is one timeline: letters, box, label, the card's dip, the drawing opening with a circle clip-path from the corner, the card text rolling and the counter digits. The autopilot is a tween of the line under the chosen tab: when it is full, the next craft comes in.

Values to change

NameFileDefaultWhat it changes
SWAPscript.js0.8How long the craft word takes to change, in seconds.
STAGGERscript.js0.032The gap between one letter and the next, in seconds.
WIDEscript.js125The width the new letters rise with before they settle at 100.
HEAVYscript.js880The weight the new letters reach before they settle.
SETTLEscript.js760The weight the craft word settles to.
THINscript.js240The weight the old letters thin out to as they leave.
PAUSEscript.js2.6Left alone: how many seconds it stays on each craft.
LOOPscript.jstrueLeft alone, the title goes through the crafts by itself.
--accentstyle.css#3d5afeThe blue of the box, the handles, the label and the full stop.
--bgstyle.css#ecebe7The warm white of the ground.

Try them in the Playground

When to use it

For the opening of the portfolio of a studio, a designer or an agency with more than one craft: the title says at once what the studio does, the selection box tells you this is where things get designed, and the card beside it shows a real piece of work for every craft.

On phones

The same animation with adapted measures: the window is sized on width and height together, the project card moves under the title in a row and the links go away; tap a tab or the word to change the craft.

With reduced motion

No movement: the old word fades and the new one appears at its weight, the box takes its size at once, the card drawing fades in and the digits simply change.

Pitfalls

  • A fromTo inside a timeline draws its start at once: the axis label showed 240 and 125 before the letters moved. With a to from the current value the count starts from where it is.
  • clip-path: inset() with negative values did not clip the leaving letters: the mask is a box with hidden overflow, as big as the selection box.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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