xiel / embla-carousel-wheel-gestures

wheel interactions for Embla Carousel
https://embla-carousel-wheel-gestures.xiel.dev/react.html
MIT License
57 stars 9 forks source link

Scrolling Intensity #141

Closed jonrrivera closed 2 years ago

jonrrivera commented 3 years ago

hey! Thanks so much for this awesome plug-in! you are really making lives easier

I was wondering if there is a way to make the scrolling at the beginning and end of the slider less harsh. You could see this behavior in your example.

I tried using inViewThreshold, and containScroll from Emba, but no luck. Here's the example I'm working on so can have a better idea of the smoother expected behavior.

Would you have any suggestions? I'm happy to help.

Thank you!

xiel commented 3 years ago

Hi @jonrrivera

the movement is depending on the mouse/trackpad hardware and OS you use, so it feels a bit different everywhere.

This lib does not implement any custom out-of-bounds snapping, but it uses the same as embla when dragging using the mouse. I dont think there a a way to customize the hardness, as it seems to be one of two constants: https://github.com/davidcetinkaya/embla-carousel/blob/master/packages/embla-carousel/src/components/ScrollBounds.ts#L28

Have you tried using native scroll snaps insread? This might be more suitable for your use case. https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-snap-type

Cheers, Felix

songkeys commented 2 years ago

Have you tried using native scroll snaps insread?

I can get it working while use it alone, but not sure how to use it with the embla carousel, do you have any advice? thank you!

xiel commented 2 years ago

@Songkeys They are not meant to be combined. But for full page scroller scroll snaps are likely the better option imho.