
The star rating
Ratings, SVG, Hover
The ‘Compress 3 images’ button of an image optimiser app, in dark ink on white with a mint light, like a Dribbble shot: on the left three drawn thumbnails between two thin jaws, in the middle the weight with a short bar, on the right a porcelain knob with two chevrons facing each other. Pressed, it compresses one image at a time: a line of light reads it, the jaws close, the thumbnail squashes and settles smaller, the weight rolls down from 12.6 to 3.1 MB and the bar shrinks. At the end the knob turns mint, a check draws itself and the label says how much was saved.
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>
<!--
"Compress images button" 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 Compress images button with the file size that drops</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 Compress images button of an image optimiser, in soft ink on white with a mint light. On the left three
thumbnails of the images in a small fan between two thin jaws; on hover the fan opens and the chevrons in the
knob pinch once. Pressed, the button compresses: a line of light reads each thumbnail, the jaws close on it,
it squashes and settles a little smaller, while the weight rolls down and the bar beside it shrinks. At the
end the chevrons become a check, the knob turns mint and the label says how much was saved -->
<div class="ci" data-wrap>
<span class="ci__floor" data-floor aria-hidden="true"></span>
<button class="ci__btn" type="button" data-btn aria-label="Compress 3 images, 12.6 MB">
<span class="ci__body" data-body>
<span class="ci__skin" aria-hidden="true"></span>
<span class="ci__shine" data-shine aria-hidden="true"></span>
<span class="ci__sweep" aria-hidden="true"><span class="ci__sweep-band" data-sweep></span></span>
<span class="ci__row">
<span class="ci__press" aria-hidden="true">
<span class="ci__jaw ci__jaw--l" data-jaw></span>
<span class="ci__fan" data-fan>
<span class="ci__thumb ci__thumb--c" data-thumb><span class="ci__scene"></span><span class="ci__scan" data-scan></span></span>
<span class="ci__thumb ci__thumb--b" data-thumb><span class="ci__scene"></span><span class="ci__scan" data-scan></span></span>
<span class="ci__thumb ci__thumb--a" data-thumb><span class="ci__scene"></span><span class="ci__scan" data-scan></span></span>
</span>
<span class="ci__jaw ci__jaw--r" data-jaw></span>
</span>
<span class="ci__text" aria-hidden="true">
<span class="ci__labels">
<span class="ci__label" data-label>Compress 3 images</span>
<span class="ci__label" data-label>Compressing</span>
<span class="ci__label" data-label>Saved 9.5 MB</span>
</span>
<span class="ci__meta">
<span class="ci__weight"><span data-weight>12.6</span> MB</span>
<span class="ci__bar"><span class="ci__bar-fill" data-bar></span></span>
<span class="ci__note" data-note>PNG</span>
</span>
</span>
<span class="ci__knob" data-knob aria-hidden="true">
<span class="ci__well" data-well>
<svg class="ci__icon" viewBox="0 0 20 20">
<path class="ci__chev" data-chev d="M3.6 6.2L7.4 10l-3.8 3.8"/>
<path class="ci__chev" data-chev d="M16.4 6.2L12.6 10l3.8 3.8"/>
<path class="ci__check" data-check pathLength="1" d="M5.2 10.4l3.2 3.2 6.6-7"/>
</svg>
</span>
</span>
</span>
</span>
</button>
</div>
<p class="sr" aria-live="polite" data-live></p>
</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.
29 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 “Compress images button” from Animorio and fit it into my siteThe button’s body is a single box with overflow hidden, moved only by GSAP (scale and y for the press, a 0.994 scaleX at every stroke of the press); inside, a layer with a feTurbulence grain in an SVG used as image, a mint radial-gradient in the corner and a vertical gradient, plus four inner shadows for the one pixel edges; above it a radial-gradient that follows the pointer through two CSS variables moved by gsap.quickTo.
Each thumbnail is a span with the sky colour in a CSS variable; its child draws the sun and two hills with four backgrounds (two hard-edged radial-gradients mixed with color-mix, the sun with its halo, the sky vertically) and an ::after makes the reflection. GSAP moves only x, y, rotation and scale between four poses: rest, open fan, tight while working, squared stack at the end.
The compression is a timeline with one step per thumbnail: the line of light crosses the image by animating left in percent, the jaws come in with power3.in, the thumbnail goes to scaleX 0.8 and scaleY 1.06 and then settles at 0.92 on an elastic spring, while the two chevrons in the knob pinch by 1.8 pixels and come back.
An object with a value from 0 to 1 moves in steps, a third per image (power1.in then power3.out, like a real job): from it come the megabytes with one decimal and the bar with scaleX from the left origin; at the end a mint layer of the bar lights up through a CSS variable animated by GSAP.
The knob has a mint layer in ::before with its opacity in a CSS variable: GSAP takes it to 1, the two chevrons slide out to the sides, the check draws itself with pathLength 1 and strokeDashoffset and grows from 0.8 on a spring with svgOrigin at the centre; meanwhile a slanted reflection crosses the pill.
| Name | File | Default | What it changes |
|---|---|---|---|
LABEL_REST | script.js | Compress 3 images | The label at rest. |
LABEL_BUSY | script.js | Compressing | The label while the images are compressed. |
LABEL_DONE | script.js | Saved | The label at the end, followed by the megabytes saved. |
FORMAT | script.js | PNG | The format written beside the weight at rest. |
SIZE_BEFORE | script.js | 12.6 | Megabytes before the compression. |
SIZE_AFTER | script.js | 3.1 | Megabytes after the compression. |
DURATION | script.js | 3 | Seconds the compression of the three images takes. |
SQUEEZE | script.js | 1 | How hard the jaws squash each thumbnail: 0 none, 2 a lot. |
FAN | script.js | 1 | How wide the fan of thumbnails opens on hover. |
SPRING | script.js | 1 | How springy the press and the thumbnails are: 0.4 calm, 2 very bouncy. |
HOLD | script.js | 1.8 | Seconds the saved state stays before going back. |
AUTO | script.js | true | Goes round by itself until someone touches it. |
For an app or site that optimises images, a CMS, a photo editor, a developer tool or the panel of an online shop preparing product photos; it fits anywhere an action makes something lighter (backups, archives, videos). The weight rolling down shows at once how much is gained.
On the phone the button is at most 86% of the screen wide and the label shortens with an ellipsis if needed; there is no hover, so the light under the finger turns on at the touch and the compression, with the press and the weight rolling down, is the same.
Nothing moves: the fan and the jaws stay still, the weight rolls down and the bar shrinks, the labels swap in place, the knob fades to mint and the check appears where the chevrons were.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 8.6 KB; the libraries: GSAP 28 KB.
Tested on 7 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.