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

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

              
                <div class="container">
  <svg class="layer-1">
    <path class="layout" d="M50,50 L650,50 L650,500 L50,500 z" />
  </svg>
  <svg class=" layer-2">
    <path class="h1"
          d="M120,100 L580,100 L580,150 L120,150 z
             M120,170 L580,170 L580,190 L120,190 z
             M120,210 L340,210 L340,400 L120,400 z
             M420,210 L580,210 L580,250 L420,250 z
             M360,270 L580,270 L580,400 L360,400 z
             M120,420 L580,420 L580,450 L120,450 z"/>
    <circle class="ava" cx="380" cy="230" r="20"/>
  </svg>
  <svg class="layer-3">
    <path class="text"
          d="M390,300 L550,300 L550,302 L390,302 z
             M390,315 L550,315 L550,317 L390,317 z
             M390,332 L550,332 L550,334 L390,334 z
             M390,349 L550,349 L550,351 L390,351 z
             M390,366 L550,366 L550,368 L390,368 z
             M250,435 L450,435 L450,437 L250,437 z"/>
    <path class="image"
          d="M150,250 L310,250 L310,360 L150,360 z
             M170,360 L210,315 L250,360 z
             " />
    <path class="image"
          d="M220,360 L270,300 L310,340 L310,360 z"/>
    <circle class="image" cx="185" cy="275" r="10" />
  </svg>
</div>
              
            
!

CSS

              
                body {
  background-color: white;
  position: relative;
}
svg {
  width: 700px;
  height: 600px;
  top: 25vh;
  left: 10vw;
}
path, circle {
  stroke: #e12345;
  stroke-width: 2px;
  fill: #ec5252;
}
.h1, .ava {
  stroke: #ec5252;
  fill: white;
  opacity: .8;
}
.text, .image {
  fill: white;
  stroke: #ec5252;
  stroke-width: 2px;
}
.container {
  transform-style: preserve-3d;
  transition: transform 1800ms ease 0s;
  transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
  width: 50vw;
}
.layer-1, .layer-2, .layer-3 {
  position: absolute;
  left: 0px;
  top: 0px;
  right: 0px;
  bottom: 0px;
}
.layer-1 {
  opacity: 0.5;
}
.container svg {
  transform-style: preserve-3d;
  transition: transform 1800ms ease 0s; 
}
.container:hover {
  transform: rotateX(50deg) rotateY(0deg) rotateZ(-15deg) translateY(60px);
}
.container:hover .layer-2 {
  transform: translateX(0px) translateY(60px) translateZ(120px);
}
.container:hover .layer-3 {
  transform: translateX(0px) translateY(60px) translateZ(180px);
}

/* just for grid for preview */
.grid {
    position: absolute;
    border: 1px solid #ccc;
    border-width: 1px 0 0 1px;
    top: 0;
    z-index: -1;
}
.grid div {
  z-index: -1;
    border: 1px solid #ccc;
    border-width: 0 1px 1px 0;
    float: left;
}
              
            
!

JS

              
                //draw grid
function createGrid(size) {
    var ratioW = Math.floor($(window).width()/size),
        ratioH = Math.floor($(window).height()/size);
    
    var parent = $('<div />', {
        class: 'grid', 
        width: ratioW  * size, 
        height: ratioH  * size
    }).addClass('grid').appendTo('body');

    for (var i = 0; i < ratioH; i++) {
        for(var p = 0; p < ratioW; p++){
            $('<div />', {
                width: size - 1, 
                height: size - 1
            }).appendTo(parent);
        }
    }
}

createGrid(50); //grid width = 50px

              
            
!
999px

Console