1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { sketch } from "https://esm.town/v/moe/p5"
import type * as p5 from "npm:@types/p5"
export const title = "Hello, World!"
export default sketch(import.meta.url, title)
export function setup() {
// console.log("setup", window.innerWidth, window.innerHeight);
// createCanvas(window.innerWidth, window.innerHeight);
createCanvas(500, 500)
}
export function draw() {
background(0)
if (mouseIsPressed) {
fill("red")
} else {
fill("yellow")
}
ellipse(mouseX, mouseY, 180, 180)
}