fix: fight restart bug, mobile TTS, character sizing, bitcoin symbols

- Fix fight replay showing empty scene: validate rounds before playing,
  retry loading fight data up to 5 times when rounds are missing
- Add COOP/COEP headers to production server for SharedArrayBuffer
  (required by Kokoro TTS WASM threading on mobile)
- Add blob: to scriptSrc/workerSrc CSP for Web Worker support
- Fix mobile character cutoff: raise ground line to 0.82, add
  MOBILE_SCALE_CAP (0.55) so fighters never shrink too small
- Add ₿ bitcoin chest badge to all fighter sprites (scales with tier)
- Add sats coin stack on bot profile page proportional to satsWon
- Seed dev tournament with 8 mock bots on startup (dev mode only)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-09 08:21:16 +00:00
co-authored by Claude Opus 4.6
parent a10c1c9cb6
commit 5ee6b6c88c
10 changed files with 141 additions and 16 deletions
+21 -4
View File
@@ -379,18 +379,26 @@ const tierClass = (t: number) => `tier-${t}`
<div class="border border-border bg-surface-raised/30 p-6 overflow-hidden"
:class="{ 'border-t-0': nostrProfile?.banner }">
<!-- Human player: just the human avatar, centered -->
<div v-if="stats.archetype === 'human'" class="flex justify-center mb-4">
<div v-if="stats.archetype === 'human'" class="flex justify-center mb-4 relative">
<HumanPreview
:seed="stats.avatarSeed || stats.name"
archetype="human"
:size="200"
:win-rate="(stats.winRate || 0) / 100"
anim="idle"
class="drop-shadow-[0_0_20px_rgba(0,255,255,0.3)]"
class="drop-shadow-[0_0_20px_rgba(0,255,255,0.3)] relative z-10"
/>
<div v-if="stats.satsWon > 0"
class="absolute bottom-0 right-4 flex flex-col-reverse items-center z-0 opacity-80">
<div v-for="i in Math.min(Math.ceil(stats.satsWon / 100), 10)" :key="i"
class="w-6 h-2 rounded-sm border border-yellow-600/50"
:class="i <= 3 ? 'bg-amber-700' : i <= 6 ? 'bg-amber-600' : 'bg-amber-500'"
:style="{ marginTop: i > 1 ? '-1px' : '0' }" />
<span class="font-pixel text-[7px] text-amber-400 mt-0.5">{{ stats.satsWon }}</span>
</div>
</div>
<!-- Bot player: human controller + bot sprite -->
<div v-else class="flex items-end justify-center gap-2 mb-4">
<div v-else class="flex items-end justify-center gap-2 mb-4 relative">
<HumanPreview
:seed="stats.avatarSeed || stats.name"
:archetype="stats.archetype || 'standard'"
@@ -405,9 +413,18 @@ const tierClass = (t: number) => `tier-${t}`
:tier="stats.tier"
:size="140"
:customization="stats.customization || undefined"
class="drop-shadow-[0_0_20px_var(--glow)]"
class="drop-shadow-[0_0_20px_var(--glow)] relative z-10"
:style="{ '--glow': stats.tierColor + '80' } as any"
/>
<!-- Sats coin stack behind character -->
<div v-if="stats.satsWon > 0"
class="absolute bottom-0 right-2 flex flex-col-reverse items-center z-0 opacity-80">
<div v-for="i in Math.min(Math.ceil(stats.satsWon / 100), 10)" :key="i"
class="w-6 h-2 rounded-sm border border-yellow-600/50"
:class="i <= 3 ? 'bg-amber-700' : i <= 6 ? 'bg-amber-600' : 'bg-amber-500'"
:style="{ marginTop: i > 1 ? '-1px' : '0' }" />
<span class="font-pixel text-[7px] text-amber-400 mt-0.5">{{ stats.satsWon }}</span>
</div>
</div>
<!-- Name & tier -->
+6 -1
View File
@@ -357,7 +357,12 @@ async function handleFightEnd(data: any) {
if (liveScene) { liveScene.destroy(); liveScene = null }
liveSceneReady.value = false
await loadFight()
// Retry loading until rounds are populated (server may still be persisting)
for (let attempt = 0; attempt < 5; attempt++) {
await loadFight()
if (fight.value?.rounds?.length) break
await new Promise(r => setTimeout(r, 800))
}
isLive.value = false
disconnectSSE()
stopHumanPolling()