Skip to content
animorio
IT
Back to the library

Activity heatmap

Hover, SVGGSAPMediumCompressed weight: Demo 8.1 KBGSAP 28 KBFreeDownload the zip

The activity card of a dashboard, dark and product grade: six months of days light up in a diagonal wave while the total of contributions counts up. Under the pointer the cells grow like the icons of a dock, a white outline jumps from day to day on a spring and a glass label follows it with the number and the date. Touching ‘Longest streak’ the longest run lights up one day after the other.

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>
<!--
  "Activity heatmap" 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 dashboard activity heatmap with cells that rise under the pointer</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">
    <!-- the activity card of a team dashboard: the days light up in a diagonal wave while the total counts up; under
         the pointer the cells rise like the icons of a dock, an outline jumps from day to day on a spring and a glass
         label follows with the day and its number; the longest streak can be traced one day after the other -->
    <article class="card" data-card aria-label="Team activity, last six months">
      <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="M4 3h5v6h7v8h-5v-6H4Z"></path></svg>
          Kelvo
        </span>
        <span class="head__range">Last 6 months</span>
      </header>

      <div class="total">
        <span class="total__n" data-total>0</span>
        <span class="total__label">contributions by the team</span>
        <span class="total__delta">
          <svg viewBox="0 0 12 12" aria-hidden="true"><path d="M2.5 9.5 9.5 2.5M4.4 2.5h5.1v5.1"></path></svg>
          18%
        </span>
      </div>

      <div class="map" data-map>
        <svg class="map__svg" data-svg role="img" aria-label="Heatmap of daily contributions">
          <g data-months class="map__months"></g>
          <g data-days class="map__days"></g>
          <g data-cells></g>
          <rect class="map__cursor" data-cursor></rect>
        </svg>
        <div class="tip" data-tip aria-hidden="true">
          <b data-tip-n>9 contributions</b>
          <span data-tip-d>Tue, 14 Oct</span>
        </div>
      </div>

      <footer class="foot">
        <button class="streak" type="button" data-streak>
          <svg viewBox="0 0 14 14" aria-hidden="true"><path d="M7.6 1.2 3 7.8h3.4L5.9 12.8 11 6h-3.6Z"></path></svg>
          Longest streak <b data-streak-n>0 days</b>
        </button>
        <span class="legend" aria-hidden="true">
          Less
          <i></i><i></i><i></i><i></i><i></i>
          More
        </span>
      </footer>
    </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.

26 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 “Activity heatmap” 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 page with a purple haze at the top sits a dark card with round corners and an edge that catches light: at the top the ‘Kelvo’ mark and the ‘Last 6 months’ label, then the big total, the words ‘contributions by the team’ and the ‘18%’ pill with its arrow. Below, the map: twenty six weeks of rounded squares, seven per column, with the months written above and Mon, Wed, Fri on the left. On opening the squares pop up in a diagonal wave from the top left, each with a small bounce, from the grey of empty days to four steps of purple, while the total counts up to the map’s real number. Then the pointer crosses the days: the squares nearby grow, the closest the most, like the icons of a dock; a white outline jumps from one day to the next on a spring that passes the mark and comes back, and a frosted glass label follows above it, with ‘9 contributions’ and ‘Tue, 14 Oct’. Once the pointer leaves, the longest run lights up: ‘Longest streak 23 days’ brightens and its days take a white edge one after the other, then let it go. Left alone the squares close in a reverse wave and the round starts again; with a real pointer or finger the map stays lit and follows the hand.

How it works

Days as objects

Each day is an object with its SVG cell and three numbers: show (how far it has popped up), h (how close the pointer is) and s (whether it is part of the lit streak). Every frame the cell’s scale is show times (1 + MAGNIFY times h), written into its transform only if it changed.

The diagonal wave

A GSAP timeline takes show from 0 to 1 with back.out for each cell, delayed by column plus row times 0.7, multiplied by WAVE: the wave travels diagonally. The same time counts the total up, which is the real sum of the days drawn.

The dock effect

For each cell the distance from the pointer is measured in cells; inside RADIUS the wanted value is (1 minus distance over RADIUS) squared, and h chases it with a step proportional to time. The cells are centred on the origin, so they grow from their middle and the SVG lets them spill past its edge.

The outline and the label on a spring

The day under the pointer is found by dividing the position by the grid pitch. The white outline and the glass label chase it on a spring integrated by hand (stiffness 210, damping 19, two steps a frame); the label stays inside the map’s sides and goes below when there is no room above.

The longest streak

The streak is the longest run of days with at least one contribution, found in the data. A timeline takes s to 1 one day after the other every 45 milliseconds, with a small scale kick and the white edge, and after a second and a half takes it back to zero in the same order.

The sizes

The grid pitch is the smaller of the width divided by the weeks and the height left divided by seven; under 14 pixels the weeks drop to twenty and then sixteen. On resize the map is built again from scratch.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#7a6bffThe colour of the busy days.
MAGNIFYscript.js0.55How much the cell under the pointer grows: 0.55 = one and a half times.
RADIUSscript.js2.8How many cells away the magnification reaches.
WAVEscript.js0.03How many seconds between one diagonal and the next, when the days light up.
STIFFNESSscript.js210The spring of the outline and the label: higher is quicker.
DAMPINGscript.js19Lower lets the outline pass the mark and come back.
SEEDscript.js7Changes the invented data of the days.
LOOPscript.jstrueLeft alone, it starts the round again.

Try them in the Playground

When to use it

For the dashboard of a developer app, a work tool or a habit app: the card that sums up months of activity day by day, also good on the product page as a showpiece.

On phones

The same animation with adapted sizes: sixteen or twenty weeks instead of twenty six, without the weekdays on the left, and the pitch also follows the height. With a finger the cells rise where it touches and drags.

With reduced motion

The map fades in with the total already written; the cells do not grow, the outline and the label go from day to day without a spring and the streak lights up all at once.

Pitfalls

  • Writing the transform of 182 cells every frame is a waste: each cell remembers the last string written and is redrawn only when something moves.
  • The label cannot have its scale animated by GSAP and its position written by hand in the same transform: GSAP animates only the opacity, the spring writes the position.
  • Rebuilding the map on resize makes new cell objects and the running timeline would move the old ones: the round starts again from the wave.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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