Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


    <script src=""></script>
     <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <link rel="stylesheet" type="text/css" href="style.css">
    <meta charset="utf-8" />

    <script src="sketch.js"></script>



                html, body {
  margin: 0;
  padding: 0;


                //Objects and Classes 4: Programming Digital Media

//Code by Matthew A. Bardin [2020]

//This code is cerating a circle like in the previous code using a Javascript Object.

// where JSON begins to become more useful is when you have multiple objects. Instead of needing to list out a long line of variables, we can create multiple objects that can be independently ajusted as needed. 

let circle1 = {
  x: 100,
  y: 100,
  diam: 50

//here is an example of a simple second object. Notice how we can have the same variable names because they are contained within each object. This can make organizing each value much easier.
let circle2 = {
  x: 200,
  y: 300,
  diam: 50

function setup() {
  createCanvas(400, 400);

function draw() {
  ellipse(circle1.x, circle1.y, circle1.diam, circle1.diam);

  //in order to see our other object, we just need to repeat the process from the previous code, but make sure our varibles are updated to reflect the new object. 
  ellipse(circle2.x, circle2.y, circle2.diam, circle2.diam);
  //take this code as a starting code and add in your own third circle with unique values. Then add a line in order to animate each of the three objects across the canvas.