diff --git a/src/index.html b/src/index.html index 3d81344..82b3149 100644 --- a/src/index.html +++ b/src/index.html @@ -7,16 +7,23 @@

Spazer

+ +

Animations

+ +

Reference Animations

+ diff --git a/src/starfield/index.html b/src/starfield/index.html new file mode 100644 index 0000000..01c2146 --- /dev/null +++ b/src/starfield/index.html @@ -0,0 +1,21 @@ + + + + + Starfield + + + + + + + + diff --git a/src/starfield/starfield.ts b/src/starfield/starfield.ts new file mode 100644 index 0000000..4c23160 --- /dev/null +++ b/src/starfield/starfield.ts @@ -0,0 +1,16 @@ +const canvas = document.querySelector("#mainCanvas"); +const ctx = canvas.getContext("2d"); + +const dpr = window.devicePixelRatio; +const cw = window.innerWidth; +const ch = window.innerHeight; +canvas.width = cw * dpr; +canvas.height = ch * dpr; +ctx.scale(dpr, dpr); + +function resize() { + canvas.width = window.innerWidth * dpr; + canvas.height = window.innerHeight * dpr; +} + +window.addEventListener('resize', resize, false);