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.


                <div class="container">
  <div id="sketch-holder"></div>


                body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background: #222229;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

// A nice Frame
.container {
  height: 600px;
  width: 800px;
  margin: 0 0 20px;
  background: azure;
  box-shadow: 0px 6px 20px #001;
  display: flex;
  justify-content: center;
  align-items: center;


                // Set Canvas height and width
let c = {
  "height": 600,
  "width": 750

let angle = 0;
let oldX = c.width/2;
let oldY = c.height/2;

// Setup Function for pixel clarity, canvas creation, and DOM insertion
function setup() {
  let canvas = createCanvas(c.width, c.height);
  sizeSlider = createSlider(1, 1440, 1440);
  sizeSlider.position(20, 20);
  widthSlider = createSlider(1, 30, 1, .1);
  widthSlider.position(20, 50);
  angleSlider = createSlider(1, 65, 1, .1);
  angleSlider.position(20, 80);

// Draws the background and calls the function for drawing the dots
function draw() {
  size = sizeSlider.value();
  spiralWidth = widthSlider.value();
  angle = angleSlider.value();

function drawSpiral() {
  oldX = c.width/2;
  oldY = c.height/2;
  for (let i=0; i<size; i++) {
    newAngle = (angle/10) * i;
    x = (c.width/2) + (spiralWidth * newAngle) * Math.sin(newAngle);
    y = (c.height/2) + (spiralWidth * newAngle) * Math.cos(newAngle);
    // stroke(randomColor()); // Random Color for each line segment
    // strokeWeight(randomWeight()); // Random Weight (1-5)
    line(oldX, oldY, x, y);
    oldX = x;
    oldY = y;

function randomColor() {
  r = Math.round(Math.random() * 255);
  g = Math.round(Math.random() * 255);
  b = Math.round(Math.random() * 255);
  return `rgb(${r}, ${g}, ${b})`;

function randomWeight() {
  return Math.random() * 5;