Comment

Comment by jprete

I think the real problem with the OP's straw-proposal interpolation method is that it's stateless and doesn't need to be. I would instead record the start position, then interpolate along a function F(t) to the end position. F(0)=0, F(1)=1, F'(0)=F'(1)=0 just so the ends aren't jerky. The curve can even overshoot 1 to give the animation some bounce.

I'm sure somewhere on the Internet somebody's written down some good choices of curve; hopefully someone else knows what to search for.

(I don't know what to do if another change interrupts the first but it's a rare case and can probably be handled imperfectly.)

parent jprete 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton