- Author:
- Lác Neobým Helkár
- Twitter:
- @
- GitHub:
- kipkat
- Facebook:
- Google+:
- +
- Reddit:
- /r/
- Pouet:
- Website:
- Compo:
- canvas
- Demo link:
- https://js1k.com/2019-x/demo/4135
- Shortlink:
- https://js1k.com/4135
- Blog post:
- please update here!
- Bytes:
- 395
- Chars:
- 395
- Submission
z=2019;b.onmousemove=l=>{z=l.x*l.y;m=[]};m=[];f=(X,Y,R,r,z)=>{c.beginPath();c.arc(X,Y,R,0,7);c.stroke();if(R<6)m.push([X,Y]);if(R>3)f(X-Math.sin(R*z+r/2)*R,Y-Math.cos(R*z+r/2)*R,R/1.8,r*2+Math.sin(z),z)};fr=0;q=p=>{if(m.length>4000){for(i=9;i--;)m.shift();}c.clearRect(0,0,2e3,2e3);f(a.width/2,a.height/2,150,fr++/99,z);c.fillStyle='#f00';for(i of m)c.fillRect(i[0],i[1],1,1)};setInterval(q,1)
- Description
- Random recursive drawing, use cursor as seed
- Base64 encoded
ej0yMDE5O2Iub25tb3VzZW1vdmU9bD0+e3o9bC54KmwueTttPVtdfTttPVtdO2Y9KFgsWSxSLHIseik9PntjLmJlZ2luUGF0aCgpO2MuYXJjKFgsWSxSLDAsNyk7Yy5zdHJva2UoKTtpZihSPDYpbS5wdXNoKFtYLFldKTtpZihSPjMpZihYLU1hdGguc2luKFIqeityLzIpKlIsWS1NYXRoLmNvcyhSKnorci8yKSpSLFIvMS44LHIqMitNYXRoLnNpbih6KSx6KX07ZnI9MDtxPXA9PntpZihtLmxlbmd0aD40MDAwKXtmb3IoaT05O2ktLTspbS5zaGlmdCgpO31jLmNsZWFyUmVjdCgwLDAsMmUzLDJlMyk7ZihhLndpZHRoLzIsYS5oZWlnaHQvMiwxNTAsZnIrKy85OSx6KTtjLmZpbGxTdHlsZT0nI2YwMCc7Zm9yKGkgb2YgbSljLmZpbGxSZWN0KGlbMF0saVsxXSwxLDEpfTtzZXRJbnRlcnZhbChxLDEpDQo=
- Original source
z=2019;
b.onmousemove=l=>{z=l.x*l.y;m=[]}; // reset canvas + seed
m=[];
f=(X,Y,R,r,z)=>{
c.beginPath();
c.arc(X,Y,R,0,7);
c.stroke();
if(R<6)m.push([X,Y]); // add point
if(R>3) // recursion condition
f(X-Math.sin(R*z+r/2)*R,
Y-Math.cos(R*z+r/2)*R,
R/1.8,
r*2+Math.sin(z),z)};
fr=0;q=p=>{
if(m.length>4000) // to keep optimised max 4k points
{for(i=9;i--;)
m.shift();
}
c.clearRect(0,0,2e3,2e3); // clear arcs
f(a.width/2,a.height/2,150,fr++/99,z);
c.fillStyle='#f00';
for(i of m)c.fillRect(i[0],i[1],1,1)}
setInterval(q,1) // setInterval to avoid requestAnimationFrame that's too long lmao