Lightweight swipe lib

Who can suggest very lightweight swipe lib Or perhaps I can do it by myself?
14 Replies
ἔρως
ἔρως3mo 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
PatrikOP3mo 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
ἔρως
ἔρως3mo 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
PatrikOP3mo ago
By regular mouse listener Click And for mobile I wanna use both Swipe and click
ἔρως
ἔρως3mo ago
so, for a non-touch device, you will show everything?
Eso
Eso3mo 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
ἔρως
ἔρως3mo ago
i was getting there, but first needed to know what he wants there's snippets online that do everything
Patrik
PatrikOP3mo ago
I have section like that
No description
Patrik
PatrikOP3mo 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
ἔρως
ἔρως3mo ago
what's supposed to happen with the swipe?
Patrik
PatrikOP3mo ago
Switch current object on the top
ἔρως
ἔρως3mo 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
PatrikOP3mo ago
thanks !
ἔρως
ἔρως3mo ago
you're welcome
Want results from more Discord servers?
Add your server