whisper.cat/weboasis/js/canvas/matrix.min.js
2023-10-05 23:28:32 +11:00

2 lines
1.0 KiB
JavaScript

var f=new FontFace("matrix_code_nfiregular","url(fonts/matrix_code_nfi-webfont.woff)");function canvasSupport(n){return!!n.getContext}function canvasApp(n){if(document.fonts.add(n),document.getElementById("myCanvas")){var t=document.getElementById("myCanvas");t.parentNode.removeChild(t)}var e,a=Math.max(window.screen.width,window.innerWidth)/10,o=Math.round(a),i=document.createElement("canvas");if(i.id="myCanvas",i.classList="background",document.getElementById("canvasContainer").appendChild(i),canvasSupport(i)){var r=i.getContext("2d"),d=i.width=window.innerWidth,c=i.height=window.innerHeight,l=Array(o).join(0).split("");void 0!==e&&clearInterval(Game_interval),e=setInterval((function(){r.fillStyle="rgba(0,0,0,.07)",r.fillRect(0,0,d,c),r.fillStyle=color,r.font="12px matrix_code_nfiregular",l.map((function(n,t){text=[...Array(1)].map((()=>Math.random().toString(36)[2])).join("").toLowerCase(),x=10*t+10,r.fillText(text,x,n),n>100+3e4*Math.random()?l[t]=0:l[t]=n+10}))}),42)}}f.load().then((function(n){canvasApp(n)}));