Skip to content
animorio
IT
All components

Initials avatar

Avatars, Hover, TransitionsGSAP, CSS onlyMediumCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

The avatar picker in the profile settings of an invented notes app, Fernway, with no photo: a large initials avatar on a soft grainy gradient and, under it, six swatches. Picking a swatch, the new gradient spreads from the centre of the avatar like a drop with a rim of light ahead of it, the disc gives a little and comes back, the initials change weight past the mark and settle, and a thin ring runs to the swatch on a spring, stretching with its speed. The initials can be typed and the letter that changes rolls away. Save draws a check and the small avatar in the top bar takes the new gradient.

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>
<!--
  "Initials avatar" 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 initials avatar with the gradient to choose</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 profile picture panel of a notes app, Fernway, with no photo: a large initials avatar on a soft grainy
         gradient. Picking one of six swatches drops the new gradient from the centre of the avatar, the initials
         change weight and settle, a thin ring follows the swatch on a spring; the initials can be typed and roll;
         Save draws a check and the small avatar in the header updates -->
    <section class="panel" data-panel aria-labelledby="panel-title">
      <header class="panel__bar">
        <span class="panel__brand">
          <svg class="panel__mark" viewBox="0 0 20 20" aria-hidden="true">
            <path d="M4 16.5C4 9.5 8.5 4 16 3.5c-.4 7.4-5.6 12.4-12 13Z"/>
            <path class="panel__mark-vein" d="M4.6 15.8 12.2 8"/>
          </svg>
          <span class="panel__name">Fernway</span>
        </span>
        <span class="panel__crumb">Settings</span>
        <span class="mini" data-mini aria-label="Your avatar">
          <span class="mini__base" data-mini-base></span>
          <span class="mini__drop" data-mini-drop></span>
          <span class="mini__grain" aria-hidden="true"></span>
          <span class="mini__letters" data-mini-letters aria-hidden="true">MO</span>
        </span>
      </header>

      <div class="panel__body">
        <div class="av" data-av>
          <span class="av__glow" data-glow-a aria-hidden="true"></span>
          <span class="av__glow" data-glow-b aria-hidden="true"></span>
          <span class="av__disc" data-disc>
            <span class="av__base" data-base></span>
            <span class="av__drop" data-drop></span>
            <span class="av__wave" data-wave aria-hidden="true"></span>
            <span class="av__grain" aria-hidden="true"></span>
            <span class="av__sheen" data-sheen aria-hidden="true"></span>
            <span class="av__letters" data-letters aria-hidden="true"></span>
          </span>
        </div>

        <div class="panel__titles">
          <h1 class="panel__title" id="panel-title">Profile picture</h1>
          <p class="panel__sub">No photo needed. Pick a colour for your initials.</p>
        </div>

        <div class="swatches" role="radiogroup" aria-label="Avatar colour" data-swatches>
          <span class="swatches__ring" data-ring aria-hidden="true"></span>
          <button class="swatch" type="button" role="radio" aria-checked="true" aria-label="Dusk" data-swatch="0"><span class="swatch__face"></span></button>
          <button class="swatch" type="button" role="radio" aria-checked="false" aria-label="Lagoon" data-swatch="1" tabindex="-1"><span class="swatch__face"></span></button>
          <button class="swatch" type="button" role="radio" aria-checked="false" aria-label="Meadow" data-swatch="2" tabindex="-1"><span class="swatch__face"></span></button>
          <button class="swatch" type="button" role="radio" aria-checked="false" aria-label="Amber" data-swatch="3" tabindex="-1"><span class="swatch__face"></span></button>
          <button class="swatch" type="button" role="radio" aria-checked="false" aria-label="Iris" data-swatch="4" tabindex="-1"><span class="swatch__face"></span></button>
          <button class="swatch" type="button" role="radio" aria-checked="false" aria-label="Graphite" data-swatch="5" tabindex="-1"><span class="swatch__face"></span></button>
        </div>

        <label class="field">
          <span class="field__label">Initials</span>
          <span class="field__hint" data-hint>Mara Okafor</span>
          <input class="field__input" data-input type="text" value="MO" maxlength="2" autocomplete="off" spellcheck="false" autocapitalize="characters">
        </label>
      </div>

      <footer class="panel__foot">
        <span class="panel__state" data-state>No changes</span>
        <button class="save" type="button" data-save>
          <span class="save__face" data-save-face>
            <svg class="save__icon" viewBox="0 0 16 16" aria-hidden="true">
              <path class="save__check" data-check pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"/>
            </svg>
            <span class="save__words" data-save-words>Save</span>
          </span>
        </button>
      </footer>
    </section>
    <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>

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.

46 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 “Initials avatar” 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 white page sits the Profile picture panel of Fernway, an invented notes app: warm white paper, a one pixel edge and a soft three layer shadow. On top the bar with the leaf mark, Settings and on the right the small avatar of the account. In the middle the large avatar of Mara Okafor, MO, on a peach and pink gradient with a fine grain, a highlight up on the left and under it a blurred glow of the same colour. Under the title there are six round swatches, Dusk, Lagoon, Meadow, Amber, Iris and Graphite, with a dark ring around the chosen one; lower down the Initials field and at the bottom No changes and the Save button, off. The pilot picks Lagoon: the blue gradient spreads from the centre of the avatar like a drop, with a rim of light running ahead and fading, the disc gives a little and springs back, the initials get heavier past the mark and settle, the glow underneath changes colour and the ring runs to the swatch, stretching, and passes it by a pixel. Then Amber, paler, and the initials turn dark. The pilot types in the field: the O rolls away upwards and the K comes in from below, MK. Then Iris, and the line at the bottom says Unsaved changes. Save squashes and comes back, the word becomes Saved, the check draws itself, the line says Saved just now and the small avatar in the bar takes the violet with the same drop and a small hop. Then everything goes back to Dusk and MO and starts again. With a pointer the highlight on the avatar follows the hand and the disc leans a little.

How it works

The grainy gradient

Each gradient is made of three CSS layers: a radial light up on the left, the deep colour radial low on the right and under them a linear with a third tone worked out by color-mix in oklab, so the blend between the two colours stays soft with no grey band. Over it sits the grain: a feTurbulence noise in an SVG written in the CSS, black and white, blended with mix-blend-mode soft-light. Under the disc a second copy of the gradient, blurred and lowered, is a coloured shadow.

The drop from the centre

The new gradient sits in a layer over the old one with clip-path circle at 50% 50%: GSAP takes the radius from 0 to 74% with power2.out, so the drop starts fast and slows as it reaches the rim. Ahead of it runs a ring of light that grows on the same curve and dies halfway; the disc squashes by 3% and springs back. At the end the gradient moves to the layer below and the radius goes back to zero, ready for the next drop; a new pick halfway finishes the running one at once.

The weight that settles

The initials are in variable Mona Sans and each gradient has its own weight (WEIGHTS): GSAP takes wght sixty past the new weight and the wdth axis to 94 in a quarter of a second, then back to the right weight and to 100 with a hand written ease, the response of a damped spring (BOUNCE). The colour of the letters goes to white or dark depending on how pale the gradient is.

The ring on a real spring

The ring is not a tween: a GSAP ticker integrates a spring with STIFFNESS and DAMPING, its step capped at a thirtieth of a second, towards the centre of the swatch read with offsetLeft. The faster it goes the more it stretches sideways and narrows up and down; once it rests the ticker does nothing. On resize the position is worked out again.

The rolling letters

Each letter has a slot of its own with overflow hidden: when one changes, the old one leaves upwards blurring and the new one comes in from below on the same spring, while the slot eases from the old width to the new; deleting closes the slot, typing one more letter opens one. The field takes two letters only and makes them capitals.

Values to change

NameFileDefaultWhat it changes
INITIALSscript.js'MO'The initials at the start, one or two letters.
WEIGHTSscript.js[640, 700, 760, 760, 600, 540]The weight of the initials on each of the six gradients.
DROPscript.js0.95How long the new gradient takes to fill the avatar, in seconds.
BOUNCEscript.js0.5The settle of the disc and the letters: lower bounces more, 1 not at all.
STIFFNESSscript.js240The spring of the ring under the swatches: higher is quicker.
DAMPINGscript.js17Lower lets the ring pass the swatch and come back.
GRAINscript.js0.6How strong the grain on the gradients is (0 none).
PACEscript.js1The pilot's pauses: higher waits longer between moves.
LOOPscript.jstrueThe pilot plays the story again and again.

Try them in the Playground

When to use it

For the profile settings of an app or a dashboard, for the onboarding of people who sign up without uploading a photo, for the account panel of a subscription service or a team app: it gives everyone a good looking, recognisable avatar with no photo, and makes picking a colour feel like a careful gesture. It also works on a product landing page, as a small live demonstration of the personalisation.

On phones

The same animation with adapted sizes: every size is a multiple of a unit that is one pixel on a computer and shrinks with the width and the height of the window, so the whole panel fits in the phone box. The swatches are tapped with a finger and the field opens the keyboard in capitals.

With reduced motion

Nothing moves: the new gradient fades in instead of spreading as a drop, the letters change with a fade, the weight goes straight to its value, the ring fades out and back in on the chosen swatch, the check and the small avatar change with a fade and the highlight does not follow the pointer.

Pitfalls

  • A straight linear between two far colours (peach and blue, yellow and violet) goes through a dirty grey in the middle: the middle tone is worked out with color-mix in oklab, which stays bright.
  • With two drops in a row the second started over the first while it was still halfway and the layer below kept the old gradient: a new pick finishes the running drop at once (progress(1)) and only then starts its own.
  • The old letter, made absolute to leave, stayed in the slot shifted by half its width: it leaves with xPercent -50 in the same GSAP tween, because GSAP's transform wipes out the one from the CSS.
  • The grain in mix-blend-mode over the initials dirtied them: the initials sit in a layer above the grain and the highlight.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 11 KB; the libraries: GSAP 28 KB.

Testing

Tested on 7 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