Description
Checks
- Not a duplicate.
- Not a question, feature request, or anything other than a bug report directly related to Splide. Use Discussions for these topics: https://github.com/Splidejs/splide/discussions
Version
0.5.3
Description
Currently the speed of the auto-scroll extension is specified in pixel/frame units. Unfortunately, because different devices can operate at different framerates, this can result in the slider moving at different speeds on different devices.
For example, take the demo on the Splide web site at https://splidejs.com/extensions/auto-scroll/#speed. That displays at one speed on my desktop PC (which is 60fps) and a different speed on my Google Pixel 6 (which is 90fps, but can dynamically drop lower to save battery). It does appear that it's about 50% faster on my phone than on my PC. I can send you a video if you like.
I spent many hours yesterday trying to solve this by monitoring the current framerate with fps-observer and changing the Autoscroll speed option on the fly. Unfortunately the results were not very good.
So, now I am looking at modifying the autoscroll extension in some way, to stabilize the speed across devices with different framerates. I don't have any complete solutions in mind but I have some ideas. (calculating fps by measuring the time between RequestAnimationFrame calls, averaging that over time, then using that average value to modulate the speed of the slider so it matches the speed set in the main Splide config.)
First, though, I wanted to check in with you. Does my explanation make sense? Do you think this is worth solving? Do you have any preferred/suggested way of solving it? I can fumble my way through it and submit a PR, but if you have some more elegant way of approaching it, then I would love to hear your thoughts.
Thanks!
Reproduction Link
No response
Steps to Reproduce
- View the autoscroll demo at https://splidejs.com/extensions/auto-scroll/#speed on a device that is 60fps
- View the autoscroll demo at https://splidejs.com/extensions/auto-scroll/#speed on a device that is 90fps
- Note that the two sliders are moving at different speeds.
Expected Behaviour
I expect to see the two sliders moving at the same speed. It is, I believe, reasonable for a designer to want the user experience to have that level of consistency across multiple devices.