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

              
                <!-- 
A very quick experiment with the new pseudo-3D engine https://zzz.dog/
-->

<canvas class="zdog-canvas"></canvas>
              
            
!

CSS

              
                body {
  margin: 0;
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%,#285AEB 90%);
}

.zdog-canvas {
  display: block;
  margin: 0;
  padding: 0;
}
              
            
!

JS

              
                // make canvas full screen
const canvas = $(".zdog-canvas")[0];
canvas.height = $(window).height();
canvas.width = $(window).width();

// the zdog bit
let isSpinning = true;

let illo = new Zdog.Illustration({
  element: ".zdog-canvas",
  dragRotate: true,
  // stop spinning when drag starts
  onDragStart: function() {
    isSpinning = false;
  }
});

new Zdog.Ellipse({
  addTo: illo,
  diameter: 70,
  translate: {},
  stroke: 16,
  color: "#FFF",
  fill: false
});

new Zdog.Ellipse({
  addTo: illo,
  diameter: 24,
  translate: { x: 50, y: -50 },
  stroke: 0,
  color: "#FFF",
  fill: true
});

new Zdog.RoundedRect({
  addTo: illo,
  width: 180,
  height: 180,
  cornerRadius: 40,
  translate: {},
  stroke: 16,
  color: "#FFF",
  fill: false
});

let ticker = 0;
let cycleCount = 200;

function animate() {
  let progress = ticker / cycleCount;
  // apply easing to rotation
  let tween = Zdog.easeInOut(progress % 1, 3);
  illo.rotate.y = tween * Zdog.TAU;
  ticker++;

  illo.updateRenderGraph();
  requestAnimationFrame(animate);
}
animate();

              
            
!
999px

Console