Skip to content

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.

feat: zen mode for the walk scene — hide all UI, keep scene + joystick

nirholas801d240ad8e4
diff --git a/pages/walk.html b/pages/walk.html
index 416501dc3..f91078bf2 100644
--- a/pages/walk.html
+++ b/pages/walk.html
@@ -868,6 +868,60 @@
.walk-actions .walk-btn { padding: 6px 10px; font-size: 12px; }
.walk-actions { gap: 5px; }
}
+
+ /* ── Zen mode (hide all UI) ─────────────────────────────────────
+ Strips every overlay — controls, animated cards, chat — so the
+ scene is just the 3D background and the movement joystick. A
+ single subtle pill remains to restore the chrome. The joystick
+ stays interactive; keyboard/touch movement is unaffected. */
+ body.is-zen .walk-site-header,
+ body.is-zen #walk-hud,
+ body.is-zen #walk-help,
+ body.is-zen #walk-status,
+ body.is-zen #walk-chat,
+ body.is-zen #walk-emote-tray,
+ body.is-zen #walk-players-panel,
+ body.is-zen #walk-avatar-picker,
+ body.is-zen #walk-ar-cta,
+ body.is-zen #walk-record-status,
+ body.is-zen #walk-help-overlay,
+ body.is-zen #walk-gesture-palette,
+ body.is-zen #walk-env-indicator,
+ body.is-zen #walk-camera-mode,
+ body.is-zen #walk-minimap,
+ body.is-zen .walk-remote-label,
+ body.is-zen .walk-remote-bubble,
+ body.is-zen .walk-speech-bubble {
+ display: none !important;
+ }
+
+ #walk-zen-exit {
+ position: fixed;
+ z-index: 11;
+ top: calc(env(safe-area-inset-top, 0) + 14px);
+ right: 16px;
+ display: none;
+ align-items: center;
+ gap: 7px;
+ appearance: none;
+ border: 1px solid var(--border);
+ background: rgba(10, 10, 10, 0.5);
+ color: var(--text-2);
+ font: inherit;
+ font-size: 12px;
+ font-weight: 500;
+ padding: 7px 12px;
+ border-radius: 999px;
+ cursor: pointer;
+ backdrop-filter: blur(10px);
+ -webkit-backdrop-filter: blur(10px);
+ opacity: 0;
+ transition: opacity 0.3s ease, color 0.15s ease, background 0.15s ease;
+ }
+ body.is-zen #walk-zen-exit { display: inline-flex; }
+ body.is-zen.zen-revealed #walk-zen-exit { opacity: 0.85; }
+ #walk-zen-exit:hover { color: var(--text); background: rgba(34, 34, 34, 0.7); }
+ #walk-zen-exit svg { display: block; }
</style>
<link rel="stylesheet" href="/nav.css" />
</head>
@@ -939,12 +993,22 @@
<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="1" y="1" width="14" height="14" rx="2"/><circle cx="8" cy="8" r="2"/><path d="M8 1v3M8 12v3M1 8h3M12 8h3"/></svg>
<span data-label>Map</span>
</button>
+ <button type="button" class="walk-btn" id="walk-zen-btn" title="Hide all controls — just the scene and joystick (Z)">
+ <svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 8S3.8 3.5 8 3.5 14.5 8 14.5 8 12.2 12.5 8 12.5 1.5 8 1.5 8z"/><circle cx="8" cy="8" r="2"/><path d="M2 14L14 2"/></svg>
+ <span data-label>Hide UI</span>
+ </button>
<button type="button" class="walk-btn" id="walk-help-toggle" title="Show controls (H)">
<span>?</span>
</button>
</div>
</div>
+ <!-- Restore-chrome pill (only shown in zen mode) -->
+ <button type="button" id="walk-zen-exit" title="Show controls (Z)" aria-label="Show controls">
+ <svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 8S3.8 3.5 8 3.5 14.5 8 14.5 8 12.2 12.5 8 12.5 1.5 8 1.5 8z"/><circle cx="8" cy="8" r="2"/></svg>
+ <span>Show UI</span>
+ </button>
+
<!-- Avatar picker panel -->
<div id="walk-avatar-picker" class="walk-avatar-picker" hidden>
<div class="walk-avatar-picker-header">
@@ -1002,6 +1066,7 @@
<span class="walk-key"><kbd>G</kbd> gestures</span>
<span class="walk-key"><kbd>V</kbd> scene</span>
<span class="walk-key"><kbd>M</kbd> map</span>
+ <span class="walk-key"><kbd>Z</kbd> hide UI</span>
<span class="walk-key"><kbd>H</kbd> help</span>
</div>
diff --git a/src/walk.js b/src/walk.js
index c9e8c074d..2b38c00cd 100644
--- a/src/walk.js
+++ b/src/walk.js
@@ -107,6 +107,8 @@ const playersPanelEl = document.getElementById('walk-players-panel');
const playersListEl = document.getElementById('walk-players-list');
const playersCloseBtn = document.getElementById('walk-players-close');
const helpToggleBtn = document.getElementById('walk-help-toggle');
+const zenBtn = document.getElementById('walk-zen-btn');
+const zenExitBtn = document.getElementById('walk-zen-exit');
const emoteTrayEl = document.getElementById('walk-emote-tray');
const cameraModeBtn = document.getElementById('walk-camera-mode-btn');
const envBtn = document.getElementById('walk-env-btn');
@@ -173,6 +175,32 @@ if (helpToggleBtn) {
});
}
+// ── Zen mode (hide all UI) ───────────────────────────────────────────────
+// Strips every overlay so the scene is just the 3D background and the
+// movement joystick. Preference persists across sessions and can be set
+// from a shared link with ?ui=hidden.
+const ZEN_STORAGE_KEY = 'walk:zen';
+let zenActive = false;
+function setZen(on) {
+ zenActive = on;
+ document.body.classList.toggle('is-zen', on);
+ if (on) {
+ // Defer the reveal class one frame so the restore pill fades in.
+ requestAnimationFrame(() => document.body.classList.add('zen-revealed'));
+ // Close any open panels so they don't pop back when chrome returns.
+ // DOM-based checks keep this safe to call during module init.
+ if (playersPanelEl && !playersPanelEl.hidden) togglePlayersPanel();
+ if (gesturePaletteVisible) hideGesturePalette();
+ } else {
+ document.body.classList.remove('zen-revealed');
+ }
+ if (zenBtn) zenBtn.setAttribute('aria-pressed', String(on));
+ try { localStorage.setItem(ZEN_STORAGE_KEY, on ? '1' : '0'); } catch {}
+}
+function toggleZen() { setZen(!zenActive); }
+if (zenBtn) zenBtn.addEventListener('click', toggleZen);
+if (zenExitBtn) zenExitBtn.addEventListener('click', () => setZen(false));
+
// ── HUD button handlers for new features ─────────────────────────────────
if (cameraModeBtn) cameraModeBtn.addEventListener('click', () => cycleCameraMode());
if (envBtn) envBtn.addEventListener('click', () => cycleEnvironment());
@@ -568,6 +596,7 @@ const helpOverlay = (() => {
<tr><td style="color:#aaa;padding-right:16px">P</td><td>Screenshot</td></tr>
<tr><td style="color:#aaa;padding-right:16px">R</td><td>Toggle GIF recording</td></tr>
<tr><td style="color:#aaa;padding-right:16px">M</td><td>Toggle minimap</td></tr>
+ <tr><td style="color:#aaa;padding-right:16px">Z</td><td>Hide UI (scene + joystick only)</td></tr>
<tr><td style="color:#aaa;padding-right:16px">H / ?</td><td>Toggle this overlay</td></tr>
<tr><td style="color:#aaa;padding-right:16px">Mouse drag</td><td>Orbit camera</td></tr>
<tr><td style="color:#aaa;padding-right:16px">Scroll wheel</td><td>Zoom in / out</td></tr>
@@ -610,6 +639,7 @@ window.addEventListener('keydown', (e) => {
case 'KeyP': e.preventDefault(); takeScreenshot(); break;
case 'KeyR': e.preventDefault(); toggleGifRecording(); break;
case 'KeyM': e.preventDefault(); toggleMinimap(); break;
+ case 'KeyZ': e.preventDefault(); toggleZen(); break;
case 'KeyH': e.preventDefault(); toggleHelp(); break;
case 'Slash':
if (e.shiftKey) { e.preventDefault(); toggleHelp(); }
@@ -617,6 +647,7 @@ window.addEventListener('keydown', (e) => {
case 'Escape':
if (helpVisible) { toggleHelp(); break; }
if (gesturePaletteVisible) { hideGesturePalette(); break; }
+ if (zenActive) { setZen(false); break; }
break;
// Number keys 1-9 for quick gestures
case 'Digit1': e.preventDefault(); triggerQuickGesture(0); break;
@@ -2605,3 +2636,12 @@ loadAvatar()
window._walkChat = { addChatMessage };
}
+
+// ── Restore zen preference ───────────────────────────────────────────────
+// Runs after all UI state is declared. URL param wins, then stored choice.
+(() => {
+ const param = new URLSearchParams(location.search).get('ui');
+ if (param === 'hidden' || param === 'off') { setZen(true); return; }
+ if (param === 'on' || param === 'shown') return;
+ try { if (localStorage.getItem(ZEN_STORAGE_KEY) === '1') setZen(true); } catch {}
+})();