cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

            
              <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>


            
          
!
            
              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;
}
            
          
!
            
              //does it kinda look like the trees farting all the presents away? 
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console