}
allParticleKeyframes[index].push(generateKeyframe(t, x, y));
}
-
- return keyframes;
}
function generateKeyframe(t, x, y) {
domNode.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)];
function start() {
- var player = domNode.animate(allParticleKeyframes[index], {easing: "linear", iterations: Infinity, direction: "alternate", duration: animationDuration});
+ var player = domNode.animate(allParticleKeyframes[index], {easing: "linear", iterations: Infinity, direction: "alternate", duration: animationDuration * 1000});
player.pause();
this.player = player;
}
if (start == null)
start = timestamp;
for (var x in particles) {
- particles[x].player.currentTime = (timestamp - start) / 1000;
+ particles[x].player.currentTime = timestamp - start;
}
if (particles.length !== 0)
requestAnimationFrame(advance);