Skip to content
animorio
IT
All components

Connect wallet button

Buttons, HoverGSAP, CSS onlyMediumCompressed weight: Demo 7.0 KBGSAP 28 KBFreeDownload the zip

A crypto app’s Connect wallet button, on black: pressed, it waits for the signature with a turning ring, then the lime pill goes dark and the address decodes itself character by character. Connected, it shows the identicon born from that address, the balance counting up and a way to disconnect.

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>
<!--
  "Connect wallet 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>Connect wallet button</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 Connect wallet button: it waits for the signature, the address decodes itself character by character,
         and the pill settles dark with the identicon drawn from that address, the balance and a way out -->
    <div class="cw" data-cw role="group" aria-label="Wallet">
      <button class="cw__main" type="button" data-main>
        <span class="cw__slot" aria-hidden="true">
          <svg class="cw__wallet" data-wallet viewBox="0 0 24 24"><path d="M4 8.500A2.500 2.500 0 0 1 6.500 6H17v3M4 8.500v8A2.500 2.500 0 0 0 6.500 19H18a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2H6.500A2.500 2.500 0 0 1 4 8.500ZM15.300 14h1.400"></path></svg>
          <svg class="cw__spin" data-spin viewBox="0 0 24 24"><circle cx="12" cy="12" r="8.500"></circle></svg>
          <svg class="cw__face" data-face viewBox="0 0 5 5" shape-rendering="crispEdges"></svg>
        </span>
        <span class="cw__text">
          <span class="cw__roll cw__label"><span data-label>Connect wallet</span></span>
          <span class="cw__addr" data-addr></span>
          <span class="cw__roll cw__sub"><span data-sub></span></span>
        </span>
      </button>
      <button class="cw__off" type="button" data-off aria-label="Disconnect wallet" tabindex="-1">
        <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 4.500v7M7.400 7.200a6.800 6.800 0 1 0 9.200 0"></path></svg>
      </button>
      <span class="cw__say" data-say aria-live="polite"></span>
    </div>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></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.

13 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Connect wallet button” 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 black, a lime pill 60 pixels tall with the wallet icon and “Connect wallet”; on hover a soft light follows the pointer along its top edge. Pressed, it gives a little, widens on a spring, the label rolls to “Confirm in wallet” and a ring turns where the icon was. Once the signature arrives the pill goes dark with a hairline edge, widens again and the address comes in in fixed-width characters: the places not yet settled keep changing digit and stop one after the other, from the left, down to 0x71C4…9A3f. Then the identicon grows from its middle outwards, one square at a time, with the glow’s colour taken from the same address; the address steps up a line and below it the balance counts to 1.284 ETH; the disconnect key appears on the right. A tap on the connected pill copies the address and the balance line says “Address copied”; the key on the right folds everything back into the lime pill.

How it works

The identicon from the address

A small hash of the address seeds a number generator: fifteen flips decide a five-by-five grid mirrored down the middle, like wallet identicons, and the first number gives the hue of the squares and of the glow.

The address that decodes

One tween from 0 to 1: its integer part says how many characters have settled, the rest take a random hex digit about twenty-eight times a second. The text is rewritten only when one of the two counts changes.

Three widths, one spring

The pill has a width per state and reaches it on an elastic spring; the colours are CSS variables (--fill, --text, --glow) tweened by GSAP, so ground, label, edge and glow change together.

The ring on its centre

The whole svg turns with transformOrigin at 50% 50%; the identicon’s squares each scale from their own centre, ordered by distance from the middle of the grid.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#c9f43cThe button’s colour before connecting.
ADDRESSscript.js0x71C4a8E2b90D35f6A1c7e04B8d2F5a639E0b9A3fThe wallet address: the identicon and its colour are born from it.
BALANCEscript.js1.284The balance shown under the address.
COINscript.jsETHThe coin’s ticker beside the balance.
SIGNscript.js1.5How many seconds it waits for the signature in the wallet.
DECODEscript.js0.9How many seconds the address takes to decode, character by character.
LOOPscript.jstrueLeft alone, the demo’s pointer connects the wallet, copies the address and disconnects.

Try them in the Playground

When to use it

In the header of an app used with a wallet: a decentralised exchange, a marketplace of digital items, a staking dashboard. With other words, for any sign-in that goes through another app: “Sign in with passkey”, a code on the phone, a company login.

On phones

The same button by finger, 60 pixels tall: the connected pill is never wider than the screen and the disconnect key is a 40-pixel round. The light that follows the pointer exists only where there is a pointer.

With reduced motion

No springs and no turning: the ring stays still, the address appears already written, the identicon and the balance appear in place and the colours switch at once.

Pitfalls

  • Address and balance are made up and the signature is fake: a real app asks the wallet for accounts (window.ethereum or WalletConnect) and must handle a refusal too.
  • The identicon is not that of any particular wallet: it is our own grid, built the same way. For the exact drawing of a given wallet use its library.
  • The changing characters sit in a fixed-width face: with a proportional one the address would wobble in width at every digit.
  • The clipboard is written only after a real click: the demo’s clicks have isTrusted false.
  • The state is also said in words in an aria-live region, and the connected button takes the label “Copy address”: the change is not left to colour alone.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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