3 ms·
How are they tricky to implement from scratch :/ The animation effects you talk about are pretty simple mathematics. eg function timerMethod() { currentFr
by axod 18y ago
How are they tricky to implement from scratch :/ The animation effects you talk about are pretty simple mathematics.
eg
function timerMethod() {
currentFrame = (currentTime - startTime) * numFrames / animationDuration;
}
And to do 'easing' as you call it, you could just use sin/cos, or a small lookup table.
The main reason to duplicate effort is to firstly learn how these things work, and secondly to get a better solution matched more optimally to your use case.
I personally like the DOM... theNode.parentNode.removeChild(theNode) makes quite a lot of sense. But it's probably a matter of taste that one.