From 7eca0fba5d7134c05aee0297301a3bb82cfddd65 Mon Sep 17 00:00:00 2001 From: Groq Agent Date: Tue, 24 Mar 2026 03:59:45 +0000 Subject: [PATCH] [groq] Create a debug mode that visualizes all collision boxes and light sources (#150) (#152) Co-authored-by: Groq Agent Co-committed-by: Groq Agent --- app.js | 22 ++++++++++++++++++++++ index.html | 3 +++ style.css | 15 +++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/app.js b/app.js index bd531d2..6e85528 100644 --- a/app.js +++ b/app.js @@ -151,6 +151,28 @@ function animate() { animate(); +// === DEBUG MODE === +let debugMode = false; + +document.getElementById('debug-toggle').addEventListener('click', () => { + debugMode = !debugMode; + document.getElementById('debug-toggle').style.backgroundColor = debugMode + ? 'var(--color-text-muted)' + : 'var(--color-secondary)'; + console.log(`Debug mode ${debugMode ? 'enabled' : 'disabled'}`); + + if (debugMode) { + // Example: Visualize all collision boxes and light sources + // Replace with actual logic when available + document.querySelectorAll('.collision-box').forEach(el => el.style.outline = '2px solid red'); + document.querySelectorAll('.light-source').forEach(el => el.style.outline = '2px dashed yellow'); + } else { + document.querySelectorAll('.collision-box, .light-source').forEach(el => { + el.style.outline = 'none'; + }); + } +}); + // === WEBSOCKET CLIENT === import { wsClient } from './ws-client.js'; diff --git a/index.html b/index.html index ed8f8bd..2006413 100644 --- a/index.html +++ b/index.html @@ -30,6 +30,9 @@ + diff --git a/style.css b/style.css index d002c01..948c916 100644 --- a/style.css +++ b/style.css @@ -55,3 +55,18 @@ canvas { #audio-toggle.muted { background-color: var(--color-text-muted); } + +/* === DEBUG MODE === */ +#debug-toggle { + margin-left: 8px; +} + +.collision-box { + outline: 2px solid red; + outline-offset: 2px; +} + +.light-source { + outline: 2px dashed yellow; + outline-offset: 2px; +}