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

              
                <div class="christmas-shop">
  <a href="/christmas/">
    <div class="christmas-tree">
      <div class="trunk"></div>
      <div class="branches bottom">
        <div class="lights light5"></div>
        <div class="lights light6"></div>
      </div>
      <div class="branches middle">
        <div class="lights light3"></div>
        <div class="lights light4"></div>
      </div>
      <div class="branches top">
        <div class="lights light1"></div>
        <div class="lights light2"></div>
      </div>
      <div class="star">&#9733;</div>
      <div class="presents present1"></div>
      <div class="presents present2"></div>
      <div class="presents present3"></div>
      <div class="presents present4"></div>
    </div>
  </a>
</div>
<h2>Hover me</h2>


              
            
!

CSS

              
                body {
  background:#010168;
}
.christmas-shop {
  position:relative;
  width:40px;
  height:40px;
  margin:20% auto 20px;
  a {
    background: none;
    margin:0 20px 0 0;
    &:hover {
      background: none;
      .christmas-tree {
        .star {
          animation: spin-tree 500ms 1000ms 1 ease-in-out;
        }
        .branches.top {
          animation: spin-tree 500ms 600ms 1 ease-in-out;
        }
        .branches.middle {
          animation: spin-tree 500ms 200ms 1 ease-in-out;
        }
        .branches.bottom {
          animation: spin-tree 500ms 0ms 1 ease-in-out;
        }
        .present1 {
          left:-4px;
          transform: rotate(-90deg);
        }
        .present2 {
          right:-10px;
          transform: rotate(90deg);
        }
        .present3 {
          right:40px;
          transform: rotate(-90deg);
        }
        .present4 {
          right:-10px;
          transform: rotate(90deg);
        }
      }
    }
  }
}
.christmas-tree {
  transform: scale(2);
  transform-style: preserve-3d;
  transform-origin: top center;
  transition: 0.6s;
  height: 30px;
  width:30px;
  position: absolute;
  left:0;

  .trunk {
    border-color: brown transparent;
    border-style: solid;
    border-width: 0 2px 30px;
    top: 3px;
    left: 50%;
    height: 0px;
    position: absolute;
    width: 0;
  }

  .branches {
    border-bottom-left-radius: 50% 12px;
    border-bottom-right-radius: 50% 12px;
    border-color: green transparent;
    border-style: solid;
    border-width: 0 100px 120px;
    height: 0px;
    position: absolute;
    width: 0;
  }
  .branches.bottom {
    border-width: 0 17px 15px;
    top: 14px;
    left: 0px;
  }
  .branches.middle {
    border-width: 0 13px 15px;
    top: 8px;
    left: 4px;
  }
  .branches.top {
    border-width: 0 10px 15px;
    top:0;
    left:7px
  }
  .star {
    color: yellow;
    position: absolute;
    z-index: 1000000;
    left: 9px;
    top: -10px;
    animation: star-shine 10s infinite ease-in-out;
  }
  .lights {
    height:1px;
    width:1px;
    background:#FFF;
    position:absolute;
  }
  .light1 {
    top:8px;
    left:2px;
    animation: twinkletwinkle 1s 1s infinite ease-in-out;
  }
  .light2 {
    top:9px;
    left:-2px;
    animation: twinkletwinkle 6s 1s infinite ease-in-out;
  }
  .light3 {
    top:9px;
    left:-4px;
    animation: twinkletwinkle 5s 1s infinite ease-in-out;
  }
  .light4 {
    top:8px;
    left:3px;
    animation: twinkletwinkle 4s 1s infinite ease-in-out;
  }
  .light5 {
    top:10px;
    left:-7px;
    animation: twinkletwinkle 3s 1s infinite ease-in-out;
  }
  .light6 {
    top:10px;
    left:6px;
    animation: twinkletwinkle 2s 1s infinite ease-in-out;
  }
  
    .presents {
    width:10px;
    height:10px;
    position: absolute;
    z-index: -1;
    transition: all 500ms ease-in;
  }
  .present1 {
    background:pink;
    bottom:-5px;
    left:4px;
  }
  .present2 {
    background:#00B8FF;
    bottom:-5px;
    right:0px;
  }
  .present3 {
    width:6px;
    height:6px;
    background:#FF002F;
    bottom:-5px;
    right:22px;
  }
  .present4 {
    width:6px;
    height:6px;
    background:#B400FF;
    bottom:-5px;
    right:-2px;
  }
}


@keyframes star-shine {
  0%   {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

@keyframes twinkletwinkle {
  0%   {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

@keyframes spin-tree {
  0%   {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(180deg);
  }
  100% {
    transform: rotateY(0deg);
  }
}

h2 {
  text-align:center;
  padding:30px 0 0 0;
  color:#FFF;
  font:italic 18px Georgia, Times, 'Times New Roman', serif;
}
              
            
!

JS

              
                //does it kinda look like the trees farting all the presents away? 
              
            
!
999px

Console