Skip to content

Commit

Permalink
Reset 30s timer for button event
Browse files Browse the repository at this point in the history
  • Loading branch information
JYNguyen committed Apr 24, 2024
1 parent 1086b0b commit b765460
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ <h2>Timer: <span id="timer">30</span> seconds</h2>
};
socket.send(JSON.stringify(U));
console.log(JSON.stringify(U));

resetTimer();
}

// Timer countdown logic
Expand All @@ -287,6 +289,13 @@ <h2>Timer: <span id="timer">30</span> seconds</h2>
function updateTimerDisplay(time) {
timerElement.textContent = time;
}
function resetTimer() {
clearInterval(timerInterval);
startTimer();
}

// Call startTimer() when the page loads or when a player selects a letter
window.onload = startTimer;



Expand Down

0 comments on commit b765460

Please sign in to comment.