home ~ projects ~ socials

Basic p5.js Output On A Page

This is how I'm outputting p5 projects on pages:

HTML

<div id="p5Wrapper"></div>

Output

JavaScript

function setup() {
  var canvas = createCanvas(300, 100);
  canvas.parent('p5Wrapper');
}

function draw() {
  background(220);
  ellipse(50,50,80,80);
}
-- end of line --