From 6828b394d6be3d847ade027bfa9fb0615252d3d2 Mon Sep 17 00:00:00 2001 From: Nl-T-lN Date: Thu, 23 Oct 2025 22:39:20 +0530 Subject: [PATCH] button control fixed for mobile and touchscreen devicesf --- script.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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(); },