Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

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

canvas {
  width: 500px;
  height: 500px;
  max-width: 100vw;
	max-height: 100vh;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}
              
            
!

JS

              
                console.clear();

const gap = 20;
const buffer = 80;
const noisesizer = 50;
const noisearea = 10;

function setup() {
  createCanvas(windowWidth,windowHeight);
}

function draw() {
  translate(width/2,height/2);
  
  
  const wSize = (width - (buffer*2)) ;
  const hSize = (height - (buffer*2)) ;
  
  const wCount = floor(wSize / gap);
  const hCount = floor(hSize / gap);
  
  function noiseLine(x1,y1,x2,y2) {
    noise1 = noise(x1 * noisearea,y1 * noisearea) * noisesizer;
    noise2 = noise(x2 * noisearea,y2 * noisearea) * noisesizer;
    
    line(x1 + noise1, y1 + noise1, x2 + noise2, y2 + noise2);
  }
  function noisePoly(x1,y1,x2,y2,x3,y3,x4,y4) {
    
    noise1 = noise(x1 * noisearea,y1 * noisearea) * noisesizer;
    noise2 = noise(x2 * noisearea,y2 * noisearea) * noisesizer;
    noise3 = noise(x3 * noisearea,y3 * noisearea) * noisesizer;
    noise4 = noise(x4 * noisearea,y4 * noisearea) * noisesizer;
    
    
    beginShape();
    vertex(x1 + noise1, y1 + noise1);
    vertex(x2 + noise2, y2 + noise2);
    vertex(x3 + noise3, y3 + noise3);
    vertex(x4 + noise4, y4 + noise4);
    endShape(CLOSE);
  }
  
  for(let w = 1; w <= wCount; w++) {
    for(let h = 1; h <= hCount; h++) {
      const x00 = (gap * w) - (wSize / 2);
      const y00 = (gap * h) - (hSize / 2);
      
      const x10 = (gap * (w-1)) - (wSize / 2);
      const y10 = (gap * h) - (hSize / 2);
      
      const x01 = (gap * w) - (wSize / 2);
      const y01 = (gap * (h-1)) - (hSize / 2);
      
      const x11 = (gap * (w-1)) - (wSize / 2);
      const y11 = (gap * (h-1)) - (hSize / 2);
      
      noisePoly(x00,y00,x01,y01,x11,y11,x10,y10);
    }
  }
  
}
              
            
!
999px

Console