Skip to content
animorio
IT
Back to the library

Code review diff

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

The review of a code change inside Mergewell, a made-up developer tool, on near black and in the clean style of today’s apps: in the file the removed lines are covered by a red wash with a minus, the new ones open between the others with a plus and the code typing itself, while the line numbers and the change count roll. Then a comment opens under a line, and Approve, once pressed, fills with light and sends a glint around the panel.

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>
<!--
  "Code review diff" 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 code review with the lines that change</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>
  <main class="stage" data-stage>
    <!-- a made-up code review tool, Mergewell: the removed lines turn red, the added ones open and type
         themselves in green, a comment opens on a line, then Approve is pressed -->
    <section class="card" aria-label="Mergewell pull request review" data-card>
      <span class="card__glow" aria-hidden="true" data-glow></span>
      <header class="card__top">
        <span class="brand">
          <svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true"><path d="M5 3.5v13"/><path d="M5 7.5c0 3.2 2.4 4.5 5.4 4.5H15"/><circle cx="5" cy="3.5" r="1.6"/><circle cx="5" cy="16.5" r="1.6"/><circle cx="15" cy="12" r="1.6"/></svg>
          <span>Mergewell</span>
        </span>
        <span class="status" data-status>
          <span class="status__word" data-status-word>Review</span>
        </span>
      </header>

      <div class="pr">
        <h1 class="pr__title">Round invoice totals to cents</h1>
        <p class="pr__branches"><span class="chip">fix/rounding</span><svg class="pr__into" viewBox="0 0 16 10" aria-hidden="true"><path d="M1 5h13M10 1.5 14 5l-4 3.5"/></svg><span class="chip">main</span></p>
      </div>

      <div class="file">
        <div class="file__bar">
          <svg class="file__icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M4 1.5h5.5L13 5v9.5H4z"/><path d="M9.5 1.5V5H13"/></svg>
          <span class="file__path">src/billing/<b>invoice.ts</b></span>
          <span class="count"><span class="count__add" data-adds>+0</span><span class="count__del" data-dels></span></span>
        </div>
        <div class="code" data-code></div>
      </div>

      <footer class="card__foot">
        <span class="reviewer">
          <span class="avatar" aria-hidden="true">IR</span>
          <span class="reviewer__text"><b>Ines R.</b> <span data-who-text>is reviewing</span></span>
        </span>
        <button class="approve" type="button" data-approve>
          <span class="approve__shine" aria-hidden="true"></span>
          <svg class="approve__check" viewBox="0 0 20 20" aria-hidden="true"><path data-checkpath d="M4.5 10.4 8.3 14 15.5 6.3"/></svg>
          <span class="approve__label" data-approve-label>Approve</span>
        </button>
      </footer>
    </section>
    <span class="frame" data-inquadra aria-hidden="true"></span>
    <svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true"><path d="M5 2.8v16.4l4.2-4 2.8 6.2 2.9-1.3-2.8-6.1h5.9Z"/></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>

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.

29 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 “Code review diff” 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 near black background, with a faint green glow just below, there is a panel with round corners and a thin border: at the top the Mergewell mark, two branches joining, and the status pill, Review; below, the title of the change, Round invoice totals to cents, with its two branches, fix/rounding and main. Then the file, src/billing/invoice.ts, with the count of added and removed lines and the code of a function that adds up an invoice, with two columns of line numbers. The panel arrives rising a few pixels on a spring, and the lines light up one after another. Then the changes, one at a time: a line that has to go is crossed by a red wash from the left, with a red thread on its edge, the minus pops out and the text dims with a small shiver; a new line opens between the others with a bounce, the green wash fills it, the plus pops out and the code types itself letter by letter. Meanwhile the numbers of the new column roll into place and the count at the top, plus in green and minus in red, goes up. A drawn pointer goes to the line using cents, a small white plus appears in the gutter, and it presses it: under the line a comment opens with the avatar and its text typing itself. Then the pointer presses Approve: the button squashes and comes back with an elastic, a light crosses it, the check draws itself, the label becomes Approved, a green ring widens and fades, the pill at the top turns green and says Approved, and a glint of light runs once around the border of the panel. After a few seconds the panel goes down and it all starts again.

How it works

The file as data

The code is a list of lines, each with its kind, kept, removed or added, and the coloured pieces of its text. The script builds every line with the two number columns, the sign, the text and the wash, and the numbers are recomputed after every change: the old column counts what was there, the new one what is there now.

The wash crossing the line

The wash is a child of the line, absolute and as big as it, with its transform-origin on the left: GSAP takes it from scaleX 0 to 1 in WASH seconds with power2.inOut. It is a separate element so that GSAP’s transform does not wipe anything on the line.

The line that opens

The added lines have their height written as calc(1.78em * var(--o)): GSAP takes --o from 0 to 1 with back.out, so the line opens with a small bounce and stays right even if the window changes size.

The code that types

The font is monospaced, so one letter is one ch: the line text has a max-width in ch and a tween counts from 0 to the number of letters, one every TYPE seconds, uncovering the code with its colours already in place.

The rolling numbers

When a number changes, the old figure rises and vanishes in 14 hundredths, then the new one comes from below with back.out: the same for the line numbers, the change count and the status pill.

Approve and the glint

Pressed, the button squashes to 0.95 and comes back with elastic.out, a blade of light crosses it, and the check widens and draws itself with its dash. The glint around the panel is a conic-gradient masked to a one-pixel border, turning with the --a variable from 0 to 360 degrees.

Values to change

NameFileDefaultWhat it changes
TYPEscript.js0.026The seconds between one letter and the next in the added lines and the comment.
WASHscript.js0.45The seconds of the red or green wash crossing a line that changes.
OPENscript.js0.5The seconds an added line takes to open between the others.
GAPscript.js0.55The pause in seconds between one change and the next.
HOLDscript.js2.4The seconds with the review approved before the loop starts again.
ADD_COLORscript.js#3ccf7aThe colour of the added lines, the count and Approve.
DEL_COLORscript.js#ff6b6bThe colour of the removed lines.
COMMENTscript.jsRounding before the multiply. Is 0.005 covered by a test?The comment typed under the line.

Try them in the Playground

When to use it

For the landing page of a developer tool, a code review service or an AI assistant that checks changes: it shows in a few seconds what the product does, reading a change, commenting on it and approving it.

On phones

The same animation with adapted sizes: the type is sized on the width and the height, the code is written short so it never runs off the side, under 420 pixels the second branch and the words beside the reviewer’s name disappear, and the comment and Approve are tapped with a finger.

With reduced motion

No opening lines, running washes or typing letters: the file appears with the changes already marked and the comment open, fading in, without the pointer; Approve, when pressed, changes its label and colour with a fade.

Pitfalls

  • The height of the added lines is a variable from 0 to 1 multiplied by 1.78em, not a number of pixels: with pixels the open line would keep its old size when the window changes.
  • The wash is a child of the line, not the line itself: scaling the line would squash the text along with the wash.
  • The typing text is clipped in ch rather than split into letters: this way the code colours stay inside their pieces and the tween does not have to create hundreds of elements.

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 9.0 KB; the libraries: GSAP 28 KB.

Testing

Tested on 28 October 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