Skip to content

Instantly share code, notes, and snippets.

@jeremyckahn
Last active December 17, 2015 12:08
Show Gist options
  • Select an option

  • Save jeremyckahn/5607057 to your computer and use it in GitHub Desktop.

Select an option

Save jeremyckahn/5607057 to your computer and use it in GitHub Desktop.
Fun code snippet for http://rekapi.com/sandbox.html
function randomColor() {
return 'rgb(' +
parseInt(Math.random() * 256, 10) + ',' +
parseInt(Math.random() * 256, 10) + ',' +
parseInt(Math.random() * 256, 10) + ');';
}
function randomKeyframe (keyframes) {
var duration = 0;
for (var i = 0; i < keyframes; i++) {
actor.keyframe(duration += parseInt(30, 10), {
x: parseInt(Math.random() * 400, 10),
y: parseInt(Math.random() * 480, 10),
radius: parseInt(Math.random() * 275, 10),
color: randomColor()
});
}
}
randomKeyframe(50);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment