Skip to content

Instantly share code, notes, and snippets.

@LeetCodes
Created August 26, 2021 05:32
Show Gist options
  • Select an option

  • Save LeetCodes/6b0d381ab9b073d888087f375c929d66 to your computer and use it in GitHub Desktop.

Select an option

Save LeetCodes/6b0d381ab9b073d888087f375c929d66 to your computer and use it in GitHub Desktop.
MWydrVM
<canvas id=c width=1920 height=1080>
function u(t) {
c.width|=E=20;
T=47;
for(i=235;i--;x.fillRect(E*(i%T-E)*S(3*t)+900,E*(E+i/T|0),("ŏͽǷǟ¸ª‚ˆHėĕDZćĢ!‚‚́£ğ̐ė".charCodeAt(i/10)>>i%10&1)*E,E));
}
let x = c.getContext('2d');
let S = Math.sin;
let C = Math.cos;
let T = Math.tan;
let R = (r,g,b,a=1) => `rgba(${r|0},${g|0},${b|0},${a})`;
let loop = (frameTime) =>
{
requestAnimationFrame(loop);
u(frameTime/1e3);
const aspect = 1920/1080;
const width = aspect > innerWidth/innerHeight? innerWidth : innerHeight*aspect;
c.style.width = width +'px';
document.body.style.textAlign = 'center';
}
loop();
body { margin:0; overflow:hidden; }
canvas { background:#FFF; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment