diff --git a/bezier-1.ts b/bezier-1.ts index 75e26c2..7892b5e 100644 --- a/bezier-1.ts +++ b/bezier-1.ts @@ -52,7 +52,7 @@ function update(ctx: CanvasRenderingContext2D, time: number) { } function init() { - const canvas = document.getElementById("game") as HTMLCanvasElement | null; + const canvas = document.getElementById("canvas") as HTMLCanvasElement | null; if (!canvas) throw new Error("unable to get canvas HTML element"); const ctx = canvas.getContext("2d") as CanvasRenderingContext2D | null; if (!ctx) throw new Error("unable to get canvas 2D context"); diff --git a/bezier-2.ts b/bezier-2.ts index 621914e..1c5aaed 100644 --- a/bezier-2.ts +++ b/bezier-2.ts @@ -17,7 +17,7 @@ function drawCurve(ctx: CanvasRenderingContext2D, curve: Point[]) { function init() { - const canvas = document.getElementById("game") as HTMLCanvasElement | null; + const canvas = document.getElementById("canvas") as HTMLCanvasElement | null; if (!canvas) throw new Error("unable to get canvas HTML element"); const ctx = canvas.getContext("2d") as CanvasRenderingContext2D | null; if (!ctx) throw new Error("unable to get canvas 2D context"); diff --git a/image.ts b/image.ts index b25a0c0..11a3ab6 100644 --- a/image.ts +++ b/image.ts @@ -1,4 +1,4 @@ -const canvas = document.getElementById("game") as HTMLCanvasElement | null; +const canvas = document.getElementById("canvas") as HTMLCanvasElement | null; if (!canvas) throw new Error("unable to get canvas HTML element"); const ctx = canvas.getContext("2d") as CanvasRenderingContext2D | null; if (!ctx) throw new Error("unable to get canvas 2D context"); diff --git a/spline.ts b/spline.ts index 5502418..a5ffe82 100644 --- a/spline.ts +++ b/spline.ts @@ -33,7 +33,7 @@ function draw(ctx: CanvasRenderingContext2D, points: Point[]) { } function init() { - const canvas = document.getElementById("game") as HTMLCanvasElement | null; + const canvas = document.getElementById("canvas") as HTMLCanvasElement | null; if (!canvas) throw new Error("unable to get canvas HTML element"); const ctx = canvas.getContext("2d") as CanvasRenderingContext2D | null; diff --git a/tsconfig.json b/tsconfig.json index c9c555d..a1872b3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,7 +25,7 @@ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */ + "module": "es6", /* Specify what module code is generated. */ // "rootDir": "./", /* Specify the root folder within your source files. */ // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */