Skip to content
animorio
IT
All components

Profile photo upload loader

Loading, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.8 KBGSAP 28 KBFreeDownload the zip

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.

The code

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>

Playground

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

Or ask your AI assistant for it

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 site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a near-black background there is the Profile photo card, with Shown on your profile and in comments in grey and, at the top right, the account’s small avatar with its initials. Below, the large avatar: a dark disc with the initials TM, a thin ring around it and the white chip with the camera; beside it the name Talia Moreau, JPG or PNG, up to 5 MB and the Upload photo and Remove buttons. A pointer arrives dragging a thumbnail, talia-studio.jpg: as soon as it is over the avatar, a dashed circle lights up around it and spins, the disc leans forward and the line says Drop to upload. Once dropped, the thumbnail shrinks into the circle; the photo comes in, a real close-up portrait of a smiling young woman in front of green bokeh, blurred, enlarged and almost colourless. A violet and cyan ring of light with its glow starts from twelve o’clock and runs around while the line counts Uploading 2.1 of 4.2 MB, 50%. When the ring closes the line thickens for a moment, the glow widens and vanishes, the photo comes into focus and back to its size with a small bounce, a sheen crosses it, the chip hops, the small avatar at the top takes the photo and below the card the Profile photo updated pill rises with its tick drawing itself. Then the pointer presses Remove, the photo blurs away and the initials come back; then the loop starts again.

How it works

The ring that closes

Two 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.

The photo blurred until the end

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.

The rolling status line

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 autopilot’s drag

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.

Real photos

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.

Values to change

NameFileDefaultWhat it changes
NAMEscript.jsTalia MoreauThe name on the profile: the initials come from it.
FILE_NAMEscript.jstalia-studio.jpgThe name of the photo the autopilot drags.
PHOTO_MBscript.js4.2How big the photo is, in MB.
UPLOAD_TIMEscript.js2.8How many seconds the upload takes.
BLUR_STARTscript.js14How blurred the photo is while uploading, in pixels.
RING_GLOWscript.js1How much the ring of light glows (0 = no glow).
ACCENTscript.js#8b7bffThe first colour of the ring.
ACCENT_2script.js#5ee0ffThe second colour of the ring.

Try them in the Playground

When to use it

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.

On phones

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.

With reduced motion

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.

Pitfalls

  • The ring circle must be rotated by minus 90 degrees with its own transform attribute around the centre: with CSS alone on an SVG element Safari gets the origin wrong and the ring starts from three o’clock.
  • A blur inside a circle with hidden overflow pulls the dark background in from the edge and the photo looks shrunk: the scale stays at 1.12 while it is blurred and only goes back to 1 with the focus.
  • The autopilot measures the avatar at the moment of the move, with GSAP function values: measured once at the start, after a resize the thumbnail lands in the wrong place.
  • A wide photo in a circle with object-fit cover is cropped in the middle and the face, which sits on the right, ends up cut in half: object-position must move onto the face, the same in all three places it appears. And the loop starts on the load event, so the photo is already decoded when it enters the disc.

Libraries

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.

Testing

Tested on 5 November 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All components