Sa-m commited on
Commit
985683f
·
verified ·
1 Parent(s): 45eaa08

Update assets/js/script.js

Browse files
Files changed (1) hide show
  1. assets/js/script.js +19 -6
assets/js/script.js CHANGED
@@ -81,6 +81,15 @@ class DebugManager {
81
  this.cameraStatusEl = document.getElementById('debugCameraStatus');
82
  this.lastErrorEl = document.getElementById('debugLastError');
83
  this.statusIndicator = document.getElementById('statusIndicator');
 
 
 
 
 
 
 
 
 
84
  }
85
 
86
  updateStatus(status) {
@@ -129,6 +138,16 @@ class DebugManager {
129
  this.updateStatus('Processing...');
130
  this.statusIndicator.className = 'status-indicator processing';
131
  }
 
 
 
 
 
 
 
 
 
 
132
  }
133
 
134
  // ----------------------------
@@ -594,12 +613,6 @@ document.addEventListener('DOMContentLoaded', () => {
594
  const uiManager = new UIManager();
595
  debugManager.setReady();
596
 
597
- // Check if MediaPipe is loaded
598
- if (typeof Hands === 'undefined') {
599
- debugManager.logError(new Error("MediaPipe Hands not loaded. Check your internet connection."));
600
- return;
601
- }
602
-
603
  // Request camera access
604
  const videoElement = document.getElementById('webcam');
605
 
 
81
  this.cameraStatusEl = document.getElementById('debugCameraStatus');
82
  this.lastErrorEl = document.getElementById('debugLastError');
83
  this.statusIndicator = document.getElementById('statusIndicator');
84
+
85
+ // Get debug toggle button
86
+ this.toggleButton = document.getElementById('debugToggle');
87
+ this.debugPanel = document.getElementById('debugPanel');
88
+
89
+ // Add click event listener
90
+ this.toggleButton.addEventListener('click', () => {
91
+ this.toggleDebugPanel();
92
+ });
93
  }
94
 
95
  updateStatus(status) {
 
138
  this.updateStatus('Processing...');
139
  this.statusIndicator.className = 'status-indicator processing';
140
  }
141
+
142
+ toggleDebugPanel() {
143
+ if (this.debugPanel.classList.contains('visible')) {
144
+ this.debugPanel.classList.remove('visible');
145
+ this.toggleButton.innerHTML = '⚙️';
146
+ } else {
147
+ this.debugPanel.classList.add('visible');
148
+ this.toggleButton.innerHTML = '⚙️';
149
+ }
150
+ }
151
  }
152
 
153
  // ----------------------------
 
613
  const uiManager = new UIManager();
614
  debugManager.setReady();
615
 
 
 
 
 
 
 
616
  // Request camera access
617
  const videoElement = document.getElementById('webcam');
618