Skip to content
Snippets Groups Projects
Select Git revision
  • 757293a903855ea1123976f395d6c87f48a13a83
  • main default protected
2 results

index.html

Blame
  • index.html 663 B
    <style>
        body{
            margin:0;
            background: #1a1a1a;
        }
        #c {
            position:fixed;top:50%;left:50%;translate:-50% -50%;
            image-rendering: pixelated;
        }
    </style>
    <canvas id="c"></canvas>
    <script src="./main.js"></script>
    <script>
        fl = Math.floor;
        a = c.getContext`2d`;
        u = _=>{
            w = innerWidth;
            h = innerHeight;
            wS = fl(w/256);
            hS = fl(h/256);
            s=Math.min(wS,hS);
            c.width = 256*s;
            c.height= 240*s;
            canvas.pixelRatio = s;
            canvas.setScale(canvas.scale);
            a.imageSmoothingEnabled = false;
        }
        u();addEventListener('resize', u, !0);
    </script>