Embedding P5JS

– I'm just trying this to see if I can embed some stuff from P5JS on this blog.

In your setup function, create your canvas as follows,

createCanvas(windowWidth, windowHeight);

Then, add a div, and add the iframe inside. Div has properties like overflow:hidden and a fixed position. Iframe can have a style of position top:-100px, essentially hiding the navigation bar from the p5 editor. This sketch uses an extra DOM element, which exposes that the body style is white, which is a pity.

Idea. Maybe you can change it in the index.html file in the editor. Press the chevron on the left of the editor to see the folder.

Anyway, I used: