
The elastic button
Buttons, Hover, Text
An app’s profile photo upload, on near black, with light as the material: a photo is dropped on the avatar with the initials, the dashed circle lights up and spins, Talia’s photographic portrait comes in blurred and a gradient ring of light runs around it with the megabytes and the percentage. When the ring closes the line thickens and the glow widens, the photo comes into focus with a small settle, a sheen crosses it and Profile photo updated arrives.
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>
<!--
"Profile photo upload loader" 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 profile photo upload with a closing ring of light</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">
<!-- a profile settings card: a photo dropped on the avatar enters blurred, a ring of light runs around it
with the percentage, and when the ring closes the photo comes into focus -->
<section class="card" data-card aria-label="Profile photo">
<header class="card__head">
<div>
<h1 class="card__title">Profile photo</h1>
<p class="card__sub">Shown on your profile and in comments</p>
</div>
<span class="mini" data-mini aria-hidden="true">
<span class="mini__ini" data-mini-ini>TM</span>
<img class="mini__photo" data-mini-photo src="talia.webp" width="1024" height="577" alt="" decoding="async">
</span>
</header>
<div class="body">
<label class="avatar" data-avatar>
<input class="avatar__input" type="file" accept="image/*" data-input aria-label="Choose a profile photo">
<span class="avatar__disc" data-disc>
<span class="avatar__ini" data-ini>TM</span>
<span class="avatar__photo" data-photo>
<img class="avatar__pic" data-pic src="talia.webp" width="1024" height="577" alt="" decoding="async">
<img class="avatar__img" data-img alt="">
</span>
<span class="avatar__sheen" data-sheen></span>
</span>
<svg class="ring" data-ring viewBox="0 0 140 140" aria-hidden="true">
<defs>
<linearGradient id="ringGrad" x1="0" y1="0" x2="1" y2="1">
<stop offset="0" data-stop-a></stop>
<stop offset="1" data-stop-b></stop>
</linearGradient>
<filter id="ringGlow" x="-30%" y="-30%" width="160%" height="160%"><feGaussianBlur stdDeviation="3.2"></feGaussianBlur></filter>
</defs>
<circle class="ring__track" cx="70" cy="70" r="64"></circle>
<circle class="ring__dash" data-dash cx="70" cy="70" r="64"></circle>
<circle class="ring__glow" data-glow cx="70" cy="70" r="64" stroke="url(#ringGrad)" filter="url(#ringGlow)"></circle>
<circle class="ring__line" data-line cx="70" cy="70" r="64" stroke="url(#ringGrad)"></circle>
</svg>
<span class="badge" data-badge aria-hidden="true">
<svg viewBox="0 0 24 24"><path d="M4 8.5h3l1.6-2.2h6.8L17 8.5h3v10H4z"></path><circle cx="12" cy="13.2" r="3.3"></circle></svg>
</span>
</label>
<div class="info">
<p class="info__name">Talia Moreau</p>
<p class="info__state" data-state><span data-state-text>JPG or PNG, up to 5 MB</span></p>
<div class="actions">
<button class="btn btn--main" type="button" data-upload>Upload photo</button>
<button class="btn btn--ghost" type="button" data-remove disabled>Remove</button>
</div>
</div>
</div>
<div class="toast" data-toast role="status" aria-live="polite">
<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"></circle><path data-tick d="M8 12.3l2.7 2.7L16.2 9.4"></path></svg>
<span>Profile photo updated</span>
</div>
</section>
<!-- the photo being dragged in by the autopilot -->
<div class="drag" data-drag aria-hidden="true">
<img class="drag__img" src="talia.webp" width="1024" height="577" alt="" decoding="async">
<span class="drag__name">talia-studio.jpg</span>
</div>
<svg class="pointer" data-pointer viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3l14 8.2-6.1 1.4L10 19z"></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.
27 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 “Profile photo upload loader” from Animorio and fit it into my siteTwo SVG circles with the same gradient, a thin one and a wide one blurred by a filter for the glow, have a stroke-dasharray as long as the circumference and are rotated by minus 90 degrees: stroke-dashoffset goes from the whole circumference to zero with the progress.
While uploading the photo has blur and saturate written on every frame: the blur only drops by a third during the upload, so the real focus arrives all at once when the ring closes, in 0.6 seconds with power3.out, and the scale goes back from 1.12 to 1 with back.out.
Each new state (Drop to upload, Uploading, Updated just now) is a span rising from below while the old one leaves upwards, in a one-line box with hidden overflow; during the upload the text updates in the same span without animating every digit.
The thumbnail and the pointer start from a corner of the stage and reach the centre of the avatar measured at that moment (GSAP function values, so it survives a resize); once dropped, the thumbnail shrinks to the size of the circle and turns round.
The avatar is a label with a real file input: you can drag a photo from your computer or pick one with Upload photo, and the upload starts with it. At the first touch or key the autopilot stops. The autopilot instead drags a real photo, talia.webp: the same image in the thumbnail, the large avatar and the small one, cropped round with object-fit cover and object-position on the face (the --fuoco variable), because the photo is wide and the face sits on the right.
| Name | File | Default | What it changes |
|---|---|---|---|
NAME | script.js | Talia Moreau | The name on the profile: the initials come from it. |
FILE_NAME | script.js | talia-studio.jpg | The name of the photo the autopilot drags. |
PHOTO_MB | script.js | 4.2 | How big the photo is, in MB. |
UPLOAD_TIME | script.js | 2.8 | How many seconds the upload takes. |
BLUR_START | script.js | 14 | How blurred the photo is while uploading, in pixels. |
RING_GLOW | script.js | 1 | How much the ring of light glows (0 = no glow). |
ACCENT | script.js | #8b7bff | The first colour of the ring. |
ACCENT_2 | script.js | #5ee0ff | The second colour of the ring. |
For the profile settings page of an app or a platform, the onboarding of a new account, a team member’s photo in a dashboard, the avatar of a community or a messaging app.
The card takes the width minus the margins and the avatar is sized on the screen height (between 84 and 124 pixels); tapping the avatar or Upload photo opens the phone’s photo picker. The same animations, with adapted sizes.
Nothing moves or blurs: no drag, the photo fades in already in focus, the ring is already closed and the Profile photo updated pill appears with its tick already drawn.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.8 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.