Skip to content
animorio
IT
Back to the library

Split case study

Hover, TextGSAP, CSS onlyMediumCompressed weight: Demo 9.0 KBGSAP 28 KBFreeDownload the zip

The case study card of an invented branding studio, the rebrand of a tea brand, split into two halves: Story with a real photo of tea leaves and Proof with the name and the numbers. The border between them follows the pointer on a spring, from 50/50 up to 60/40 either way; the big name grows and stretches with the wdth axis of a variable font, the chip of the bigger half fills with green, and on the border a glass knob stretches with the speed and settles.

Rebuilt from scratch studying loloagency.com by The Agency of Love & Logic, Stas Bondar: the idea is theirs; code, copy and images are ours. Read how it’s made

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>
<!--
  "Split case study" 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 split case study with the border that follows the cursor</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 case study card of Hinge & Hearth, an invented branding studio, for Morrow, an invented tea brand.
         Two halves: Story (a real photo of tea leaves) and Proof (the numbers). The border between them follows the
         pointer on a soft spring, and the big name stretches and narrows with the width axis of a variable font. -->
    <article class="case" data-case aria-label="Case study: Morrow tea rebrand">
      <div class="case__split">
        <section class="half half--story" aria-label="Story">
          <div class="story__photo" aria-hidden="true">
            <img class="story__img" src="foglie.webp" width="682" height="1024" alt="">
          </div>
          <span class="story__veil" aria-hidden="true"></span>
          <span class="chip chip--story" data-in><span class="chip__fill" aria-hidden="true"></span><span class="chip__text">Story</span></span>
          <div class="story__copy" data-in>
            <p class="story__quote">Grown on one slope. Now it looks like it.</p>
            <p class="story__meta">Identity, packaging and shelf, 2026</p>
          </div>
        </section>

        <section class="half half--proof" aria-label="Proof">
          <header class="proof__top" data-in>
            <span class="chip chip--proof"><span class="chip__fill" aria-hidden="true"></span><span class="chip__text">Proof</span></span>
            <span class="studio">
              <svg class="studio__mark" viewBox="0 0 20 20" aria-hidden="true"><path d="M4 16V8.5a6 6 0 0 1 12 0V16"/><path d="M10 16V9.6"/></svg>
              Hinge &amp; Hearth
            </span>
          </header>

          <div class="proof__name" data-in>
            <p class="proof__over">Tea rebrand</p>
            <h1 class="proof__title" data-title>Morrow</h1>
          </div>

          <dl class="stats">
            <div class="stat" data-in>
              <dt>Shelf pickup</dt>
              <dd>+38%</dd>
              <span class="stat__bar" aria-hidden="true"><i data-bar style="--v:.38"></i></span>
            </div>
            <div class="stat" data-in>
              <dt>Repeat orders</dt>
              <dd>2.1x</dd>
              <span class="stat__bar" aria-hidden="true"><i data-bar style="--v:.62"></i></span>
            </div>
            <div class="stat stat--extra" data-in>
              <dt>Weeks to launch</dt>
              <dd>14</dd>
              <span class="stat__bar" aria-hidden="true"><i data-bar style="--v:.27"></i></span>
            </div>
          </dl>

          <button class="open" type="button" data-open data-in>
            <span class="open__face" data-face>
              <span class="open__shine" data-shine aria-hidden="true"></span>
              <span class="open__row" data-row="idle">
                <span>View the case</span>
                <svg class="open__arrow" data-arrow viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9.5M8.5 4 12.5 8l-4 4"/></svg>
              </span>
              <span class="open__row" data-row="done" aria-hidden="true">
                <svg class="open__tick" viewBox="0 0 16 16"><path data-tick pathLength="1" d="M3.6 8.4 6.6 11.2 12.4 4.9"/></svg>
                <span>Case saved</span>
              </span>
            </span>
          </button>
        </section>
      </div>

      <!-- the border: a hairline that catches the light, a glass handle and the share of each half -->
      <div class="border" data-border aria-hidden="true">
        <span class="border__line"></span>
        <span class="border__knob" data-knob>
          <span class="border__glint" aria-hidden="true"></span>
          <span class="border__readout" data-readout><span class="border__pill"><b data-left>50</b><i></i><b data-right>50</b></span></span>
          <span class="border__handle" data-handle>
            <svg viewBox="0 0 24 12"><path d="M7.5 2.5 4 6l3.5 3.5M16.5 2.5 20 6l-3.5 3.5"/></svg>
          </span>
        </span>
      </div>
      <span class="case__grain" aria-hidden="true"></span>
    </article>

    <svg class="pointer" data-pointer viewBox="0 0 20 20" aria-hidden="true"><path d="M4 2.5v13.2l3.5-3.3 2.4 5.3 2.3-1-2.4-5.2 4.8-.2z"/></svg>
    <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.

30 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 “Split case study” 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 page a card with round corners and a soft shadow rises, split into two halves. On the left ‘Story’: a real photo of tea leaves with drops, a line in white (‘Grown on one slope. Now it looks like it.’) and under it ‘Identity, packaging and shelf, 2026’. On the right ‘Proof’, on light paper: the mark of the invented studio Hinge & Hearth, ‘Tea rebrand’ and the big name ‘Morrow’, then three numbers with their green bars (+38% shelf pickup, 2.1x repeat orders, 14 weeks to launch) and the dark ‘View the case’ button. On arrival the border comes in from the right and settles in the middle on a spring, the name widens as it comes and the bars fill one after the other. Then a drawn cursor does the walk: on the photo the border slides to 60/40 for the Story, the name narrows and shrinks; on the numbers the border goes back to 40/60, the name turns big and wide, the Proof chip fills with green. On the border a thread of light and a round glass knob with two arrows follow the cursor's height, stretch with the speed and come back round passing the mark by a hair; above it the share of the two halves shows for a moment, ‘60 | 40’. The cursor rests on the button, which lifts by a pixel and pushes its arrow, and presses it: the button gives and comes back on a spring, a gleam runs across it, the label turns into ‘Case saved’ with a checkmark that draws itself and the three bars run again from zero. Then everything goes back and the cursor leaves. With a real mouse the border follows the hand.

How it works

One variable

Everything hangs on --split, written on the card every frame: the grid has the columns calc(50% + split * 50%) and the rest, the knob sits at left calc(50% + split * 50%), the photo grows a little, the chips fill through a clamp.

The mouse cut and stretched

As on the original site: the pointer's x becomes (x - width / 2) / width * -1, is cut at ±0.1 and taken to ±0.2 with mapRange. So a tenth of the page away from the middle is enough for the border to go all the way.

The quickTo spring

The value is not written at once: gsap.quickTo chases it in 0.8 s with power3, and a ticker copies it into the CSS variable. A second quickTo takes the knob to the pointer's height.

The name that widens

The title has font-size base * (180 - split * 200) / 180, the site's formula, plus font-variation-settings 'wdth' 100 - split * 125: with variable Mona Sans the letters really get wider instead of just bigger.

The glass knob

The border's speed drives how much the knob stretches, integrated with a small hand made spring: it passes the mark and comes back round. The share of the two halves shows while it moves and fades soon after.

Values to change

NameFileDefaultWhat it changes
RANGEscript.js0.1How far from the middle of the page the pointer has to go for the full move (0.1 = a tenth of the width).
REACHscript.js0.2How far the border goes: 0.2 = columns at 60/40.
SPRINGscript.js0.8The seconds the border takes to reach the pointer.
GROWscript.js200How much the big name grows and shrinks with the border (200 as in the original).
STRETCHscript.js125How much the name stretches on the wdth axis (0 = never).
AUTO_PILOTscript.js2.2After how many seconds without a pointer the drawn one starts (0 never).
LOOPscript.jstrueThe drawn cursor walks again and again.

Try them in the Playground

When to use it

For a project page in the portfolio of an agency, a branding studio or a freelancer: when a project has two sides, the story and the results, and the visitor chooses which one grows just by moving the mouse.

On phones

The same animation with adapted sizes: the card is almost as wide as the screen and as low as the box, the numbers stack when the Proof half narrows, the third number hides on low screens and the border moves by dragging a finger sideways.

With reduced motion

The border stays still in the middle and the drawn cursor does not start: the card fades in already in place, and pressing the button the label and the checkmark change with a fade.

Pitfalls

  • The photo must not squash when the column changes: it is wider than the widest column, centred, and the border reveals it instead of deforming it.
  • cqi sizes inside a variable are resolved where it is used, on the nearest container: the card's width for the title is written in pixels by the script (--cw) on every resize.
  • The button's centre for the drawn cursor must come from getBoundingClientRect: offsetLeft is relative to the half, not the card, and the cursor pressed on the photo.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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