jkorstad commited on
Commit
3ea1d17
·
verified ·
1 Parent(s): 6c01cd4

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +23 -8
index.html CHANGED
@@ -160,14 +160,7 @@
160
  <label for="seconds-input">Seconds:</label>
161
  <input type="number" id="seconds-input" value="0" min="0">
162
  </div>
163
-
164
- <button id="start-timer">Start Timer</button>
165
- <button id="pause">Pause</button>
166
- <button id="reset">Reset</button>
167
- <button id="start-stopwatch">Start Stopwatch</button>
168
- </div>
169
-
170
- <div>
171
  <label for="active-dot-color">Active Dot Color:</label>
172
  <input type="color" id="active-dot-color" value="#f39c12">
173
  </div>
@@ -175,6 +168,12 @@
175
  <label for="inactive-dot-color">Inactive Dot Color:</label>
176
  <input type="color" id="inactive-dot-color" value="#555555">
177
  </div>
 
 
 
 
 
 
178
 
179
  <div class="timer-display" id="timer-display">00:00:00</div>
180
 
@@ -335,6 +334,22 @@ function updateGridRow(rows, previous, current, max) {
335
  updateDotColors();
336
  //ADDED STOP
337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
  // Make sure the start function doesn't reset totalSeconds when resuming
339
  function start() {
340
  if (!isRunning) {
 
160
  <label for="seconds-input">Seconds:</label>
161
  <input type="number" id="seconds-input" value="0" min="0">
162
  </div>
163
+ <div>
 
 
 
 
 
 
 
164
  <label for="active-dot-color">Active Dot Color:</label>
165
  <input type="color" id="active-dot-color" value="#f39c12">
166
  </div>
 
168
  <label for="inactive-dot-color">Inactive Dot Color:</label>
169
  <input type="color" id="inactive-dot-color" value="#555555">
170
  </div>
171
+
172
+ <button id="start-timer">Start Timer</button>
173
+ <button id="pause">Pause</button>
174
+ <button id="reset">Reset</button>
175
+ <button id="start-stopwatch">Start Stopwatch</button>
176
+ </div>
177
 
178
  <div class="timer-display" id="timer-display">00:00:00</div>
179
 
 
334
  updateDotColors();
335
  //ADDED STOP
336
 
337
+ //NEW ADDED - Keyboard Functionality
338
+ // Function to handle key press events
339
+ function handleKeyPress(event) {
340
+ // Check if the pressed key corresponds to any action
341
+ if (event.key in keyActions) {
342
+ keyActions[event.key]();
343
+ event.preventDefault(); // Prevent the default action of the key if necessary
344
+ }
345
+ }
346
+
347
+ // Add event listener for keydown events
348
+ document.addEventListener('keydown', handleKeyPress);
349
+
350
+
351
+ //NEW ADDED STOP
352
+
353
  // Make sure the start function doesn't reset totalSeconds when resuming
354
  function start() {
355
  if (!isRunning) {