diff --git a/app.js b/app.js index 051fe82..1bf005b 100644 --- a/app.js +++ b/app.js @@ -1,5 +1,27 @@ // ... existing code ... +// === 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 34af931..64d235a 100644 --- a/index.html +++ b/index.html @@ -23,6 +23,9 @@ + diff --git a/style.css b/style.css index a2aab15..71c6feb 100644 --- a/style.css +++ b/style.css @@ -16,3 +16,18 @@ #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; +}