From d4821fb9be6d06a3b54a5b7174f71998c473531c Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Mon, 3 Mar 2025 11:44:58 +0100 Subject: Remove play button, play immediately --- index.html | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 4cd6576..9433a8d 100644 --- a/index.html +++ b/index.html @@ -96,7 +96,6 @@
Score: 0 / 0
-
@@ -112,8 +111,8 @@
@@ -165,15 +164,11 @@ document.getElementById('option3'), document.getElementById('option4') ]; - const playButton = document.getElementById('playButton'); const feedbackElement = document.getElementById('feedback'); const scoreElement = document.getElementById('score'); const totalElement = document.getElementById('total'); const wpmSelect = document.getElementById('wpmSelect'); - // Add event listeners - playButton.addEventListener('click', playMorse); - optionButtons.forEach(button => { button.addEventListener('click', function () { checkAnswer(button.textContent); @@ -215,6 +210,9 @@ for (let i = 0; i < 4; i++) { optionButtons[i].textContent = options[i]; } + + // immediately play sound + playMorse(); } // Play the morse code -- cgit v1.3.1