Pen Settings



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


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.


Auto Save

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.


                <canvas id="canvas"></canvas>
<div id="dragger"></div>


                * {
  box-sizing: border-box;

html, body {
  height: 100%;

body {
  overflow: hidden;
  background: #000;

#canvas {
  position: fixed;
  top: 0;
  left: 0;  
  pointer-events: none;

#dragger {
  width: 70px;
  height: 70px;
  background: rgba(100,181,246,0.2);
  border: 4px solid rgba(100,181,246,1);
  position: absolute;
  border-radius: 50%;



// WARNING: This uses a modified version of Draggable.js and is not safe to use
namespace App {
  var log = console.log.bind(console);
  var hue = 0;
  var tau = Math.PI * 2;
  var dragger = document.querySelector("#dragger");
  var canvas  = document.querySelector("#canvas");
  var context = canvas.getContext("2d");
  var vw = 0;
  var vh = 0;
  TweenLite.set(dragger, {
    xPercent: -50,
    yPercent: -50,
    x: vw / 2,
    y: vh / 2
  var draggable = new Draggable(dragger, {
    bounds: canvas,
    onDrag: function() {
      var radius = magnitude( / 2;
      var center = midPoint(this, this.last);
      drawCircle(center, radius);
  window.addEventListener("resize", resize);
  function drawCircle(point, radius) {
    context.fillStyle = "rgba(0,0,0,0.05)";
    context.fillRect(0, 0, vw, vh);
    context.arc(point.x, point.y, radius, 0, tau, false);
    context.fillStyle = `hsl(${hue += 4 % 360},100%,55%)`;
  function magnitude(point) {
    return Math.sqrt(point.x * point.x + point.y * point.y);
  function midPoint(point1, point2) {
    return {
      x: (point1.x + point2.x) / 2,
      y: (point1.y + point2.y) / 2,
  function resize() {
    vw = canvas.width  = window.innerWidth;
    vh = canvas.height = window.innerHeight;