Added a countdown timer

This commit is contained in:
Leon Mika 2026-01-16 22:12:30 +11:00
parent 70a782d0e4
commit 89a6b4d062
6 changed files with 115 additions and 16 deletions

View file

@ -70,16 +70,15 @@ export class GameController extends Controller {
this.problemTarget.appendChild(div);
}
this.answerTarget.disabled = false;
this.answerTarget.value = "";
this.answerTarget.focus();
window.setTimeout(() => {
this.answerTarget.focus();
}, 1);
}
_checkAnswer() {
let isRight = parseInt(this.answerTarget.value) === this._answer;
this.answerTarget.disabled = true;
let delay = 500;
if (isRight) {