Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(play): hold the photo button busy while the capture actually runs
nirholas9647898afc0b
diff --git a/src/game/coincommunities-ui.js b/src/game/coincommunities-ui.jsindex cebbc9a66..cb121e2cb 100644--- a/src/game/coincommunities-ui.js+++ b/src/game/coincommunities-ui.js@@ -2850,6 +2850,18 @@ export class CommunityUI {this.photoBtn?.setAttribute('aria-pressed', on ? 'true' : 'false');}+ // The capture itself is work: one extra render, a full pixel readback and a+ // PNG encode. On a GPU that is a blink, but on a software rasterizer or a+ // tired phone it can run for seconds, and a shutter flash followed by a long+ // nothing reads as a dead button (measured at 59s on a loaded software-GL+ // box). Mark the control busy for the duration so the press is visibly+ // acknowledged and assistive tech hears it too.+ setPhotoBusy(on) {+ if (!this.photoBtn) return;+ if (on) this.photoBtn.setAttribute('aria-busy', 'true');+ else this.photoBtn.removeAttribute('aria-busy');+ }+// Toggle the button's armed state (lit = will dance on next beat).setDancing(on) {if (!this.danceBtn) return;diff --git a/src/game/coincommunities.css b/src/game/coincommunities.cssindex 699791142..a1261dcf8 100644--- a/src/game/coincommunities.css+++ b/src/game/coincommunities.css@@ -1184,6 +1184,22 @@ html[data-bg="transparent"] #cc-lobby {.cc-photo-hud-btn:active { background: rgba(255, 255, 255, 0.12); }.cc-photo-hud-btn:focus-visible { outline: none; border-color: var(--cc-edge-hi); box-shadow: 0 0 0 1px var(--cc-edge-hi); }.cc-photo-hud-btn[aria-pressed="true"] { color: var(--cc-text); border-color: var(--cc-edge-hi); }+/* Working: the extra render, the pixel readback and the PNG encode are quick on+ a GPU and can run for seconds on a software rasterizer or a tired phone. The+ button breathes for exactly as long as the capture takes, so a slow press is+ visibly acknowledged instead of reading as a dead control. */+.cc-photo-hud-btn[aria-busy="true"] {+ color: var(--cc-text); border-color: var(--cc-edge-hi); cursor: progress;+ animation: cc-photo-working 1.1s ease-in-out infinite;+}+.cc-photo-hud-btn[aria-busy="true"] .cc-photo-hud-ico svg { opacity: 0.55; }+@keyframes cc-photo-working {+ 0%, 100% { background: var(--cc-panel); }+ 50% { background: rgba(255, 255, 255, 0.12); }+}+@media (prefers-reduced-motion: reduce) {+ .cc-photo-hud-btn[aria-busy="true"] { animation: none; background: rgba(255, 255, 255, 0.12); }+}.cc-photo-hud-ico { display: inline-flex; }.cc-photo-hud-ico svg { width: 16px; height: 16px; display: block; }.cc-photo-hud-label { line-height: 1; }diff --git a/src/game/coincommunities.js b/src/game/coincommunities.jsindex 986e1e8e4..059cdb637 100644--- a/src/game/coincommunities.js+++ b/src/game/coincommunities.js@@ -4664,6 +4664,10 @@ export class CoinCommunities {async _openPhotoMode() {if (this.phase !== 'world' || this._photoLoading) return;this._photoLoading = true;+ // The chunk fetch and the capture both take real time on a slow device, and+ // the shutter flash is over in a quarter second. Hold the button in a busy+ // state across the whole press so it never looks like nothing happened.+ this.ui.setPhotoBusy(true);try {const { takePhoto } = await import('./photo-mode.js');const shown = await takePhoto({@@ -4681,6 +4685,7 @@ export class CoinCommunities {this.ui.toast('Photo mode couldn’t load, check your connection and try again.', 'warn');} finally {this._photoLoading = false;+ this.ui.setPhotoBusy(false);}}