diff --git a/script.js b/script.js index 880c0ef..9dddcd8 100644 --- a/script.js +++ b/script.js @@ -545,9 +545,17 @@ document.addEventListener("keydown", (e) => { window.addEventListener( "touchstart", (e) => { - if (e.target.closest(".twitter-link")){ + if ( + e.target.closest(".twitter-link") || // The Twitter link + e.target.closest("#muteBtn") || // The mute button + e.target.closest("#theme-controls") || // The theme buttons container + e.target.closest("#close-results") + ) { + // If it was, do nothing and let the browser handle the 'click' event return; } + + // Otherwise, it's a tap for the game e.preventDefault(); gameEnded ? startGame() : eventHandler(); },