wiz avatar spa

This commit is contained in:
shocknet-justin 2025-10-09 18:50:05 -04:00
parent 997fa43aad
commit e3e0baed24
3 changed files with 26 additions and 16 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

@ -38,17 +38,19 @@
<input type="text" placeholder="Nodey McNodeFace" value="" style="width: 100%" id="nodeName" />
</div>
<div class="input-group" style="margin-top: 38px">
<span>If you want to use a specific Nostr relay, enter it now:</span>
<input type="text" placeholder="wss://relay.lightning.pub" style="width: 100%" id="relayUrl" />
</div>
<div class="input-group" style="margin-top: 20px">
<span>Avatar URL (shown in wallet):</span>
<input type="text" placeholder="https://example.com/avatar.png" style="width: 100%" id="avatarUrl" />
<span>Avatar (shown in wallet):</span>
<div style="display:flex; align-items:center; gap:12px; width:100%;">
<img id="avatarPreview" src="" alt="avatar" style="width:56px;height:56px;border-radius:6px;object-fit:cover;box-shadow:0 0 2px rgba(0,0,0,1);" />
<input type="text" placeholder="" style="flex:1" id="avatarUrl" />
</div>
</div>
<div class="checkbox" style="margin-top: 12px">
<div class="input-group" style="margin-top: 28px">
<span>If you want to use a specific Nostr relay, enter it now:</span>
<div style="display:flex; flex-direction: column; gap:10px; width:100%;">
<input type="text" placeholder="wss://relay.lightning.pub" style="width: 100%" id="relayUrl" />
<div class="checkbox" style="margin-top: 0">
<input type="checkbox" id="customCheckbox" />
<div class="checkbox-shape"></div>
<label for="customCheckbox">
@ -56,6 +58,8 @@
per month to support developers
</label>
</div>
</div>
</div>
<div>
<p id="errorText" style="color:red"></p>

View file

@ -10,6 +10,7 @@ $(() => {
const nodeNameInput = $("#nodeName");
const relayUrlInput = $("#relayUrl");
const avatarUrlInput = $("#avatarUrl");
const avatarPreview = $("#avatarPreview");
const customCheckbox = $("#customCheckbox");
const automateLiquidityRadio = $("#automate");
const manualLiquidityRadio = $("#manual");
@ -130,10 +131,15 @@ $(() => {
} else {
relayUrlInput.val(state.relay_url);
}
const robo = state.app_id ? `https://robohash.org/${encodeURIComponent(state.app_id)}.png?size=256x256&set=set3` : ''
avatarUrlInput.attr('placeholder', robo || 'https://example.com/avatar.png')
const robo = state.app_id ? `https://robohash.org/${encodeURIComponent(state.app_id)}.png?size=128x128&set=set3` : ''
if (state.avatar_url) {
avatarUrlInput.val(state.avatar_url);
avatarPreview.attr('src', state.avatar_url)
} else if (robo) {
avatarPreview.attr('src', robo)
}
if (robo) {
avatarUrlInput.attr('placeholder', robo)
}
syncRelayState();