glance icon indicating copy to clipboard operation
glance copied to clipboard

feat: Added simple swipe right/left

Open Nionor opened this issue 9 months ago • 4 comments

#128 Quick and easy solution to add swipe functionality for smartphones to change column. The swipeThreshold maybe should be changeable from some setting but seems to work quite well overall as is.

Nionor avatar Mar 19 '25 09:03 Nionor

I like this. But it has issues with the navigation when you have a bunch of them and the horizontal videos, scrolling through them would also trigger the swipe.

Edit: Here's the additional script I tested that seems to fix the issues mentioned


const excludedClass = [
    'carousel-container',
    'mobile-navigation-page-links',
    // did I miss something?
];
document.addEventListener('touchend', function (event) {
    let targetElement = event.target;
    while (targetElement && targetElement.tagName !== 'IFRAME' && !excludedClass.some(c => targetElement.classList.contains(c))) {
      targetElement = targetElement.parentElement;
    }
    if (targetElement) return;

   // continue

}, false);

ralphocdol avatar Mar 20 '25 13:03 ralphocdol

Ok I added some more checks for when to trigger the left and right swipes, hope that helps. @ralphocdol that seems like a good idea to add too 👍

Nionor avatar Mar 21 '25 07:03 Nionor

This should be merged

Muxutruk2 avatar Apr 04 '25 11:04 Muxutruk2

I'm new-ish to Github, and very new to app building. It's interesting to see what factors go into a feature that seems so easy. I would never have thought that angles and timing would be a part of it.

hchavez8 avatar May 06 '25 23:05 hchavez8

I moved this to a different branch so it got closed, created a new PR #684

Nionor avatar May 21 '25 13:05 Nionor