Skip to content
animorio
IT
Back to the library

AI answer arena

Text, TransitionsGSAPMediumCompressed weight: Demo 8.6 KBGSAP 28 KBFreeDownload the zip

The blind comparison of a made-up app for evaluating AI models, Pairwise: one question, two unnamed answers writing themselves side by side, word by word, at different speeds. Then the vote between four choices: the losing column folds away on a spring while the seam between them bends, the winner widens to the whole card, and the real names appear under a block of colour while the vote count rolls. Then the next question. Minimal style, a single 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>
<!--
  "AI answer arena" 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>AI answer arena</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/jetbrains-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- A blind comparison in a made-up model evaluation app, Pairwise. One question, two anonymous answers that write
       themselves side by side at different speeds; then the vote. The losing column folds away on a spring while the
       winner widens to the whole card, and the real names are revealed under a coloured block while the vote count
       rolls. Then the next question. -->
  <main class="stage">
    <article class="arena" data-arena aria-label="Blind comparison of two AI answers">
      <header class="arena__head">
        <p class="brand">
          <svg class="brand__mark" viewBox="0 0 16 16" aria-hidden="true"><path d="M2.5 4.5h4.2v7H2.5zM9.3 4.5h4.2v7H9.3z"/></svg>
          Pairwise
        </p>
        <p class="tally"><span class="tally__label">Votes today</span> <span class="roll mono" data-votes>1,284</span></p>
      </header>

      <div class="question">
        <span class="question__tag mono">You</span>
        <p class="question__text" data-question>How do I keep basil alive on a windowsill?</p>
      </div>

      <div class="cols" data-cols>
        <section class="col" data-col="a">
          <header class="col__head">
            <span class="chip"><span class="chip__text" data-name="a">Model A</span><i class="chip__block" data-block="a"></i></span>
            <span class="col__stat mono" data-stat="a"></span>
          </header>
          <div class="col__body"><p class="answer" data-answer="a"></p></div>
        </section>
        <svg class="seam" data-seam viewBox="0 0 24 100" preserveAspectRatio="none" aria-hidden="true">
          <path data-seam-path d="M12 0 Q12 50 12 100"/>
        </svg>
        <section class="col" data-col="b">
          <header class="col__head">
            <span class="chip"><span class="chip__text" data-name="b">Model B</span><i class="chip__block" data-block="b"></i></span>
            <span class="col__stat mono" data-stat="b"></span>
          </header>
          <div class="col__body"><p class="answer" data-answer="b"></p></div>
        </section>
        <div class="full" data-full aria-hidden="true"><p class="answer answer--full" data-full-text></p></div>
      </div>

      <div class="vote" role="radiogroup" aria-label="Which answer is better?" data-vote>
        <span class="vote__pill" data-pill aria-hidden="true"></span>
        <button type="button" role="radio" class="choice" data-choice="a" aria-checked="false">A is better</button>
        <button type="button" role="radio" class="choice" data-choice="b" aria-checked="false">B is better</button>
        <button type="button" role="radio" class="choice" data-choice="tie" aria-checked="false">Tie</button>
        <button type="button" role="radio" class="choice" data-choice="bad" aria-checked="false">Both bad</button>
      </div>

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

25 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 “AI answer arena” 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 page, the Pairwise card: at the top the brand and today’s votes, below the question in its strip («How do I keep basil alive on a windowsill?»). Two columns, Model A and Model B, split by a thin seam: the two answers write themselves together, word by word, each at its own speed; every word arrives with a fade and a one-pixel rise, followed by a green caret that never blinks but thins after each word. When they are done the four choices light up: A is better, B is better, Tie, Both bad. The pointer reaches A is better, the label widens, the click presses it; the white pill slides under the choice on a spring and today’s votes roll up by one. The losing column folds towards the edge and fades, the seam in the middle bends and disappears, the winner widens to the whole card and its text settles at the full width; then the card shortens around the answer. A green block sweeps over the label and uncovers the real name, «Model A · Orrin-2», and beside it who it beat. After a pause everything closes and the next question arrives, where B wins. You can click the choices yourself too.

How it works

Words that already hold their place

Each answer is split into words, each in an inline-block span already in place and transparent: appearing only means going from opacity 0 to 1 with a one-pixel rise, so lines never shift while the text writes itself.

Two speeds

A single timeline puts every word at its moment: i / A_RATE for Model A, i / B_RATE for Model B. The vote opens when both are done.

The thinning caret

When each word arrives the caret jumps right after its last letter (a Range measures the word without its space) and goes back to 2.2 pixels wide, then narrows to 1 in 0.45 seconds: it breathes with the writing instead of blinking.

The folding column

The widths of the two columns and the seam are worked out by the script from a single number, p, going from 0 to 1 on back.out: the loser goes to zero, the seam with it, the winner takes the rest. While they move both answers keep their width, so no line breaks; at the end the winning text fades into the full width and the card shortens.

The bending seam

The seam is an SVG path with a quadratic curve: its control point moves towards the losing column by BEND times the sine of p, and past 1 the spring pushes it a little further before it fades.

The name under the block

A green block grows from the left over the label in 0.32 seconds, the name changes under it, then the block leaves to the right in 0.38: the real name is there when the colour goes.

Values to change

NameFileDefaultWhat it changes
A_RATEscript.js13How many words per second Model A writes.
B_RATEscript.js7.5How many words per second Model B writes.
FOLD_TIMEscript.js0.9How many seconds the losing column takes to fold away.
SPRINGscript.js1.6How far the fold overshoots before it settles (0, no overshoot).
BENDscript.js18How far the seam between the columns bends, in pixels.
HOLDscript.js2.6How many seconds the result stays before the next question.
AUTOPLAYscript.jstrueThe pointer votes on its own until you vote yourself.

Try them in the Playground

When to use it

In an app comparing models or prompts, in an AI model leaderboard, in an internal tool for rating an assistant’s answers, on the page of an AI product that wants to show why its answer is better; and anywhere two proposals sit side by side before one is chosen.

On phones

The card is sized on both width and height (vw and vh), so it fits the phone box; the two columns stay side by side with smaller text, the seam narrows and the count loses its label. A tap votes.

With reduced motion

No words arriving one by one, no caret, no spring: the answers fade in whole, the losing column fades away and the name changes without the block.

Pitfalls

  • The two answers must keep their width while the columns move: left free, the loser narrows and its words stack one per line, suddenly stretching the card.
  • The caret is measured with a Range over the word without its trailing space, otherwise it sits one space away.
  • Widths are in pixels: on resize everything is measured again and p reapplied, even mid-move.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.

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

Testing

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