- Author:
- Jim Bumgardner
- Twitter:
- @
- GitHub:
- Facebook:
- Google+:
- +
- Reddit:
- /r/
- Pouet:
- Website:
- krazydad.com
- Compo:
- classic
- Demo link:
- https://js1k.com/2012-love/demo/1041
- Shortlink:
- https://js1k.com/1041
- Blog post:
- please update here!
- Bytes:
- 693
- Chars:
- 693
- Submission
// Jim Bumgardner krazydad.com
c.width = c.height = 1024;
var nd = 1024;
var w = c.width;
var h = c.height;
var fc=Math.floor(Math.random()*100000);
var p2 = 3.1415927*2;
setInterval(function() {
a.fillStyle = 'rgba(0,0,0,.05)';
a.fillRect(0,0,w,h);
a.fillStyle = '#fff';
var n = fc/1024;
var rd = w*.97/2;
var cx = w/2;
var cy = h/2;
for (var i = 0; i <= nd; ++i) {
var t = i*p2/nd;
var r = rd*Math.sin(n*t);
var r2 = 1+Math.abs(r/70);
var px = cx+Math.cos(t)*r;
var py = cy+Math.sin(t)*r;
var hu = Math.pow(i/nd,2)*360;
a.fillStyle = 'hsla(' + hu +',33%,66%,1)';
a.beginPath();
a.arc(px,py,r2,0,p2,false);
a.fill();
}
++fc;
}, 40);
- Description
- An interpretation of the Rose equation.
- Base64 encoded
Ly8gSmltIEJ1bWdhcmRuZXIga3JhenlkYWQuY29tDQpjLndpZHRoID0gYy5oZWlnaHQgPSAxMDI0Ow0KdmFyIG5kID0gMTAyNDsNCnZhciB3ID0gYy53aWR0aDsNCnZhciBoID0gYy5oZWlnaHQ7DQp2YXIgZmM9TWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpKjEwMDAwMCk7DQp2YXIgcDIgPSAzLjE0MTU5MjcqMjsNCnNldEludGVydmFsKGZ1bmN0aW9uKCkgew0KCWEuZmlsbFN0eWxlID0gJ3JnYmEoMCwwLDAsLjA1KSc7DQoJYS5maWxsUmVjdCgwLDAsdyxoKTsNCglhLmZpbGxTdHlsZSA9ICcjZmZmJzsNCg0KCXZhciBuID0gZmMvMTAyNDsNCgl2YXIgcmQgPSB3Ki45Ny8yOw0KCXZhciBjeCA9IHcvMjsNCgl2YXIgY3kgPSBoLzI7DQoJZm9yICh2YXIgaSA9IDA7IGkgPD0gbmQ7ICsraSkgew0KCQl2YXIgdCA9IGkqcDIvbmQ7DQoJCXZhciByID0gcmQqTWF0aC5zaW4obip0KTsNCgkJdmFyIHIyID0gMStNYXRoLmFicyhyLzcwKTsNCgkJdmFyIHB4ID0gY3grTWF0aC5jb3ModCkqcjsNCgkJdmFyIHB5ID0gY3krTWF0aC5zaW4odCkqcjsNCgkJdmFyIGh1ID0gTWF0aC5wb3coaS9uZCwyKSozNjA7DQoJCWEuZmlsbFN0eWxlID0gJ2hzbGEoJyArIGh1ICsnLDMzJSw2NiUsMSknOw0KCQlhLmJlZ2luUGF0aCgpOw0KCQlhLmFyYyhweCxweSxyMiwwLHAyLGZhbHNlKTsNCgkJYS5maWxsKCk7DQoJfQ0KCSsrZmM7DQp9LCA0MCk7
- Original source
// Jim Bumgardner krazydad.com
c.width = c.height = 1024;
var nd = 1024;
var w = c.width;
var h = c.height;
var fc=Math.floor(Math.random()*100000);
var p2 = 3.1415927*2;
setInterval(function() {
a.fillStyle = 'rgba(0,0,0,.05)';
a.fillRect(0,0,w,h);
a.fillStyle = '#fff';
var n = fc/1024;
var rd = w*.97/2;
var cx = w/2;
var cy = h/2;
for (var i = 0; i <= nd; ++i) {
var t = i*p2/nd;
var r = rd*Math.sin(n*t);
var r2 = 1+Math.abs(r/70);
var px = cx+Math.cos(t)*r;
var py = cy+Math.sin(t)*r;
var hu = Math.pow(i/nd,2)*360;
a.fillStyle = 'hsla(' + hu +',33%,66%,1)';
a.beginPath();
a.arc(px,py,r2,0,p2,false);
a.fill();
}
++fc;
}, 40);