From de96dd4ad078b3583e4fb9987ee780beecf712ea Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 15 May 2026 11:21:44 -0400 Subject: [PATCH] Add spinner feedback to Sign in with Nostr button while loading pubkey --- src/index.html | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/src/index.html b/src/index.html index af68a1f..4d9598a 100644 --- a/src/index.html +++ b/src/index.html @@ -453,6 +453,28 @@ border-radius: 8px; padding: 7px 10px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); + transition: opacity .15s; + } + + .pill:disabled { + opacity: .7; + cursor: wait; + } + + .pill .spinner { + display: inline-block; + width: 14px; + height: 14px; + border: 2px solid var(--line); + border-top-color: var(--accent); + border-radius: 50%; + margin-right: 6px; + animation: spin .55s linear infinite; + vertical-align: -2px; + } + + @keyframes spin { + to { transform: rotate(360deg); } } .previewShell { @@ -4404,13 +4426,22 @@ } async function nostrLogin() { - const pubkey = await getNostrPublicKey(); - if (!pubkey) { - alert('No Nostr extension found. Install Alby, nos2x, or another NIP-07 extension.'); - return; + const loginBtn = $('nostrLoginBtn'); + const orig = loginBtn.innerHTML; + loginBtn.disabled = true; + loginBtn.innerHTML = 'Sign in with Nostr'; + try { + const pubkey = await getNostrPublicKey(); + if (!pubkey) { + alert('No Nostr extension found. Install Alby, nos2x, or another NIP-07 extension.'); + return; + } + state.community.myPubkey = pubkey; + await loadCommunityIdentity(); + } finally { + loginBtn.disabled = false; + loginBtn.innerHTML = orig; } - state.community.myPubkey = pubkey; - await loadCommunityIdentity(); } async function loadMyDesigns() {