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);