
Logo loader
Transitions, SVG, Text
The allocation card of Tessly, a made-up investing app: a $248,310 portfolio drawn as a treemap, worked out with the real squarified algorithm. The pill on top regroups it by sector, asset class or region, and every tile springs from its old box to its new one while the percentages roll; green says what is up today, a soft red what is down. On hover a tile rises a hair with a thin outline and its value in dollars. Minimal style.
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>
<!--
"Portfolio treemap" 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>Portfolio treemap</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 allocation card of a made-up investing app: a treemap of the portfolio, worked out with the squarified
algorithm. The pill on top regroups it by sector, asset class or region, and every tile springs from its old
box to its new one. Hover or tap a tile to read its value. -->
<section class="card" data-card aria-labelledby="titolo">
<span class="card__sheen" aria-hidden="true"></span>
<header class="head">
<div class="head__left">
<span class="brand">
<svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true"><rect x="2.5" y="2.5" width="8.5" height="15" rx="2" fill="currentColor"/><rect x="12.5" y="2.5" width="5" height="8" rx="1.6" fill="currentColor" opacity=".55"/><rect x="12.5" y="12" width="5" height="5.5" rx="1.6" fill="currentColor" opacity=".3"/></svg>
Tessly
</span>
<h1 class="title" id="titolo">Allocation</h1>
</div>
<div class="head__right">
<span class="total" data-total>$248,310</span>
<span class="day"><svg class="day__arrow" viewBox="0 0 10 10" aria-hidden="true"><path d="M5 8V2.4M2.4 4.8 5 2.2l2.6 2.6" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/></svg><span data-day>+1.24%</span> today</span>
</div>
</header>
<div class="pills" role="tablist" aria-label="Group the portfolio by" data-pills>
<span class="pills__thumb" data-thumb aria-hidden="true"></span>
<button class="pill is-on" role="tab" aria-selected="true" data-group="sector" type="button">Sector</button>
<button class="pill" role="tab" aria-selected="false" data-group="asset" type="button">Asset</button>
<button class="pill" role="tab" aria-selected="false" data-group="region" type="button">Region</button>
</div>
<div class="map" data-map>
<svg class="map__svg" data-svg role="img" aria-label="Portfolio treemap"></svg>
<div class="tip" data-tip aria-hidden="true">
<span class="tip__k" data-tip-k>Technology</span>
<span class="tip__v" data-tip-v>$76,977</span>
<span class="tip__c" data-tip-c>+2.1% today</span>
</div>
</div>
<footer class="foot">
<span class="legend"><i class="legend__sw legend__sw--down"></i>Down</span>
<span class="legend"><i class="legend__sw legend__sw--flat"></i>Flat</span>
<span class="legend"><i class="legend__sw legend__sw--up"></i>Up today</span>
<span class="foot__note">Tile size = share of the portfolio</span>
</footer>
<p class="sr" data-sr aria-live="polite"></p>
</section>
</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.
32 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 “Portfolio treemap” from Animorio and fit it into my siteValues, from largest to smallest, are laid in rows along the short side of the remaining rectangle: a tile joins the row as long as the worst aspect ratio does not get worse, then the row closes and a new one starts. That keeps the tiles close to square.
Each tile is an object with x, y, width, height and opacity; GSAP takes it to the new geometry with a back.out and every frame rewrites the attributes of the rect and the labels. It is not a scale: the text never stretches and the corners stay round.
At the final geometry the name is measured on a canvas: if it does not fit, it stays hidden; the percentage and the change only appear if there is height. During the trip the labels step out in 0.12 s and come back on the new box at seven tenths of the change, while the percentage rolls.
Today’s change picks the colour: up to ±0.15% the paper, then a green that fills up to full at +2.4%, and for what is down a soft red that never gets full. Above 55% green the label turns white.
On hover the tile moves to the top of the drawing, rises LIFT pixels with a back.out, gets a thin outline and a double shadow, and the tooltip comes in from 6 pixels lower while staying inside the card.
| Name | File | Default | What it changes |
|---|---|---|---|
SWITCH_EVERY | script.js | 3.6 | How many seconds before the card moves by itself to the next grouping, when nobody touches it. |
MORPH | script.js | 0.8 | How many seconds a tile takes to spring from its old box to its new one. |
OVERSHOOT | script.js | 1.3 | How far the tiles overshoot their new box before they settle (0 = none). |
STAGGER | script.js | 0.02 | Seconds between one tile and the next as they move. |
GAP | script.js | 4 | The gap between the tiles, in pixels. |
RADIUS | script.js | 7 | How rounded the tile corners are, in pixels. |
LIFT | script.js | 2 | How many pixels a tile rises under the pointer. |
ROLL | script.js | 0.6 | How many seconds a percentage takes to roll to its new value. |
In the dashboard of an investing or banking app, in a portfolio summary, in an analytics panel showing the parts of a whole (sales by category, disk space, budget by team) that can be grouped in several ways.
The card is sized in em and the text size follows the window’s width and height together; the treemap is at most 44% of the screen tall and is worked out again at every resize. A tap on a tile opens and closes the tooltip.
No springs and no moving tiles: the new treemap arrives with a fade, the percentages change without rolling and the tile under the pointer only gets its outline and tooltip.
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.
Tested on 25 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.