Would it be possible to acquire a library for this task, or does anyone have any suggestions for my psuedocode API?
Inquiry:
How can I create a function that accepts 4 parameters
interpolate(start, end, time, ease)
and smoothly transition between the start and end numbers over a specified period of time with easing?
Challenge:
I find this particularly difficult because I am uncertain about managing time and easing within a requestAnimationFrame loop. Additionally, I am unsure how to implement the bezier curve handler and optimize the code if necessary.
interpolate(start:number, end:number, time:number, ease) {
// code for easing
return value;
}
function _draw() {
currentValue = interpolate(0, 10, 0.7, 'cubic-bezier(.62,.28,.23,.99)');
if(currentValue !== lastValue) {
console.log(currentValue)
}
requestAnimationFrame(_draw);
}
Eventually, the final tick of the transition process should log out a value of 10 as the currentValue.