From 427a84d8234cca80f742400ecdc9317d6c89a669 Mon Sep 17 00:00:00 2001 From: cybrneko Date: Sat, 10 May 2025 22:29:01 -0500 Subject: [PATCH] attempt #2 --- searx/static/themes/simple/js/oneko.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/searx/static/themes/simple/js/oneko.js b/searx/static/themes/simple/js/oneko.js index 6c3754e6e..60f69d4df 100644 --- a/searx/static/themes/simple/js/oneko.js +++ b/searx/static/themes/simple/js/oneko.js @@ -105,18 +105,18 @@ document.body.appendChild(nekoEl); - // Attach event listeners for both desktop and mobile + // Desktop: Track mouse movement document.addEventListener('mousemove', function (event) { mousePosX = event.clientX; mousePosY = event.clientY; }); + // Mobile: Track touch movement (including during scrolling) document.addEventListener('touchmove', function (event) { - // Use the first touch point (primary touch) - const touch = event.touches[0]; + const touch = event.touches[0]; // Use the first touch point mousePosX = touch.clientX; mousePosY = touch.clientY; - }, { passive: false }); // Allow preventing default if needed + }, { passive: true }); window.requestAnimationFrame(onAnimationFrame); }