graphical output in code blocks
This commit is contained in:
parent
565b6a0520
commit
51de33c2b5
13 changed files with 351 additions and 57 deletions
16
static/js/sandbox.js
Normal file
16
static/js/sandbox.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
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,
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue