Lightweight swipe lib

Who can suggest very lightweight swipe lib Or perhaps I can do it by myself?
14 Replies
ἔρως
ἔρως2d ago
define "lightweight" if it is super fast, but takes 300kb, is that lightweight? if it is slow and takes just 5kb, is that lightweight? also, what do you want to do with it? just touch? support for the disgusting horrible unusable drag emulation using the mouse? support for buttons? which features do you need?
Patrik
Patrik2d ago
I don't about the weight, just as small as it could be Just for regular swipe for mobile devices Like what a carousel usually have For swipe images For swipe blocks of text
ἔρως
ἔρως2d ago
and how will you handle non-touch devices? emulating swipe with the mouse is gross, but not emulating it may require work, depending on the library
Patrik
Patrik2d ago
By regular mouse listener Click And for mobile I wanna use both Swipe and click
ἔρως
ἔρως2d ago
so, for a non-touch device, you will show everything?
Eso
Eso2d ago
please just implement yourself if you have time otherwise people usually uses swiper.js generally libs are not "light weight" because they try to target sorts of problem you can discard functionality from swiper lib source code also if you really want
ἔρως
ἔρως2d ago
i was getting there, but first needed to know what he wants there's snippets online that do everything
Patrik
Patrik2d ago
I have section like that
No description
Patrik
Patrik2d ago
I wanna this to be swipable for left and right On the other hand I have click event so use can click for half hidden blocks It's just addition to my interface for touch screens Also like for a regular pop up with image I have arrows and keyboard event But I also want it to be swipable
ἔρως
ἔρως2d ago
what's supposed to happen with the swipe?
Patrik
Patrik2d ago
Switch current object on the top
ἔρως
ἔρως2d ago
https://stackoverflow.com/a/23230280 <-- you can use something like this, for example what this does is to detect when the touch started and record the coordinates, then check where the touch is moving to you can even use the next answer, which is even smaller
Patrik
Patrik18h ago
thanks !
ἔρως
ἔρως18h ago
you're welcome
Want results from more Discord servers?
Add your server