feat: Added simple swipe right/left
#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.
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);
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 👍
This should be merged
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.
I moved this to a different branch so it got closed, created a new PR #684