Pen Settings

HTML

CSS

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

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="wrapper">
  <div class="star"></div>
  <div class="lights">
    <div id="light"></div>
  </div>
  <div class="leaves">
      <div id="layer1"></div>
      <div id="layer2"></div>
      <div id="layer3"></div>
      <div id="layer4"></div>
      <div id="layer5"></div>
      <div id="layer6"></div>
      <div id="layer7"></div>
      <div id="layer8"></div>
      <div id="layer9"></div>
  </div>
  <div class="stump"></div>
  <div class="shadow"></div>
</div>
<h1>Happy Holidays</h1>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Pacifico');

html {
  width: 100%;
  height: 100vh;
  background-color: #96d1b5;
  overflow: hidden;
  display: flex; 
  justify-content: center;
  align-items: center;
}
.wrapper {
  width: 400px;
  position: relative;
  transform: scale(0.8);
}
.star{
  margin: auto;
  width: 0;
  height: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-bottom: 50px solid #f7f6d7;
  position: relative;
}
.star:after {
  width: 0;
  height: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-top: 50px solid #f7f6d7;
  position: absolute;
  content: "";
  top: 15px;
  left: -30px;
  z-index: 3;
}
.leaves div {
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  height: 0;
  margin: auto;
  position: relative;
}
#layer1:after,
#layer2:after,
#layer3:after,
#layer4:after,
#layer5:after,
#layer6:after,
#layer7:after,
#layer8:after,
#layer9:after {
  content: "";
  position: absolute;
  width: 50%;
  height: 0;
  border-bottom: 45px solid rgba(20, 1, 30, 0.15);
  border-right: 30px solid transparent;
  right: -30px;
}
#layer1 {
  border-bottom: 45px solid #2cb565;
  width: calc(20% - 50px);
}
#layer2 {
  border-bottom: 45px solid #2f8a4d;
  width: calc(30% - 50px);
}
#layer3 {
  border-bottom: 45px solid #3cb75c;
  width: calc(40% - 50px);
}
#layer4 {
  border-bottom: 45px solid #238a53;
  width: calc(50% - 50px);
}
#layer5 {
  border-bottom: 45px solid #3eb87b;
  width: calc(60% - 50px);
}
#layer6 {
  border-bottom: 45px solid #0a9947;
  width: calc(70% - 50px);
}
#layer7 {
  border-bottom: 45px solid #046637;
  width: calc(80% - 50px);
}
#layer8 {
  border-bottom: 45px solid #41ba6b;
  width: calc(90% - 50px);
}
#layer9 {
  border-bottom: 45px solid #0b9951;
  position: relative;
}
.stump {
  position: relative;
  background-color: #62421c;
  height: 50px;
  width: 50px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: -20px;
}
.stump:after{
  content: "";
  position: absolute;
  width: 50%;
  height: 100%;
  right: 0;
  background-color: rgba(20, 1, 30, 0.15);
}
.shadow {
  height: 35px;
  width: 100%;
  background-color: rgba(0,0,0,.1);
  border-radius: 50%;
  z-index: -2;
  position: relative;
}

.lights {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
}
#light{
  --box-shadow-color: #fff;
  --box-shadow-color2: #fff;
  margin: 0 auto;
  position: absolute;
  z-index: 100;
  top: 100px;
  left: 200px;
  width: 15px;
  height: 15px;
  background-color: #ffecc4;
  border-radius: 50%;
  box-shadow: -30px -15px 0 0 var(--box-shadow-color2), 30px 15px 0 0 var(--box-shadow-color2), 0px 75px 0 0 var(--box-shadow-color2), -30px 60px 0 0 var(--box-shadow-color), -60px 45px 0 0 var(--box-shadow-color2), 30px 90px 0 0 var(--box-shadow-color), 60px 105px 0 0 var(--box-shadow-color2), 0px 150px 0 0 var(--box-shadow-color), -30px 135px 0 0 var(--box-shadow-color2), -60px 120px 0 0 var(--box-shadow-color), -90px 105px 0 0 var(--box-shadow-color2), 30px 165px 0 0 var(--box-shadow-color2), 60px 180px 0 0 var(--box-shadow-color), 90px 195px 0 0 var(--box-shadow-color2), 120px 210px 0 0 var(--box-shadow-color), 0px 225px 0 0 var(--box-shadow-color2), -30px 210px 0 0 var(--box-shadow-color), -60px 195px 0 0 var(--box-shadow-color2), -90px 180px 0 0 var(--box-shadow-color), -120px 165px 0 0 var(--box-shadow-color2), 30px 240px 0 0 var(--box-shadow-color), 60px 255px 0 0 var(--box-shadow-color2), 90px 270px 0 0 var(--box-shadow-color), 120px 285px 0 0 var(--box-shadow-color2), 150px 300px 0 0 var(--box-shadow-color), 0px 305px 0 0 var(--box-shadow-color), -30px 290px 0 0 var(--box-shadow-color2), -60px 275px 0 0 var(--box-shadow-color), -90px 260px 0 0 var(--box-shadow-color2), -120px 245px 0 0 var(--box-shadow-color), -150px 230px 0 0 var(--box-shadow-color2), 30px 320px 0 0 var(--box-shadow-color2), 60px 335px 0 0 var(--box-shadow-color), -90px 335px 0 0 var(--box-shadow-color), -120px 320px 0 0 var(--box-shadow-color2), -150px 305px 0 0 var(--box-shadow-color), -180px 290px 0 0 var(--box-shadow-color2);
}

h1{
  text-align: center;
  font-family: 'Pacifico', sans-serif;
  color: #ffecc4;
  font-weight: normal;
  margin-top: -45px;
}
              
            
!

JS

              
                var doc = document.getElementById("light");
var color = ["#F4D5B9", "#CB4659", "#05ECF2", "#F29E08", "#EC8878", "#9588D0"];
var i = 0;
var x = 2;
function change() {
  
  doc.style.setProperty('--box-shadow-color', color[i]);
  doc.style.backgroundColor = color[i];
  doc.style.setProperty('--box-shadow-color2', color[x]);
  i++;
  x++;
  
  if(i > color.length - 1) {
    i = 0;
  }
if(x > color.length - 1) {
  x = 0;
  }
}
setInterval(change, 1000);
              
            
!
999px

Console