
The star rating
Ratings, SVG, Hover
The field for uploading an image in a form: a dashed box where you drop the file or pick it. As soon as it arrives, the box shrinks into a row with the image’s real preview, which comes out of the blur from top to bottom as the upload advances, together with the bar and the percentage; at the end a green tick, and a cross to remove it.
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>
<!--
"Image upload field" 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>Image upload field with the preview that reveals itself while it uploads</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 image field of a form: drop a picture or pick one; the field shrinks into a row with the thumbnail,
which comes into focus from top to bottom as the upload advances, with the name, the size and the percent -->
<div class="up" data-up>
<label class="up__drop" data-drop>
<input class="sr" type="file" accept="image/*" data-input>
<span class="up__ico" data-ico aria-hidden="true"><svg viewBox="0 0 28 28"><rect x="3.5" y="5.5" width="21" height="17" rx="4"></rect><path d="M7.500 18.500 12 14l3.200 3.200 2.300-2.300 3 3.600"></path><path class="up__arrow" data-arrow d="M14 2v8M10.800 5.200 14 2l3.200 3.200"></path></svg></span>
<span class="up__main">Drop an image or <b>browse</b></span>
<span class="up__hint">PNG or JPG, up to 5 MB</span>
</label>
<div class="up__file" data-file>
<span class="thumb" data-thumbbox><img data-thumb alt=""><span class="thumb__veil" data-veil></span><span class="thumb__sheen" data-sheen></span><svg class="thumb__ok" data-ok viewBox="0 0 20 20" aria-hidden="true"><rect x="1" y="1" width="18" height="18" rx="6"></rect><path pathLength="1" data-tick d="M5.600 10.400 8.600 13.200 14.400 6.900"></path></svg></span>
<span class="info"><span class="info__name" data-name>cover-sunrise.jpg</span><span class="info__meta"><span data-size>1.8 MB</span><span class="roll"><span data-status>Uploading</span></span></span><span class="info__bar"><span data-bar></span></span></span>
<button class="up__x" type="button" data-remove aria-label="Remove the image"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.200 4.200 11.800 11.800M11.800 4.200 4.200 11.800"></path></svg></button>
</div>
</div>
<p class="sr" data-live aria-live="polite"></p>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></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.
17 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 “Image upload field” from Animorio and fit it into my siteUnderneath there is a file input inside a label: it works with a click, from the keyboard and with drag and drop (dragover and drop). The chosen image becomes a local address with URL.createObjectURL and goes into the thumbnail; name and weight come from the file. In the demo, with no file, the picture is painted on a canvas.
Over the thumbnail there is a dark layer with backdrop-filter: blur. One number from 0 to 1 drives its clip-path (inset from the top), the bar’s scaleX and the percentage text together: the image comes into focus exactly as much as it has been uploaded.
The panel has two fixed heights, 148 and 96 pixels, and GSAP goes from one to the other with back.out while the dashed box leaves and the row comes in; the two contents overlap in absolute position, so nothing wraps during the change.
| Name | File | Default | What it changes |
|---|---|---|---|
UPLOAD | script.js | 2.2 | How many seconds the upload takes. |
NAME | script.js | cover-sunrise.jpg | The demo file’s name. |
SIZE | script.js | 1.8 MB | The demo file’s weight. |
BLUR | script.js | 7 | How blurred, in pixels, the part not yet uploaded is. |
ACCENT | script.js | #7c9cff | The colour while uploading. |
OK | script.js | #5fe0a2 | The colour when the upload is done. |
LOOP | script.js | true | Left alone, a pointer uploads an image and then removes it. |
For any form that asks for an image: a profile photo, an article’s cover, a product or listing photo, a company logo. In a real product the progress number comes from the request’s progress event, and the rest does not change.
The same field, at most as wide as the screen minus the margins: touching it opens the phone’s photo picker, and there is no drag and drop.
No shrinking panel, sliding veil or bounces: the row appears at once, the percentage climbs in steps and at the end preview, tick and label are in place.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.3 KB; the libraries: GSAP 28 KB.
Tested on 15 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.