
The send button
Buttons, Transitions, SVG
The card of an analytics dashboard for an AI writing app, dark on black, like a Dribbble shot. On top four tabs, Overview, Revenue, Users and AI usage: over the active one a lens of liquid glass runs on a spring from tab to tab, stretches while it runs, settles and slightly magnifies and bends the label under it, with a highlight sliding inside the glass. Below, the content changes in the lens's direction: the figure rolls on drums, the chart line draws itself and the bars fill.
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>
<!--
"Glass lens dashboard tabs" 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 tabs with the sliding glass lens</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 analytics card of an AI writing assistant (Fernlight, invented). Over the active tab a lens of liquid glass
slides on a spring, stretches while it runs and settles; under it the words are magnified and bent at the
edges, a highlight catches the light. Below, the content of the tab changes in the direction of travel -->
<section class="dash" data-dash aria-label="Fernlight analytics">
<span class="dash__grain" data-grain aria-hidden="true"></span>
<span class="dash__sheen" aria-hidden="true"></span>
<header class="dash__head">
<span class="dash__brand">
<svg class="dash__mark" viewBox="0 0 20 20" aria-hidden="true">
<path d="M10 2.2c.6 3.9 3.9 7.2 7.8 7.8-3.9.6-7.2 3.9-7.8 7.8-.6-3.9-3.9-7.2-7.8-7.8 3.9-.6 7.2-3.9 7.8-7.8z"/>
</svg>
<span>Fernlight</span>
<span class="dash__crumb">Analytics</span>
</span>
<button class="dash__range" type="button">
<span>Last 30 days</span>
<svg viewBox="0 0 12 12" aria-hidden="true"><path d="M3 4.6l3 3 3-3"/></svg>
</button>
</header>
<div class="tabs" data-tabs>
<div class="tabs__track" role="tablist" aria-label="Analytics views" data-track>
<button class="tabs__tab" type="button" role="tab" id="tab-overview" aria-controls="pane-overview" aria-selected="true" tabindex="0" data-tab>Overview</button>
<button class="tabs__tab" type="button" role="tab" id="tab-revenue" aria-controls="pane-revenue" aria-selected="false" tabindex="-1" data-tab>Revenue</button>
<button class="tabs__tab" type="button" role="tab" id="tab-users" aria-controls="pane-users" aria-selected="false" tabindex="-1" data-tab>Users</button>
<button class="tabs__tab" type="button" role="tab" id="tab-ai" aria-controls="pane-ai" aria-selected="false" tabindex="-1" data-tab>AI usage</button>
<span class="lens" data-lens aria-hidden="true">
<span class="lens__glass" data-glass>
<span class="lens__bend">
<span class="lens__text" data-lens-text>
<span>Overview</span><span>Revenue</span><span>Users</span><span>AI usage</span>
</span>
</span>
</span>
<span class="lens__rim"></span>
<span class="lens__shine" data-shine></span>
</span>
</div>
</div>
<div class="panes" data-panes>
<section class="pane" role="tabpanel" id="pane-overview" aria-labelledby="tab-overview" data-pane>
<p class="pane__label" data-part>Active workspaces</p>
<div class="pane__figure" data-part>
<span class="num" data-num="12,480">12,480</span>
<span class="delta"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M3 7.6l3-3 3 3"/></svg>8.2%</span>
</div>
<div class="chart" data-part data-chart data-points="38 42 40 47 45 52 50 55 61 58 64 70 68 74 79 77 84"></div>
<ul class="rows" data-part>
<li class="row"><span class="row__name">Prompts today</span><span class="row__bar"><i data-w="0.82"></i></span><b class="row__val">48.2k</b></li>
<li class="row"><span class="row__name">Median reply</span><span class="row__bar"><i data-w="0.46"></i></span><b class="row__val">1.4 s</b></li>
<li class="row"><span class="row__name">Uptime</span><span class="row__bar"><i data-w="0.97"></i></span><b class="row__val">99.98%</b></li>
</ul>
</section>
<section class="pane" role="tabpanel" id="pane-revenue" aria-labelledby="tab-revenue" hidden data-pane>
<p class="pane__label" data-part>Monthly recurring revenue</p>
<div class="pane__figure" data-part>
<span class="num" data-num="$184,920">$184,920</span>
<span class="delta"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M3 7.6l3-3 3 3"/></svg>12.4%</span>
</div>
<div class="chart" data-part data-chart data-points="30 33 31 38 44 41 49 53 52 60 63 61 69 75 73 82 90"></div>
<ul class="rows" data-part>
<li class="row"><span class="row__name">Pro plans</span><span class="row__bar"><i data-w="0.74"></i></span><b class="row__val">$96.4k</b></li>
<li class="row"><span class="row__name">Team plans</span><span class="row__bar"><i data-w="0.56"></i></span><b class="row__val">$71.2k</b></li>
<li class="row"><span class="row__name">API</span><span class="row__bar"><i data-w="0.18"></i></span><b class="row__val">$17.3k</b></li>
</ul>
</section>
<section class="pane" role="tabpanel" id="pane-users" aria-labelledby="tab-users" hidden data-pane>
<p class="pane__label" data-part>Weekly active users</p>
<div class="pane__figure" data-part>
<span class="num" data-num="31,604">31,604</span>
<span class="delta"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M3 7.6l3-3 3 3"/></svg>5.1%</span>
</div>
<div class="chart" data-part data-chart data-points="55 58 54 60 63 59 62 66 64 68 65 70 72 69 73 76 75"></div>
<ul class="rows" data-part>
<li class="row"><span class="row__name">New sign-ups</span><span class="row__bar"><i data-w="0.38"></i></span><b class="row__val">2,318</b></li>
<li class="row"><span class="row__name">Kept after 30 days</span><span class="row__bar"><i data-w="0.74"></i></span><b class="row__val">74%</b></li>
<li class="row"><span class="row__name">Teams</span><span class="row__bar"><i data-w="0.52"></i></span><b class="row__val">1,946</b></li>
</ul>
</section>
<section class="pane" role="tabpanel" id="pane-ai" aria-labelledby="tab-ai" hidden data-pane>
<p class="pane__label" data-part>Tokens this month</p>
<div class="pane__figure" data-part>
<span class="num" data-num="2.84B">2.84B</span>
<span class="delta"><svg viewBox="0 0 12 12" aria-hidden="true"><path d="M3 7.6l3-3 3 3"/></svg>21.7%</span>
</div>
<div class="chart" data-part data-chart data-points="20 24 29 27 35 41 39 48 55 52 61 67 72 70 79 86 93"></div>
<ul class="rows" data-part>
<li class="row"><span class="row__name">Assistant</span><span class="row__bar"><i data-w="0.57"></i></span><b class="row__val">1.62B</b></li>
<li class="row"><span class="row__name">Search</span><span class="row__bar"><i data-w="0.29"></i></span><b class="row__val">0.81B</b></li>
<li class="row"><span class="row__name">Agents</span><span class="row__bar"><i data-w="0.14"></i></span><b class="row__val">0.41B</b></li>
</ul>
</section>
</div>
</section>
<!-- the bend of the glass: a displacement map drawn by script.js pushes the words outwards near the lens' rim -->
<svg class="defs" width="0" height="0" aria-hidden="true" focusable="false">
<filter id="lens-bend" x="0" y="0" width="1" height="1" color-interpolation-filters="sRGB" primitiveUnits="objectBoundingBox">
<feImage data-map x="0" y="0" width="1" height="1" preserveAspectRatio="none" result="map"/>
<feDisplacementMap in="SourceGraphic" in2="map" scale="0.06" xChannelSelector="R" yChannelSelector="G"/>
</filter>
</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>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.
65 values to change
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 “Glass lens dashboard tabs” from Animorio and fit it into my siteThe lens is not driven by a tween: its centre and width chase the chosen tab on a spring integrated every frame (stiffness 210, damping 19, two steps per frame, a step of at most 1/30 s). A click halfway through turns it around without a jump.
Every frame the drawn width is the spring's plus the speed times STRETCH, and the height loses a few pixels: the lens stretches and thins while it runs and turns round again when it stops. A separate tween does the press, 0.08 s down and an elastic back.
Inside the lens sits a copy of the four labels, as wide as the well and laid out the same way; it moves opposite to the lens so it lines up with the real ones, and it is scaled around the lens's centre. The glass has a solid body, so it covers the real labels: only the copy shows, bigger and brighter.
The glass has an SVG feDisplacementMap filter with a map drawn once on a canvas: neutral in the middle and stronger towards the edges (cubed), in bounding-box units, so it follows the lens even while it changes width. Letters near the rim are sampled from further out: they squeeze and curve as under the edge of thick glass, and never spill past the lens.
The sign of the difference between the new tab and the old gives the way: the pieces of the old content leave to one side with a little blur, the new ones come in from the other, staggered by 0.05 s. The figure rolls on drums of two rounds of digits, the chart line and its gradient are uncovered from the left by a clipping rect, followed by a thread of light and the bars grow with scaleX.
| Name | File | Default | What it changes |
|---|---|---|---|
STIFFNESS | script.js | 210 | The spring pulling the lens to its tab: higher is quicker. |
DAMPING | script.js | 19 | Lower lets the lens pass the mark and come back. |
STRETCH | script.js | 0.05 | How much the lens stretches with its speed. |
MAGNIFY | script.js | 1.12 | How much the glass magnifies the label under it. |
BEND | script.js | 0.06 | How much the rim of the glass bends the letters. |
SLIDE | script.js | 26 | How many pixels the content slides when it changes. |
DWELL | script.js | 2.6 | The seconds the walk on its own stays on a tab. |
LOOP | script.js | true | Repeats the walk through the tabs. |
For the dashboard of an AI app, a SaaS, an online shop or a subscription service: the tabs switching views in a stats card, and any group of tabs on top of a panel where the chosen tab should feel like a real object.
The same animation with adapted sizes: the card is 92% of the screen wide, the tab labels shrink, the chart and the rows get lower with the height (below 460 pixels two rows remain) and the tabs are chosen with a finger; on the chart the cursor follows the finger.
The lens does not run: it appears at once on the new tab with a fade, the content changes with a fade without sliding, the figure, the line and the bars are already in place.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 11 KB; the libraries: GSAP 28 KB.
Tested on 5 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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
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.