Replies: 2 comments 2 replies
-
Did a little more tinkering around, I guess you could do this as well. It works great! const gesture = new DragGesture(
el,
({ active, delta, movement: [mx, my], offset: [ox, oy], direction: [dx, dy] }) => {
sizeX = el.getBoundingClientRect().width;
coords.set({
+ x: ox * 2,
+ y: oy * 2
});
},
{
axis: 'x',
bounds: {
+ left: (screenSize - sizeX) / 2,
right: 0
},
rubberband: true
}
); |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey, is it possible for you to send a small sandbox? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First off, thanks for the library. I've been making a Row List element with this and so far it's pretty good. Just a little unsatisfying when I scroll really quick and it doesn't move It depends a lot on offset for tracking the current value, bounds for constraints, and rubberband=true for the crisp animation when it approaches bounds.
I'm building it on Svelte.
I've been reading the docs and I couldn't find anything about increasing the offset speed or at least be able to override the offset values with a multiplier. Even if I do add a multiplier on the offset for setting the coordinates, since it's already hugely different from the real offset value, the bounds won't work anymore.
Is there a way to add more Drag Speed (like when scrolling really fast)?
Beta Was this translation helpful? Give feedback.
All reactions