Why wouldn’t this linear ease calculation work?
Closed this issue · 2 comments
brandondurham commented
It works in every other scenario I use it in.
scrollIntoView(el, { ease: (value) => value, time: 15000, align: { top: 1 } }, () => {
console.log('Finished scrolling!');
});
KoryNunn commented
The target scroll position of a scrolling element can change dynamically during an animation, for this reason, the default x => x
ease will be logarithmic, or effectively an ease-out:
https://github.com/KoryNunn/scroll-into-view/blob/master/scrollIntoView.js#L89
You can get a somewhat linear result by passing an exponential function to ease
x => Math.pow(x, ‑3)
might work for you?
KoryNunn commented
Hopefully this helped you! Closing.