
The needle gauge
Counters, Physics, SVG
The quote slider of Tilewright, a made-up roofing company, in a white card from a premium shot. At the top sits a roof plane drawn in thin lines, and as you drag the area slider, from 40 to 240 m², the tiles settle row by row from the eave to the ridge with a small staggered bounce, the last row half full. The price estimate rolls like a counter and settles by a pixel, a Clay, Slate, Metal switch changes the colour and shape of the tiles in a wave, a light passes over the roof and the Get a quote button lights up.
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>
<!--
"Roof quote slider" 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>Roof quote slider</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" data-stage>
<!-- the roof estimate of Tilewright, an invented roofing company: a roof plane drawn in thin lines that fills with
tiles row by row while the area slider moves, a material switch, a rolling price and the Get a quote button -->
<section class="quote" aria-labelledby="q-title" data-card>
<header class="quote__head">
<div>
<h2 class="quote__title" id="q-title">Roof estimate</h2>
<p class="quote__sub">Tilewright · Full re-roof, fitted</p>
</div>
<span class="rate" aria-label="Price per square metre">$<span class="roll" data-roll-rate></span><span class="rate__unit">/m²</span></span>
</header>
<div class="roof" data-roof>
<svg class="roof__svg" viewBox="0 0 300 134" preserveAspectRatio="xMidYMid meet" aria-hidden="true" data-svg>
<defs>
<clipPath id="roof-clip"><path d="M14 118 L70 18 L230 18 L286 118 Z"/></clipPath>
<linearGradient id="roof-light" x1="0" x2="1" y1="0" y2="0">
<stop offset="0" stop-color="#fff" stop-opacity="0"/>
<stop offset="0.5" stop-color="#fff" stop-opacity="0.55"/>
<stop offset="1" stop-color="#fff" stop-opacity="0"/>
</linearGradient>
<linearGradient id="roof-shade" x1="0" x2="0" y1="0" y2="1">
<stop offset="0" stop-color="#000" stop-opacity="0"/>
<stop offset="1" stop-color="#000" stop-opacity="0.12"/>
</linearGradient>
</defs>
<path class="roof__plane" d="M14 118 L70 18 L230 18 L286 118 Z"/>
<g class="roof__guides" data-guides></g>
<g clip-path="url(#roof-clip)">
<g class="roof__tiles" data-tiles></g>
<rect x="0" y="0" width="300" height="120" fill="url(#roof-shade)" class="roof__shade" data-shade/>
<g data-light><path d="M-40 0 L-6 0 L-46 120 L-80 120 Z" fill="url(#roof-light)"/></g>
</g>
<path class="roof__edge" d="M14 118 L70 18 L230 18 L286 118 Z"/>
<line class="roof__ridge" x1="70" y1="18" x2="230" y2="18" data-ridge/>
<g class="roof__chimney"><rect x="196" y="2" width="17" height="30" rx="1.5"/><rect class="cap" x="193.5" y="0.5" width="22" height="4" rx="1.2"/></g>
<path class="roof__gutter" d="M8 121.5 H292" />
<path class="roof__wall" d="M30 124 V134 M270 124 V134" />
</svg>
<span class="roof__fill" aria-hidden="true"><span data-roll-pct class="roll"></span>% tiled</span>
</div>
<div class="row">
<div class="price" data-price>
<span class="price__key">Estimate</span>
<span class="price__val" data-price-val>$<span class="roll" data-roll-price></span></span>
</div>
<div class="mats" role="radiogroup" aria-label="Material" data-mats>
<span class="mats__pill" aria-hidden="true" data-pill></span>
<button type="button" role="radio" class="mat" data-mat="clay" aria-checked="true">Clay</button>
<button type="button" role="radio" class="mat" data-mat="slate" aria-checked="false" tabindex="-1">Slate</button>
<button type="button" role="radio" class="mat" data-mat="metal" aria-checked="false" tabindex="-1">Metal</button>
</div>
</div>
<div class="area">
<div class="area__head">
<span class="area__key">Roof area</span>
<span class="area__val"><span class="roll" data-roll-area></span> m²</span>
</div>
<div class="slide" data-slide>
<div class="slide__track" aria-hidden="true"><span class="slide__fill" data-fill></span></div>
<div class="ticks" aria-hidden="true" data-ticks></div>
<span class="thumb" role="slider" tabindex="0" aria-label="Roof area in square metres" data-thumb>
<span class="thumb__body" data-body><span class="thumb__core" data-core></span></span>
</span>
</div>
</div>
<button class="cta" type="button" data-cta>
<span class="cta__face" data-cta-face>
<span class="cta__glow" aria-hidden="true" data-glow></span>
<span class="cta__sweep" aria-hidden="true" data-sweep></span>
<span class="cta__words" data-cta-words>Get a quote</span>
<svg class="cta__icon" viewBox="0 0 16 16" aria-hidden="true" data-cta-icon><path class="arr" d="M3.5 8h8.2M8.4 4.4 12 8l-3.6 3.6"/><path class="chk" d="M3.6 8.4 6.6 11.2 12.4 4.8"/></svg>
</span>
</button>
<p class="sr" aria-live="polite" data-live></p>
</section>
<svg class="pointer" viewBox="0 0 24 24" aria-hidden="true" data-pointer>
<path d="M5 3.2l13.6 8.3-6 1.2-3.1 5.6z"/>
</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.
39 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 “Roof quote slider” from Animorio and fit it into my siteThe roof plane is an SVG trapezoid: for each row the edges at that height are worked out and the tiles are laid offset by half a tile every other row, cut by the trapezoid’s clipPath. The rows are added from the eave up and each tile reaches a little down over the row below, so every course laps over the top of the lower one as on a real roof; they are laid in the same order, left to right.
The drawn area (the spring’s one) becomes the share of tiles laid: area over the maximum times the number of tiles. When the number goes up, the new tiles fall with a small staggered timeline (drop, squash, elastic bounce); when it goes down they lift and vanish from the last one. The last row stays half full on its own.
The finger’s value and the drawn one: on every frame of GSAP’s ticker a damped spring pulls the second towards the first, with the step capped at 1/30 of a second. The diamond inside the thumb stretches with the speed, and the ticks light up and snap as the drawn value passes them.
Price, area, rate and percentage are columns from 0 to 9 moved by yPercent, with a fixed thousands comma. The material changes a CSS colour variable and the path of every tile (round clay tile, bevelled slate, ribbed metal panel), and the laid tiles turn over in a wave with scaleY.
| Name | File | Default | What it changes |
|---|---|---|---|
MIN_AREA | script.js | 40 | The smallest area, in square metres. |
MAX_AREA | script.js | 240 | The largest area: at this the roof is fully tiled. |
START_AREA | script.js | 120 | Where the slider sits when it opens. |
STEP | script.js | 5 | How many square metres the slider moves by and the multiple it settles on. |
BASE_PRICE | script.js | 1450 | The fixed part of the quote, in dollars. |
RATE_CLAY | script.js | 86 | Dollars per square metre for clay. |
RATE_SLATE | script.js | 124 | Dollars per square metre for slate. |
RATE_METAL | script.js | 68 | Dollars per square metre for metal. |
ROWS | script.js | 8 | How many rows of tiles the roof has. |
STIFFNESS | script.js | 380 | The spring pulling the thumb to the finger. |
DAMPING | script.js | 22 | Lower lets it pass the mark and come back. |
SWELL | script.js | 1.24 | How much the grabbed thumb swells. |
DROP | script.js | 9 | How high a tile falls from. |
SPEED | script.js | 1 | The speed of the round on its own. |
AUTO | script.js | true | The drawn pointer that plays with the slider until someone touches it. |
--accent | style.css | #c2512a | The brick of the track, the ticks and the lit button. |
--clay | style.css | #c8643b | The colour of the clay tiles. |
--slate | style.css | #4b5563 | The colour of the slate. |
--metal | style.css | #9aa4ad | The colour of the metal. |
On the quote page of a roofing company, a builder or anyone selling panels and roofs: the visitor sees at once what they would spend and what they get, and the button to ask for the real quote is right there.
The card narrows to 90% of the screen and the roof gets shorter with the height of the box; the finger grabs the thumb like the mouse and a tap on the track brings it there. Nothing scrolls sideways while dragging.
No springs, drops or self-moving pointer: the card fades in with the tiles already laid, the thumb follows the finger, the tiles fade in and out and the digits change without rolling.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 12 KB; the libraries: GSAP 28 KB.
Tested on 17 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.