From d691680682f518a575d6d2ff5c31576787c7e38d Mon Sep 17 00:00:00 2001 From: x Date: Sat, 24 Jan 2026 09:04:02 +0100 Subject: [PATCH] removing mobile swipe funcktionality --- public/s/js/f0ck.js | 63 --------------------------------------------- 1 file changed, 63 deletions(-) diff --git a/public/s/js/f0ck.js b/public/s/js/f0ck.js index 42c9157..ecb2402 100644 --- a/public/s/js/f0ck.js +++ b/public/s/js/f0ck.js @@ -691,70 +691,7 @@ window.requestAnimFrame = (function () { } // - // - const swipeRT = { - xDown: null, - yDown: null, - xDiff: null, - yDiff: null, - timeDown: null, - startEl: null - }; - const swipeOpt = { - treshold: 20, // 20px - timeout: 500 // 500ms - }; - document.addEventListener('touchstart', e => { - swipeRT.startEl = e.target; - swipeRT.timeDown = Date.now(); - swipeRT.xDown = e.touches[0].clientX; - swipeRT.yDown = e.touches[0].clientY; - swipeRT.xDiff = 0; - swipeRT.yDiff = 0; - }, false); - - document.addEventListener('touchmove', e => { - if (!swipeRT.xDown || !swipeRT.yDown) - return; - swipeRT.xDiff = swipeRT.xDown - e.touches[0].clientX; - swipeRT.yDiff = swipeRT.yDown - e.touches[0].clientY; - }, false); - - document.addEventListener('touchend', e => { - if (swipeRT.startEl !== e.target) - return; - - const timeDiff = Date.now() - swipeRT.timeDown; - let elem; - - if (Math.abs(swipeRT.xDiff) > Math.abs(swipeRT.yDiff)) { - if (Math.abs(swipeRT.xDiff) > swipeOpt.treshold && timeDiff < swipeOpt.timeout) { - if (swipeRT.xDiff > 0) // left - elem = document.querySelector(".pagination > .next:not(.disabled)"); - else // right - elem = document.querySelector(".pagination > .prev:not(.disabled)"); - } - } - else { - if (Math.abs(swipeRT.yDiff) > swipeOpt.treshold && timeDiff < swipeOpt.timeout) { - if (navbar = document.querySelector("nav.navbar") && document.querySelector("div.posts")) { - if (swipeRT.yDiff > 0 && (window.innerHeight + window.scrollY) >= document.body.offsetHeight) // up - elem = document.querySelector(".pagination > .next:not(.disabled)"); - else if (swipeRT.yDiff <= 0 && window.scrollY <= 0 && document.querySelector("div.posts")) // down - elem = document.querySelector(".pagination > .prev:not(.disabled)"); - } - } - } - - swipeRT.xDown = null; - swipeRT.yDown = null; - swipeRT.timeDown = null; - - if (elem) - changePage(elem); - }, false); - // // if (audioElement = document.querySelector("audio")) {