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

              
                
              
            
!

CSS

              
                body, html {
  background: #EFEFBB; /* fallback for old browsers */
  background: -webkit-linear-gradient(to left, #EFEFBB , #D4D3DD); /* Chrome 10-25, Safari 5.1-6 */
  background: linear-gradient(to left, #EFEFBB , #D4D3DD); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
  width: 100vw;
  height: 100vh;
  font-family: "Rubik", sans-serif;
  color: rgba(43,123,160,1);
  text-align: center;
  letter-spacing: 0.03em;
  overflow: hidden;
}
              
            
!

JS

              
                const color1 = '#c159b0',
      color2 = '#6dbc99',
      color3 = '#f4a86e',
      pos = { row1: '35%',   
              row2: '65%',   
              col1: '20%',
              col2: '40%',
              col3: '60%',
              col4: '80%' }; 

const zigzag = new mojs.Shape({
  shape:        'zigzag',
  points:       12,
  radius:       25,
  radiusY:      50,
  top:          pos.row1,
  left:         pos.col1,
  fill:         'none',
  stroke:       color1,
  isShowStart:   true,
});

const cross = new mojs.Shape({
  shape:        'cross',
  radius:       20,
  radiusY:      30,
  top:          pos.row1,
  left:         pos.col2,
  stroke:       color2, //no fill for this one
  isShowStart:  true,
  y:            -25
});

const equal = new mojs.Shape({
  shape:        'equal',
  radius:       25,
  radiusY:      15,
  top:          pos.row1,
  left:         pos.col3,
  stroke:       color3, //no fill for this one
  isShowStart:  true,
  y:            -25
});

const curve = new mojs.Shape({
  shape:        'curve',
  radius:       25,
  radiusY:      50,
  top:          pos.row1,
  left:         pos.col4,
  fill:         'none',
  stroke:       color2,
  isShowStart:   true,
});

// second row //

const rect = new mojs.Shape({
  shape:        'rect',
  radius:       10,
  radiusX:      30, // explicit radiusX
  left:         pos.col1,
  top:          pos.row2,
  fill:         color3,
  isShowStart:  true,
});

const circle = new mojs.Shape({
  shape:        'circle',
  radius:       30,
  radiusX:      20, // explicit radiusX
  top:          pos.row2,
  left:         pos.col3,
  fill:         'none',
  stroke:       color2,
  isShowStart:  true,
});

const polygon1 = new mojs.Shape({
  shape:        'polygon',
  radius:       20,
  radiusY:      30, // explicit radiusY
  left:         '75%',
  stroke:       '#7db4d8',
  top:          pos.row2,
  left:         pos.col2,
  fill:         'none',
  isShowStart:  true,
});

const polygon2 = new mojs.Shape({
  shape:        'polygon',
  points:       8, //explicit points
  radius:       25,
  left:         '75%',
  top:          pos.row2,
  left:         pos.col4,
  fill:         color3,
  isShowStart:  true,
});
              
            
!
999px

Console