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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/p5.min.js"></script>
	<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/addons/p5.dom.min.js"></script>
    <script src="p5testsketch.js"></script>
<div class="section1">
	 <h1>LOREM IPSUM</h1>
	 <p>Quisque ut gravida ligula, nec mollis dui.<br>
	  Etiam id massa eu urna faucibus pretium. Proin volutpat<br>
	  leo ut tellus facilisis, vitae fermentum turpis sagittis.<br>
	  Sed vel ligula a justo tempus vulputate. Nulla vitae commodo<br>
	  orci, pharetra ultricies arcu. Praesent lorem purus,<br>
	  tincidunt eu vehicula vel, tristique quis quam.
     </p>
   </div>
              
            
!

CSS

              
                html,body{
         margin: 0 auto;
	       color:#ddd;
	       font-family:sans-serif;
	    }
	    h1{
	      font-size:4em;
	    }
	    p{
	      margin:5em;
	      line-height: 1.5em;
	    }
	    div{
		  width: 100%;
		  height: 100vh;
		  display: flex;
		  align-items: center;
		  justify-content: center;
		}
              
            
!

JS

              
                function windowResized() {
    resizeCanvas(windowWidth, windowHeight,WEBGL);//3Dの場合は引数にWEBGLを忘れずに!
    background(30);//再描画後に背景を再描画する
}

function setup() {
    canvas = createCanvas(windowWidth,windowHeight,WEBGL);//2Dの場合は引数にWEBGLは要らない
    canvas.position(0,0);//canvasをページの原点に固定
    canvas.style('z-index','-1');//canvasを後ろに移動する
    background(30);
}
function draw() {
   frameRate(6);
   rotateX(frameCount * random(0,10));
   rotateY(frameCount * random(0,10));
   line(random(200,600),random(200,600),300,300);
   stroke(random(0,255),random(0,255),random(0,255));
   /*noStroke();
   ellipse(random(200,600),random(200,600),50,100);
   fill(random(0,255),random(0,255),random(0,255),60);*/
}
              
            
!
999px

Console