From 41c3ac5652e66343bfba94ccf7b5a12ec5449e5a Mon Sep 17 00:00:00 2001 From: Florian Schmid Date: Wed, 26 Apr 2023 23:56:23 +0200 Subject: [PATCH] add switch --- newMode.html | 2 +- src/newMode.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/newMode.html b/newMode.html index ad53aec..6b8c8f3 100644 --- a/newMode.html +++ b/newMode.html @@ -48,7 +48,7 @@ Highscore: 0

- +
diff --git a/src/newMode.ts b/src/newMode.ts index 4aaffde..3a82da2 100644 --- a/src/newMode.ts +++ b/src/newMode.ts @@ -21,6 +21,8 @@ class UI { this.score = document.getElementById("score"); this.highScore = document.getElementById("highScore"); + + document.getElementById("modeSwitch").addEventListener("change", (e:Event) => {this.switchMode(); this.nextRound()}); } async init() { @@ -37,6 +39,10 @@ class UI { ) } + switchMode() { + this.model.switchMode(); + } + async buttonClick(btn: HTMLElement) { btn.setAttribute("disabled", ""); let result = this.model.processClick(btn.innerText);