Get started with p5.js CDN

LGPL-2.1 licensed

P5.js: Free, open-source library for creating browser-based art with JS.

Tags:
  • javascript
  • graphics
  • education
  • learning
  • art
  • design
  • sound
  • html

Stable version

Copied!

How to start using p5.js CDN


<!DOCTYPE html>
<html>
<head>
  <script src="https://cdn.cdnhub.io/p5.js/1.9.1/p5.min.js"></script>
  <title>Get started with p5.js CDN - cdnhub.io</title>
  <style type="text/css">
    canvas { width: 100%; height: 100%; }
  </style>
</head>
<body>
  <script type="text/p5">
    function setup() {
      createCanvas(400, 400);
      background(220);
    }

    function draw() {
      background(220);
      fill(0);
      ellipse(mouseX, mouseY, 80, 80);
    }
  </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions