17 lines
391 B
JavaScript
17 lines
391 B
JavaScript
export class Sketch {
|
|
constructor(width, height) {
|
|
this.canvas = document.createElement("canvas");
|
|
this.canvas.width = width;
|
|
this.canvas.height = height;
|
|
this.ctx = this.canvas.getContext("2d");
|
|
|
|
document.body.appendChild(this.canvas);
|
|
|
|
postMessage({
|
|
kind: "resize",
|
|
width,
|
|
height,
|
|
});
|
|
}
|
|
}
|