
Falling tools
Physics, Hover
A live poll between two answers, on warm white, as a tug of war: a taut rope with a knot, the centre line and the two shares at the ends. Every vote coming in pulls the knot its way on a real spring, which swings and settles; the side ahead takes the colour. Voting gives the rope a yank, and when the knot crosses the centre line the colour changes side.
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>
<!--
"Tug-of-war poll" 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>Tug-of-war poll</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 live poll as a tug of war: the knot on the rope pulled by the votes on a real spring,
the centre line to cross and the two shares at the ends -->
<section class="tw" data-tw aria-label="Live poll">
<header class="tw__head"><span class="tw__tag">Live poll</span><span class="tw__votes"><b data-outvotes>240</b> votes</span></header>
<h1 class="tw__ask">What should we build next?</h1>
<div class="tw__ends">
<span class="tw__end" data-end="0"><b><span data-outpct="0">47</span>%</b><i>Dark mode</i></span>
<span class="tw__end" data-end="1"><b><span data-outpct="1">53</span>%</b><i>Offline sync</i></span>
</div>
<svg class="tw__rope" data-rope aria-hidden="true">
<line class="mid" data-mid></line>
<path class="half" data-half="0"></path>
<path class="half" data-half="1"></path>
<rect class="post" data-post="0" width="4" height="18" rx="2"></rect>
<rect class="post" data-post="1" width="4" height="18" rx="2"></rect>
<circle class="knot" data-knot r="7"></circle>
</svg>
<div class="tw__btns">
<button type="button" class="tw__btn" data-side="0" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path pathLength="1" d="m3.600 8.400 2.900 2.900 5.900-6.600"></path></svg><span>Dark mode</span></button>
<button type="button" class="tw__btn" data-side="1" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path pathLength="1" d="m3.600 8.400 2.900 2.900 5.900-6.600"></path></svg><span>Offline sync</span></button>
</div>
</section>
<span class="live" aria-live="polite" data-live></span>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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>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
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Tug-of-war poll” from Animorio and fit it into my siteThe knot has a position and a velocity. On every frame a force pulls it towards where it belongs and friction slows it: the swing and the settling come out by themselves, with no drawn curves.
Where it belongs depends on the share of the votes: half and half is the centre, and every point of lead moves it towards the side ahead.
Every vote changes the count and also gives the knot a push of velocity its way; your own vote gives a strong one. The rope has its own small spring too, which makes it quiver.
When the count shown changes sign, the colour class moves to the other share and the other half of the rope, and the knot swells once.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #e2502f | The colour of the side ahead: its share and its half of the rope. |
STIFF | script.js | 140 | How stiff the spring taking the knot to its place is. |
DAMP | script.js | 11 | How much it is damped: low, the knot swings for long; high, it stops at once. |
RATE | script.js | 1.4 | How many times a second the others’ votes come in. |
LOOP | script.js | true | Left alone, the demo’s pointer votes, its side rallies and then it starts again. |
In the poll of a live stream, an event or a meeting, on the page where a community picks between two features, or in a challenge between two teams; the same rope and knot carries a comparison between two products, the balance between income and spending or a fundraiser’s progress against its goal.
The card is at most 348 pixels wide and about 250 tall, and narrows with the screen: the rope is redrawn on the width it finds. The two buttons are 44 pixels tall and half the card wide.
No spring, yanks or swinging: with every vote the knot is already in its place and the numbers change in one step; the chosen button has its tick already drawn. The demo’s pointer does not start.
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.
Tested on 30 November 2026
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.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.