diff options
Diffstat (limited to 'viewer')
-rw-r--r-- | viewer/index.html | 12 | ||||
-rw-r--r-- | viewer/main.ts | 19 |
2 files changed, 31 insertions, 0 deletions
diff --git a/viewer/index.html b/viewer/index.html new file mode 100644 index 0000000..4713ed3 --- /dev/null +++ b/viewer/index.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>The Map</title> + </head> + <body> + <script src="./bundle.js"></script> + <noscript>Map viewer required JavaScript support.</noscript> + </body> +</html> diff --git a/viewer/main.ts b/viewer/main.ts new file mode 100644 index 0000000..4320b68 --- /dev/null +++ b/viewer/main.ts @@ -0,0 +1,19 @@ +/// <reference lib="dom" /> + +const canvas = document.createElement("canvas") +canvas.style.position = "absolute" +canvas.style.top = "0px" +canvas.style.left = "0px" +canvas.style.width = "100vw" +canvas.style.height = "100vh" +document.body.append(canvas) +const ctx = canvas.getContext("2d")! + +function draw() { + ctx.fillStyle = "black" + ctx.fillRect(0, 0, canvas.width, canvas.height) +} + +canvas.addEventListener("resize", () => draw()) +draw() + |