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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 type="application/processing">
void setup() {
  size(200, 200);

void draw() {

void drawFace() {
  //place face in middle of window
  float faceX = width/2;
  float faceY = height/2;

  //smallest face is half the window, biggest face is whole window
  float faceWidth = random(width/2, width);
  float faceHeight = random(height/2, height);

  //random face color
  fill(random(255), random(255), random(255));

  //draw the head
  ellipse(faceX, faceY, faceWidth, faceHeight);

  //random eye size
  float eyeWidth = random(faceWidth*.1, faceWidth*.25);
  float eyeHeight = random(faceHeight*.1, faceHeight*.25);

  //random eye position
  float spaceBetweenEyes = random(eyeWidth, eyeWidth*2);
  float leftEyeX = faceX - spaceBetweenEyes/2;
  float rightEyeX = faceX + spaceBetweenEyes/2;
  float eyeY = faceY - random(faceHeight*.1, faceHeight*.25);


  //draw the eyes
  ellipse(leftEyeX, eyeY, eyeWidth, eyeHeight);
  ellipse(rightEyeX, eyeY, eyeWidth, eyeHeight);

  //random pupil size
  float pupilWidth = random(eyeWidth*.1, eyeWidth*.9);
  float pupilHeight = random(eyeHeight*.1, eyeHeight*.9);


  //draw the pupils
  ellipse(leftEyeX, eyeY, pupilWidth, pupilHeight);
  ellipse(rightEyeX, eyeY, pupilWidth, pupilHeight);

  //random mouth size and Y
  float mouthWidth = random(faceWidth*.2, faceWidth*.8);
  float mouthHeight = random(faceHeight*.1, faceHeight*.3);
  float mouthY = faceY + random(faceHeight*.1, faceHeight*.25);

  //random mouth color
  fill(random(255), random(255), random(255));

  //draw the mouth
  arc(faceX, mouthY, mouthWidth, mouthHeight, 0, 3.14);
  line(faceX - mouthWidth/2, mouthY, faceX + mouthWidth/2, mouthY);
<canvas> </canvas>