Skip to content
animorio
IT
Back to the library

Pros and cons seesaw

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

Teeter, a made-up decision app, and the question «Take the job in Lisbon?»: a thin beam on a pivot with two plates that stay level, For on the left and Against on the right. The reasons are pills with their weight in three bars: drag them onto a side, or click and they fly to their own side in an arc, and when they land the beam answers with a real spring that weighs the difference between the sides, overshoots and swings before it settles. Under the pivot «Leaning yes · 64%» rolls to its new value. Minimal style, one green accent.

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>
<!--
  "Pros and cons seesaw" 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>Pros and cons seesaw</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">
    <!-- a decision app: the reasons sit in a tray; dropped on a side, they land on a level plate and the beam answers
         with a real spring (torque from the weights, damped, with an overshoot that dies out). The readout under the
         pivot says which way the decision leans. -->
    <section class="card" data-card aria-labelledby="domanda">
      <span class="card__sheen" aria-hidden="true"></span>

      <header class="head">
        <span class="brand">
          <svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true"><path d="M2.5 12.6 17.5 8.4" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/><path d="M10 10.5 7.6 15.5h4.8Z" fill="currentColor"/></svg>
          <span>Teeter</span>
        </span>
        <span class="draft">Decision · Draft</span>
      </header>

      <h1 class="question" id="domanda">Take the job in Lisbon?</h1>
      <p class="hint">Drop each reason on a side.</p>

      <div class="scale" data-scale>
        <span class="side side--pro" aria-hidden="true">For <b class="roll"><span class="roll__row" data-sum-pro>0</span></b></span>
        <span class="side side--con" aria-hidden="true">Against <b class="roll"><span class="roll__row" data-sum-con>0</span></b></span>

        <div class="plate plate--pro" data-plate="pro">
          <ul class="plate__stack" data-stack="pro" aria-label="For"></ul>
          <span class="plate__tray" aria-hidden="true"></span>
          <span class="plate__post" aria-hidden="true"></span>
        </div>
        <div class="plate plate--con" data-plate="con">
          <ul class="plate__stack" data-stack="con" aria-label="Against"></ul>
          <span class="plate__tray" aria-hidden="true"></span>
          <span class="plate__post" aria-hidden="true"></span>
        </div>

        <div class="beam" data-beam aria-hidden="true"><span class="beam__pin"></span></div>
        <svg class="pivot" data-pivot viewBox="0 0 40 30" aria-hidden="true"><path d="M20 2 37 28H3Z"/></svg>

        <p class="readout" data-readout aria-live="polite">
          <span>Leaning</span>
          <b class="roll"><span class="roll__row" data-lean>even</span></b>
          <span class="readout__dot" aria-hidden="true">·</span>
          <b class="readout__pct"><span data-pct>50</span>%</b>
        </p>
      </div>

      <div class="tray">
        <span class="tray__label">Reasons</span>
        <ul class="tray__slots" data-slots>
          <li class="slot"><button class="pill" type="button" data-pill data-id="pay" data-side="pro" data-w="3">Higher pay<i class="w" aria-hidden="true"><s></s><s></s><s></s></i><span class="pill__x" aria-hidden="true"><svg viewBox="0 0 10 10"><path d="M2.5 2.5l5 5M7.5 2.5l-5 5"/></svg></span></button></li>
          <li class="slot"><button class="pill" type="button" data-pill data-id="family" data-side="con" data-w="3">Far from family<i class="w" aria-hidden="true"><s></s><s></s><s></s></i><span class="pill__x" aria-hidden="true"><svg viewBox="0 0 10 10"><path d="M2.5 2.5l5 5M7.5 2.5l-5 5"/></svg></span></button></li>
          <li class="slot"><button class="pill" type="button" data-pill data-id="sea" data-side="pro" data-w="2">The sea<i class="w" aria-hidden="true"><s></s><s></s><s></s></i><span class="pill__x" aria-hidden="true"><svg viewBox="0 0 10 10"><path d="M2.5 2.5l5 5M7.5 2.5l-5 5"/></svg></span></button></li>
          <li class="slot"><button class="pill" type="button" data-pill data-id="moving" data-side="con" data-w="1">Moving costs<i class="w" aria-hidden="true"><s></s><s></s><s></s></i><span class="pill__x" aria-hidden="true"><svg viewBox="0 0 10 10"><path d="M2.5 2.5l5 5M7.5 2.5l-5 5"/></svg></span></button></li>
          <li class="slot"><button class="pill" type="button" data-pill data-id="team" data-side="pro" data-w="2">New team<i class="w" aria-hidden="true"><s></s><s></s><s></s></i><span class="pill__x" aria-hidden="true"><svg viewBox="0 0 10 10"><path d="M2.5 2.5l5 5M7.5 2.5l-5 5"/></svg></span></button></li>
          <li class="slot"><button class="pill" type="button" data-pill data-id="language" data-side="con" data-w="1">New language<i class="w" aria-hidden="true"><s></s><s></s><s></s></i><span class="pill__x" aria-hidden="true"><svg viewBox="0 0 10 10"><path d="M2.5 2.5l5 5M7.5 2.5l-5 5"/></svg></span></button></li>
        </ul>
      </div>
    </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.

41 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Pros and cons seesaw” 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

A card on warm paper: at the top Teeter, the question «Take the job in Lisbon?» and below it the balance, a dark beam on a triangular pivot, with a plate at each end staying level on a small post. Below the balance six reasons as pills, each with its weight in three bars: Higher pay, The sea and New team for yes, Far from family, Moving costs and New language for no. Click one and it flies to its plate in an arc; drag it and you lay it on the side you choose. When it lands the pill squashes for a moment, its end drops with a knock and the beam looks for balance with a real spring: it overshoots, comes back, swings and settles at the tilt that weighs the difference between the two sides. The pills on the plates slide a little towards the lower end and the plates rock on their posts. Under the pivot the readout rolls («Leaning yes · 64%») and by the plates the For and Against totals. Hovering a reason already leans the beam a little towards its side; clicking a reason on a plate sends it back to its slot and the beam rises again.

How it works

Weight becomes an angle

Each reason weighs 1 to 3. The beam aims for the angle (against − for) × DEG_PER_WEIGHT, kept within MAX_TILT: it behaves like a spring balance, settling at a tilt proportional to the difference instead of falling all the way to one side.

A real spring

On every GSAP ticker frame the acceleration is −K(θ − target) − Cω, with K = (2π · STIFFNESS)² and C from DAMPING: two half steps per frame, the time capped at 1/30 of a second. With low damping the beam overshoots and swings before it settles.

The landing knock

When a pill lands, the beam’s velocity gets a knock proportional to its weight (KICK) towards its end; when it leaves, a smaller knock the other way. The knock makes the overshoot, not a scripted animation.

Level plates

Each plate is a point: the end of the beam, at cx ± L·cos θ and cy ± L·sin θ. The plate does not turn with the beam, but a second spring makes it rock on its post with the beam’s jolts; the pills on it slide towards the lower end with the sine of the angle.

The flight

The pill changes place in the DOM and animates from where it was (FLIP): x and y go to zero with power2.inOut, y lifts on a sine arc and the scale goes from the size in the row to the size on the plate.

Values to change

NameFileDefaultWhat it changes
STIFFNESSscript.js1.15How stiff the beam’s spring is, in swings per second.
DAMPINGscript.js0.22How quickly the swing dies out: lower means more swings after each reason.
DEG_PER_WEIGHTscript.js2.4How many degrees the beam tilts for each point of difference between the sides.
MAX_TILTscript.js11The steepest tilt of the beam, in degrees.
KICKscript.js26How hard a landing reason knocks its end down.
SLIDEscript.js0.6How far the reasons on the plates slide towards the lower end, in em.
ARCscript.js3.4How high a reason flies on its way to a plate, in em.
FLYscript.js0.72How many seconds a reason’s flight lasts.
PREVIEWscript.js0.35How much the beam leans towards a reason you hover, before you drop it.
STEPscript.js1.5Seconds between two moves when the demo plays by itself.
HOLDscript.js3.2How long the full decision stays before the demo clears the plates.

Try them in the Playground

When to use it

In a decision or list app, on a page comparing two offers or two plans, in a team poll, in a guidance quiz, or anywhere weights move a choice and you want them to feel heavy.

On phones

Everything is in em and the size follows the window’s width and height together, so the balance, the plates and the six reasons fit the box; dragging works with a finger and a tap sends the reason to its side.

With reduced motion

No springs or swings: the beam goes straight to its tilt, the reasons appear on the plate with a fade and the readout changes without rolling.

Pitfalls

  • The physics runs in the GSAP ticker with the time capped at 1/30 of a second: after a background tab a long step would blow up the spring.
  • The plate is a zero-height point and its body grows upwards with bottom: 0, so it anchors to the beam’s end without measuring its height every frame.
  • A plate holds four reasons at most: beyond that the pill goes back to its slot.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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