To celebrate May 4th, I made the cockpit design of the Millennium Falcon fit within a dweet!
π’ Cockpit of the Millennium Falcon (161b) d/31702
B=~~(t*99)%136
x.save(A=300)
x.translate(960,1080)
x.rotate(B*.035)
for(i=5;i--;)x.fillRect(-70,A+A*i,43,B%25+i%2==0||(B+15)%25+(i+1)%2==0?A:30)
x.restore()
I combined my dweet with one by KilledByAPixel: Tiny Starfield π
I couldn't put the two together into a dweet but it made an interesting combination.
c.style.filter="invert("
didn't work with capjs, so I manually colored the canvas. I removed some starfield code to get it working nicely too.
x.fillStyle="#000"
x.fillRect(0,0,2e3,2e3)
//KilledByAPixel's Tiny Starfield (minus some code)
x.fillStyle="#FFF"
for(j=5e3;r=j--/(9-++t%9);)x.fillRect(C(j)*r+960,S(j*j)*r+540,r>>=8,r)
//cockpit code
for(B=136;B--;){x.save(A=300)
x.translate(960,1080)
x.rotate(B*.035)
for(i=5;i--;)x.fillRect(-70,A+A*i,43,B%25+i%2==0||(B+15)%25+(i+1)%2==0?A:30)
x.restore()}
I used CapJS to generate a webm
video file and converted that to mp4
.
c.style.filter="invert("
for(j=5e3;r=j--/(9-++t%9);)x.fillRect(C(j)*r+1e3,S(j*j)*r+540,r>>=8,r)
for(B=136;B--;){x.save(A=300)
x.translate(960,1e3)
x.rotate(B*.035)
for(i=5;i--;)x.clearRect(-70,A+A*i,43,B%25+i%2==0||(B+15)%25+(i+1)%2==0?A:30)
x.restore()}