Pen Settings

HTML

CSS

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

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

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.

HTML

              
                .pacman
  div
  div
  div
  div
  div
              
            
!

CSS

              
                /* To modify the animation, change either @primaryClr or @ballSize for a different color and a different size. */

/* LESS Vars */
@primaryClr: #fed75a; // Adjust this value to change the color
@ballSize: 15px; // Adjust this value to change the size

@pacmanSize: @ballSize * 2.5;

/*The Pacman*/
.pacman {
  position: relative;
  
  > div:nth-child(1),
  > div:nth-child(2) {
    width: 0;
    height: 0;
    border: @pacmanSize solid @primaryClr;
    border-right-color: transparent;
    border-radius: 50%;
    left: -@ballSize * 4;
    animation: rotate_pacman_half_up .5s infinite;
    position: relative;
  }
  > div:nth-child(2) {
    animation-name: rotate_pacman_half_down;
    margin-top: -(@pacmanSize * 2);
  }
  > div:nth-child(3),
  > div:nth-child(4),
  > div:nth-child(5) {
    animation: pacman-balls 1s infinite linear;
    background-color: @primaryClr;
    border-radius: 50%;
    width: @ballSize;
    height: @ballSize;
    position: absolute;
    top: @ballSize * 2;
    left: @pacmanSize * 2;
  }
  > div:nth-child(3) { animation-delay: -.66s; }
  > div:nth-child(4) { animation-delay: -.33s; }
}


/*Pacman Animation Keyframes*/
@keyframes rotate_pacman_half_up {
  0% {
    transform: rotate(270deg);
  }
  50% {
    transform: rotate(360deg);
  }
  100% {
    transform: rotate(270deg);
  }
}

@keyframes rotate_pacman_half_down {
  0% {
    transform: rotate(90deg);
  }
  50% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(90deg);
  }
}

@keyframes pacman-balls {
  75% {
    opacity: .7;
  }
  100% {
    transform: translateX(-@pacmanSize * 2.5);
  }
}

/*Scaffolding*/
body,
html { height: 100%; }

body {
  background-color: rgba(0,0,0,.87);
  display: flex;
  justify-content: center;
  align-items: center;
}
              
            
!

JS

              
                /* NO JS



 ───▄█████▄────────────────────────────────────
 ──███▄██▀─────────────────────────────────────
 ─▐█████────█────█────█────█────█────█────█────
 ──██████▄─────────────────────────────────────
 ───▀█████▀────────────────────────────────────

*/
              
            
!
999px

Console