- Author:
- Stijn Van Minnebruggen
- Twitter:
- @
- GitHub:
- Facebook:
- Google+:
- +
- Reddit:
- /r/
- Pouet:
- Website:
- donotfold.be
- Compo:
- classic
- Demo link:
- https://js1k.com/2012-love/demo/1057
- Shortlink:
- https://js1k.com/1057
- Blog post:
- please update here!
- Bytes:
- 717
- Chars:
- 715
- Submission
with(Math){s=12,f=z=40,n=[],t=setTimeout;c.width=c.height=w=s*z;with(b.style){margin=padding=0}c.style.border="1px solid red";v=function(){return random()<0.3};function p(g,e){if(v()){q(g,e)}}function u(g,e){t(function(){m=g-1;d=g+1;o=e-1;j=e+1;p(m,o);p(m,e);p(m,j);p(g,o);p(g,j);p(d,o);p(d,e);p(d,j)},30)}function q(g,e){if(n[g]&&n[g][e]<=-1){n[g][e]=1;u(g,e)}}for(n=[],x=z;x--;){for(n[x]=[],y=z;y--;){n[x][y]=-1}}c.onclick=function(g){f=0;q(floor(g.pageX/s),ceil(g.pageY/s))};(l=function(){with(a){clearRect(0,0,w,w),font=s+2+"px a",save();for(x in n){for(y in n[x]){fillStyle="rgba(255,26,0,"+(n[x][y]-=0.1)+")",fillText("♥",s*x,s*y)}}if(f){fillStyle="red",fillText("CLICK 4 LOVE",20,30),restore()}}t(l,20)})()};
- Description
- Explosion of love :)
- Base64 encoded
d2l0aChNYXRoKXtzPTEyLGY9ej00MCxuPVtdLHQ9c2V0VGltZW91dDtjLndpZHRoPWMuaGVpZ2h0PXc9cyp6O3dpdGgoYi5zdHlsZSl7bWFyZ2luPXBhZGRpbmc9MH1jLnN0eWxlLmJvcmRlcj0iMXB4IHNvbGlkIHJlZCI7dj1mdW5jdGlvbigpe3JldHVybiByYW5kb20oKTwwLjN9O2Z1bmN0aW9uIHAoZyxlKXtpZih2KCkpe3EoZyxlKX19ZnVuY3Rpb24gdShnLGUpe3QoZnVuY3Rpb24oKXttPWctMTtkPWcrMTtvPWUtMTtqPWUrMTtwKG0sbyk7cChtLGUpO3AobSxqKTtwKGcsbyk7cChnLGopO3AoZCxvKTtwKGQsZSk7cChkLGopfSwzMCl9ZnVuY3Rpb24gcShnLGUpe2lmKG5bZ10mJm5bZ11bZV08PS0xKXtuW2ddW2VdPTE7dShnLGUpfX1mb3Iobj1bXSx4PXo7eC0tOyl7Zm9yKG5beF09W10seT16O3ktLTspe25beF1beV09LTF9fWMub25jbGljaz1mdW5jdGlvbihnKXtmPTA7cShmbG9vcihnLnBhZ2VYL3MpLGNlaWwoZy5wYWdlWS9zKSl9OyhsPWZ1bmN0aW9uKCl7d2l0aChhKXtjbGVhclJlY3QoMCwwLHcsdyksZm9udD1zKzIrInB4IGEiLHNhdmUoKTtmb3IoeCBpbiBuKXtmb3IoeSBpbiBuW3hdKXtmaWxsU3R5bGU9InJnYmEoMjU1LDI2LDAsIisoblt4XVt5XS09MC4xKSsiKSIsZmlsbFRleHQoIuKZpSIscyp4LHMqeSl9fWlmKGYpe2ZpbGxTdHlsZT0icmVkIixmaWxsVGV4dCgiQ0xJQ0sgNCBMT1ZFIiwyMCwzMCkscmVzdG9yZSgpfX10KGwsMjApfSkoKX07
- Original source
with(Math) {
s=12, f=z=40, n=[], t=setTimeout;
c.width = c.height = w = s*z;
with(b.style) margin = padding = 0;
c.style.border = '1px solid red';
v = function() { return random() < .3 }
function p(k,l) { if(v()) q(k,l) }
function u(k,l) {
t(function() {
m=k-1; d=k+1; o=l-1; j=l+1;
p(m,o); p(m,l); p(m,j);
p(k,o); p(k,j);
p(d,o); p(d,l); p(d,j);
},30);
}
function q(k,l) {
if(n[k] && n[k][l] <= -1) {
n[k][l] = 1;
u(k,l)
}
}
for(n=[],x=z; x--;) for(n[x]=[],y=z; y--;) n[x][y] = -1;
c.onclick = function(e) { f=0; q(floor(e.pageX/s), ceil(e.pageY/s)) };
(l = function() {
with(a) {
clearRect(0,0,w,w),font = s+2+'px a', save()
for(x in n) for(y in n[x]) fillStyle = 'rgba(255,26,0,'+(n[x][y]-=.1)+')', fillText('♥',s*x,s*y)
if(f) fillStyle = 'red', fillText('CLICK 4 LOVE',20,30), restore()
}
t(l,20)
})()
}