tween - Convert CSS cubic bezier easing to Javascript -
tween - Convert CSS cubic bezier easing to Javascript -
i'm looking way generate easing functions tweens, need them in javascript function format, standard t, b, c, d
parameters.
i've found great tool generate css easing: http://cubic-bezier.com/ output useless me.
is there way convert format javascript easing function? are there improve tools straight build javascript easing functions?the desired format like:
function(t, b, c, d){ var ts = (t /= d) * t; var tc = ts * t; homecoming b+c*(4.257575757575761*tc*ts + -7.9545454545454595*ts*ts + 0.6818181818181834*tc + 4.46969696969697*ts + -0.4545454545454546*t); }
there library bezier curve based easing in javascript https://github.com/gre/bezier-easing
you select desired parameters http://cubic-bezier.com , pass them function beziereasing. example:
beziereasing(0.25, 0.1, 0.0, 1.0)
here illustration documentation:
https://jsfiddle.net/0x51ew2l/
javascript tween easing
Comments
Post a Comment