Pen Settings

HTML

CSS

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

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                
              
            
!

CSS

              
                body {
  margin: 0;
}
canvas {
  display: block;
}

              
            
!

JS

              
                //this code is the modified ver of what I created for experiment 3 based on Tristan's rule

//allay for the drops
let drops = [];
function setup() {
  //setting up the size of the canvas
  createCanvas(windowWidth,windowHeight);
  
  //how many drops and where are they going to be
  let num_elements = random(width);
  for (let i = 0; i < num_elements; i++) {
    drops[i] = {
      x: random(width), //drops are going to be randomly located in x-axis
      y: random(height), //drops are going to be randomly located in y-axis
      radius: random(1, 35), //size of the raindrops
      speed: random(-3, 7) //how fast the drops move 
    };
  }
}

function draw() {
  background(0); //black background
  for (let i = 0; i < drops.length; i++) {
    //
    let e = drops[i];
    //the drops are going to bounce once it gets to the edge
    //the movement of the circles in the vertical direction
    e.y -= random(-10,40);
    if (e.y < 0) {
      e.y += random(height); 
    } else if (e.y > height) {
      e.y += random(height);
    }
    noStroke(); 
    fill(255,random(140,153),random(100,110),random(200,210)); // r,g,b,a 
    ellipse(e.x, e.y, e.radius);  //locate the circles 
  }
}

              
            
!
999px

Console