Skip to content
animorio
IT
Back to the library

Git blame view

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

The “blame” view of a file, in a dark card: eight lines of code and, beside each, who last changed it and how long ago, with a thin strip going from the amber of changes three days old to the dull blue of those two years old. Moving over a line, all the lines of the same commit light up together and below appear the message, the author and the hash. The “Blame” switch closes the column and the code slides left, line after line. Minimal style.

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>
<!--
  "Git blame view" 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>Git blame view</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">
    <!-- a git blame view: every line of a file with who last changed it and how long ago, the lines of one commit
         lighting up together, and the commit told in a row below -->
    <section class="gb" data-gb aria-label="Git blame">
      <header class="gb__head">
        <span class="gb__file">billing/<b>totals.ts</b></span>
        <button type="button" class="gb__switch" data-switch role="switch" aria-checked="true"><span>Blame</span><i><u data-knob></u></i></button>
      </header>

      <ol class="gb__code" data-code>
        <li class="gb__line" data-line data-c="a"><span class="gb__who"><b>MO</b><em>3d</em></span><code><span class="k">export function</span> <span class="f">orderTotal</span>(items) {</code></li>
        <li class="gb__line" data-line data-c="b"><span class="gb__who"><b>LB</b><em>2y</em></span><code>  <span class="k">let</span> sum = <span class="n">0</span>;</code></li>
        <li class="gb__line" data-line data-c="b"><span class="gb__who"></span><code>  <span class="k">for</span> (<span class="k">const</span> it <span class="k">of</span> items) {</code></li>
        <li class="gb__line" data-line data-c="c"><span class="gb__who"><b>SR</b><em>5mo</em></span><code>    sum += it.price * it.qty;</code></li>
        <li class="gb__line" data-line data-c="b"><span class="gb__who"><b>LB</b><em>2y</em></span><code>  }</code></li>
        <li class="gb__line" data-line data-c="a"><span class="gb__who"><b>MO</b><em>3d</em></span><code>  <span class="k">const</span> c = Math.<span class="f">round</span>(sum * <span class="n">100</span>);</code></li>
        <li class="gb__line" data-line data-c="a"><span class="gb__who"></span><code>  <span class="k">return</span> c / <span class="n">100</span>;</code></li>
        <li class="gb__line" data-line data-c="b"><span class="gb__who"><b>LB</b><em>2y</em></span><code>}</code></li>
      </ol>

      <footer class="gb__foot" data-foot>
        <span class="gb__av" data-outav>MO</span>
        <div class="gb__msg"><strong class="gb__clip gb__clip--tall"><span data-outmsg>Round totals to whole cents</span></strong><span class="gb__clip"><span data-outmeta>Maya Okafor, 3 days ago</span></span></div>
        <span class="gb__sha" data-outsha>a1b9c3e</span>
      </footer>
    </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>

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.

54 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 “Git blame view” 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 black, a dark card: at the top the file name, “billing/totals.ts”, and on the right the “Blame” switch, on in amber. Below, eight lines of a function adding up an order, in monospace with syntax colours. To the left of each line a narrow column: the initials of who last changed it and the age (“MO 3d”, “LB 2y”, “SR 5mo”), written only on the first line of each group, and a thin vertical strip coloured by age, amber the recent ones, dull blue the old. At the bottom a darker row: a circle with initials, the commit message (“Round totals to whole cents”), “Maya Okafor, 3 days ago” and the hash “a1b9c3e”. The three lines of that commit have an amber veil. Moving over another line the veil passes to all the lines of its commit, even far apart, the code on those lines gives a small jolt, and below message and author roll, the circle bounces, the hash changes. Tapping the switch the knob slides, the column closes line after line and the code moves left; the commit row dims. Switched back on, the column returns with a bounce.

How it works

Every line has its commit

An attribute on the line says which commit it belongs to; a separate list keeps author, message, when and how many days ago.

Age on a log scale

The strip’s colour mixes amber and blue by the logarithm of the days: so three days, five months and two years all look different.

Lighting up a commit

Pointing at a line, the same class goes to every line with the same commit, and the bottom row is rewritten rolling.

Closing the column

With blame off, each line’s column width goes down to 14 pixels, staggered line by line: the code follows because it sits in the same row.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#f0a23aThe colour of the most recent changes and of the commit pointed at.
OLDscript.js#4f6f9cThe colour of the oldest lines in the age strip.
GUTTERscript.js66How wide the column of who wrote the line is, in pixels.
LOOPscript.jstrueLeft alone, the demo’s pointer points at three commits and turns blame off and on.

Try them in the Playground

When to use it

On the page of a code editor, a repository service or a review tool, to show how a file’s history is read; the same pattern carries the changes of a shared document, the revisions of a contract, who touched the cells of a sheet or the entries of a log.

On phones

The card is at most 372 pixels wide and about 310 tall. Under 350 pixels the code goes down to 11 pixels, the column narrows and the commit hash hides; code lines that are too long are cut with an ellipsis. With a finger a tap on a line lights up its commit.

With reduced motion

No jolts or bounces: the veil and the commit row change in one step, and the blame column opens and closes without sliding. The demo’s pointer does not start.

Pitfalls

  • Age is not told by colour alone: it is written beside the initials, and every line has a label for screen readers with author and when.
  • A linear scale would squash three days and five months onto the same colour, because two years are so much more: use the logarithm.
  • Initials and age are written only on the first line of a run of consecutive lines from the same commit, otherwise the column becomes a wall of initials.
  • The switch is a `role="switch"` with `aria-checked`: when off, moving over the lines no longer changes the commit shown.
  • File, names, commits and hashes are invented.

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

Testing

Tested on 2 December 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