p5.js Blocks Project

In the Creative Programming course, we used the p5 library to visually program sketches using JavaScript. For my project, I visually simulated a dance floor using a function that creates rectangles, a variable for color, and another function that randomizes color when the mouse is pressed.

Although I didn’t use conditionals for this specific project, I could have used a series of if statements or a for loop to create the rectangles rather than a customized variable. I would like to figure out how to host the p5 library on a webpage so I can display my sketches.