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

              
                <html>
  
  <head>
  </head>

<body>
 <h1 class="title">Merry Christmas</h1>
 <!-- Begin Image -->
 <!-- Invisible Box-->
 <div class="box">
   
   <!-- mountains -->
   <div class="mountains mountains-1"></div>
   <div class="mountains mountains-2"></div>
   <div class="mountains mountains-3"></div>
    
   <!-- house -->
   <div class="house">
     <div class="door"></div>
     <div class="window window-1"></div>
     <div class="window window-2"></div>
     <div class="window window-3"></div>
     <div class="window window-4"></div>
     <div class="window window-5"></div>
   </div>
   <div class="roof">
     <div class="chimney"></div>
   </div>
   <div class="sun"></div>
   
   <!-- tree -->
   <div class="tree tree-0"></div>
   <div class="tree tree-1"></div>
   <div class="tree tree-2"></div>
   <div class="tree tree-3"></div>
   <div class="tree tree-4"></div>
   <div class="tree tree-5"></div>
   <div class="tree tree-down"></div>
   <div class="tree star"></div>
   
   <!-- little human -->
   <div class="human-head"></div>
   <div class="human-body"></div>
   <div class="heartbeat"></div>
   <div class="human-hands"></div>
   <div class="human-leg-left"></div>
   <div class="human-leg-right"></div>
   <div class="human-cup"></div>
   
 </div> <!-- End Invisible Box -->
  
  
  <div> <!-- for footer -->
      <h5 id="footer" class="title"><a href="http://www.eleftheriabatsou.com" target="_blank">Eleftheria</a> | <a href="https://blog.eleftheriabatsou.com/creating-a-christmas-scene" target="_blank">Tutorial</a> | <a href="https://www.youtube.com/channel/UCC-WwYv3DEW7Nkm_IP6VeQQ" target="_blank"> Coding videos </a></h5>
    </div> <!-- end footer -->
  
</body>
</html>
              
            
!

CSS

              
                $black: #000;
$white: #fff;
$bg-color: #FFC0CB; //linear-gradient(120deg, #fccb90 0%, #d57eeb 100%);

$mountains: rgba(137, 43, 17, 0.8) ; //brown
$roof:#BC1818;//red
$door:#BC3C18; //red-brown
$house:#C1B5B2; //grey
$window:#D8D8D8; //light-grey
$sun:rgba(216, 216, 216, 0.3);
$star: rgba(255,235,59 ,0.8);
$human: #8A716A; //dark grey


.title{text-align: center;
font-family: "Mountains of Christmas"}

#footer a:link{color:black}
#footer a:visited{color:black}
#footer a:hover{color: $roof}

body{background: $bg-color;}

.box{  
  position: relative;
  margin: auto;
  display: block;
  /*optional background or border*/
  //border: solid 4px red;
  
  margin-top: 2%;
  width: 630px;
  height: 460px;
  background: none;
}

.mountains{
  position: absolute;
  background: $mountains;
  border-top: 25px solid white;
  //as it is from clippy tool
  -webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  
  &.mountains-1{
    top: 5%;
    left: 25%;
    width: 55%;
    height: 85%;
 }
  &.mountains-2{
    top: 35%; 
    left: 15%;
    width: 25%;
    height: 55%;
  }
  &.mountains-3{
    top: 30%; 
    right: 5%;
    width: 35%;
    height: 60%;
  }  
}

.house{
  position: absolute;
  top: 65%;
  left: 35%;
  width: 32%;
  height: 35%;
  background: $house;
}

 .window{
  position: absolute; 
  width: 14%; 
  height: 20%;
  background: $window;
  
   &.window-1{
    top: 65%;
    left: 16%; 
    
    -webkit-animation: window-1 2s linear 1s infinite both;
	        animation: window-1 2s linear 1s infinite both;
  }
  &.window-2{
    top: 65%;
    right: 16%; 
    
    -webkit-animation: window-2 3s linear 1s infinite both;
	        animation: window-2 3s linear 1s infinite both;
  }
  &.window-3{
    top: 25%;
    left: 16%; 
  }
  &.window-4{
    top: 25%;
    right: 16%; 
  }
  &.window-5{
    top: 25%;
    left: 44%; 
    
    -webkit-animation: window-5 3s linear 2s infinite both;
	        animation: window-5 3s linear 2s infinite both;
  }
 }

.door{
  position: absolute;
  top: 65%;
  left: 44%; //35+9=44
  width: 14%; //32-14=18, 18/2=9
  height: 35%;
  background: $door;
}

.roof{
  position: absolute;
  top: 49%;
  left: 35%;
  width: 32%;
  height: 15%;
  background: $roof;
  border-top: 5px solid white;
  -webkit-clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
}

.chimney{
  position: absolute;
  top: 32%;
  left: 72%;
  width: 6%;
  height: 35%;
  background: $mountains;
  border-top: 3px solid white;
}

.sun{
  position: absolute;
  top: -20%;
  left: 42%;
  width: 60%;
  height: 65%;
  background: $sun;
  border-radius: 45%;
}

.tree{
  position: absolute;
  height: 8%;
  -webkit-clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
 
  &.tree-0{
    top: 50%; 
    left: 79%;
    width: 6%;
    background:rgba(220,237,200 ,0.5);
    
    -webkit-animation: tree-0 3s 1s ease-in-out infinite both;
	        animation: tree-0 3s 1s ease-in-out infinite both;
  }
  
  @-webkit-keyframes tree-0{
  0%,
  50%,
  100% {
    opacity: 1;
  }
  25%,
  75% {
    opacity: 0;
  }
}
@keyframes tree-0{
  0%,
  50%,
  100% {
    opacity: 1;
  }
  25%,
  75% {
    opacity: 0;
  }
}
  
  &.tree-1{
    top: 57%; 
    left: 78%;
    width: 8%;
    background:rgba(220,237,200 ,0.6);
    
    -webkit-animation: tree-1 3s 2s ease-in-out infinite both;
	        animation: tree-1 3s 2s ease-in-out infinite both;
  }
  
  @-webkit-keyframes tree-1{
  0%,
  50%,
  100% {
    opacity: 1;
  }
  25%,
  75% {
    opacity: 0;
  }
}
@keyframes tree-1{
  0%,
  50%,
  100% {
    opacity: 1;
  }
  25%,
  75% {
    opacity: 0;
  }
}
  
  &.tree-2{
    top: 64%; 
    left: 77%;
    width: 10%;
    background:rgba(174,213,129 ,0.6);
    
    -webkit-animation: tree-0 3s 3s ease-in-out infinite both;
	        animation: tree-0 3s 3s ease-in-out infinite both;
  }
  &.tree-3{
    top: 71%; 
    left: 76%;
    width: 12%;
    background:rgba(139,195,74 ,0.6);
    
    -webkit-animation: tree-1 3s 4s ease-in-out infinite both;
	        animation: tree-1 3s 4s ease-in-out infinite both;
  }
  &.tree-4{
    top: 78%; 
    left: 75%;
    width: 14%;
    background:rgba(104,159,56 ,0.6);
    
    -webkit-animation: tree-0 3s 5s ease-in-out infinite both;
	        animation: tree-0 3s 5s ease-in-out infinite both;
  }
  &.tree-5{
    top: 85%;
    left: 74%;
    width: 16%;
    background:rgba(51,105,30 ,0.6);
    
    -webkit-animation: tree-1 3s 6s ease-in-out infinite both;
	        animation: tree-1 3s 6s ease-in-out infinite both;
  }
  
  &.star{
    top: 45%;
    left: 79%;
    width:6%;
    background:$star;
        
    border-top: 6px solid white;
    //star is it is from the clippy tool
    -webkit-clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  }
  
  &.tree-down{
    top: 92%;
    left: 79%;
    width:6%;
    background:$mountains;
  }
 }


//little-human
.human-head{
  position: absolute;
  top: 85%;
  left: 14%;
  width: 4%;
  height: 5%;
  border-radius: 50%;
  background: $human;
}
.human-body{
  position: absolute;
  top: 90%;
  left: 14%;
  width: 4%;
  height: 8%;
  border-radius: 40%;
  background: $human;
}
.heartbeat {
  position: absolute;
  top: 91%;
  left: 15.5%;
  width: 2%;
  height: 2%;
  border-radius: 40%;
  background: red;
  z-index: 1;
  -webkit-clip-path: polygon(54% 40%, 91% 1%, 81% 60%, 50% 100%, 24% 63%, 19% 0);
clip-path: polygon(54% 40%, 91% 1%, 81% 60%, 50% 100%, 24% 63%, 19% 0);
  
  -webkit-animation: heartbeat 1.5s ease-in-out infinite both;
	        animation: heartbeat 1.5s ease-in-out infinite both;
}

.human-hands{
  position: absolute;
  top: 90%;
  left: 12.8%;
  width: 5%;
  height:7%;
  border-radius: 20%;
  border: 4px solid $human;
  transform: rotate(45deg);
  background: none;
}
.human-leg-left{
  position: absolute;
  top: 96%;
  left: 14.2%;
  width: 1.6%;
  height:7%;
  border-radius: 20%;
  background: $human;
}
.human-leg-right{
  position: absolute;
  top: 96%;
  left: 16%;
  width: 1.6%;
  height:7%;
  border-radius: 20%;
  background: $human;
}

.human-cup{
  position: absolute;
  top: 81.5%;
  left: 14%;
  width: 4%;
  height:2%;
  border-radius: 40%;
  border-top: 6px solid white;
  border-bottom: 6px solid black;
  background: red;
  //z-index: -1;
  //penatgon
  -webkit-clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}


@-webkit-keyframes heartbeat  {
  from {
    -webkit-transform: scale(1.1);
            transform: scale(1.1);
    -webkit-transform-origin: center center;
            transform-origin: center center;
    -webkit-animation-timing-function: ease-out;
            animation-timing-function: ease-out;
  }
  10% {
    -webkit-transform: scale(0.91);
            transform: scale(0.91);
    -webkit-animation-timing-function: ease-in;
            animation-timing-function: ease-in;
  }
  17% {
    -webkit-transform: scale(0.98);
            transform: scale(0.98);
    -webkit-animation-timing-function: ease-out;
            animation-timing-function: ease-out;
  }
  33% {
    -webkit-transform: scale(0.87);
            transform: scale(0.87);
    -webkit-animation-timing-function: ease-in;
            animation-timing-function: ease-in;
  }
  45% {
    -webkit-transform: scale(1);
            transform: scale(1);
    -webkit-animation-timing-function: ease-out;
            animation-timing-function: ease-out;
  }
}
@keyframes heartbeat {
  from {
    -webkit-transform: scale(1);
            transform: scale(1);
    -webkit-transform-origin: center center;
            transform-origin: center center;
    -webkit-animation-timing-function: ease-out;
            animation-timing-function: ease-out;
  }
  10% {
    -webkit-transform: scale(0.91);
            transform: scale(0.91);
    -webkit-animation-timing-function: ease-in;
            animation-timing-function: ease-in;
  }
  17% {
    -webkit-transform: scale(0.98);
            transform: scale(0.98);
    -webkit-animation-timing-function: ease-out;
            animation-timing-function: ease-out;
  }
  33% {
    -webkit-transform: scale(0.87);
            transform: scale(0.87);
    -webkit-animation-timing-function: ease-in;
            animation-timing-function: ease-in;
  }
  45% {
    -webkit-transform: scale(1);
            transform: scale(1);
    -webkit-animation-timing-function: ease-out;
            animation-timing-function: ease-out;
  }
}


//windows
@-webkit-keyframes window-1 {
  0%,
  100% {
    opacity: 1;
  }
  41.99% {
    opacity: 1;
  }
  42% {
    opacity: 0;
  }
  43% {
    opacity: 0;
  }
  43.01% {
    opacity: 1;
  }
  45.99% {
    opacity: 1;
  }
  46% {
    opacity: 0;
  }
  46.9% {
    opacity: 0;
  }
  46.91% {
    opacity: 1;
  }
  51.99% {
    opacity: 1;
  }
  52% {
    opacity: 0;
  }
  52.8% {
    opacity: 0;
  }
  52.81% {
    opacity: 1;
  }
}
@keyframes window-1 {
  0%,
  100% {
    opacity: 1;
  }
  41.99% {
    opacity: 1;
  }
  42% {
    opacity: 0;
  }
  43% {
    opacity: 0;
  }
  43.01% {
    opacity: 1;
  }
  45.99% {
    opacity: 1;
  }
  46% {
    opacity: 0;
  }
  46.9% {
    opacity: 0;
  }
  46.91% {
    opacity: 1;
  }
  51.99% {
    opacity: 1;
  }
  52% {
    opacity: 0;
  }
  52.8% {
    opacity: 0;
  }
  52.81% {
    opacity: 1;
  }
}



@-webkit-keyframes window-2 {
  0%,
  100% {
    opacity: 1;
  }
  41.99% {
    opacity: 1;
  }
  42% {
    opacity: 0;
  }
  43% {
    opacity: 0;
  }
  43.01% {
    opacity: 1;
  }
  45.99% {
    opacity: 1;
  }
  46% {
    opacity: 0;
  }
  46.9% {
    opacity: 0;
  }
  46.91% {
    opacity: 1;
  }
  51.99% {
    opacity: 1;
  }
  52% {
    opacity: 0;
  }
  52.8% {
    opacity: 0;
  }
  52.81% {
    opacity: 1;
  }
}
@keyframes window-2 {
  0%,
  100% {
    opacity: 1;
  }
  41.99% {
    opacity: 1;
  }
  42% {
    opacity: 0;
  }
  43% {
    opacity: 0;
  }
  43.01% {
    opacity: 1;
  }
  45.99% {
    opacity: 1;
  }
  46% {
    opacity: 0;
  }
  46.9% {
    opacity: 0;
  }
  46.91% {
    opacity: 1;
  }
  51.99% {
    opacity: 1;
  }
  52% {
    opacity: 0;
  }
  52.8% {
    opacity: 0;
  }
  52.81% {
    opacity: 1;
  }
}


@-webkit-keyframes window-5 {
  0%,
  100% {
    opacity: 1;
  }
  41.99% {
    opacity: 1;
  }
  42% {
    opacity: 0;
  }
  43% {
    opacity: 0;
  }
  43.01% {
    opacity: 1;
  }
  45.99% {
    opacity: 1;
  }
  46% {
    opacity: 0;
  }
  46.9% {
    opacity: 0;
  }
  46.91% {
    opacity: 1;
  }
  51.99% {
    opacity: 1;
  }
  52% {
    opacity: 0;
  }
  52.8% {
    opacity: 0;
  }
  52.81% {
    opacity: 1;
  }
}
@keyframes window-5 {
  0%,
  100% {
    opacity: 1;
  }
  41.99% {
    opacity: 1;
  }
  42% {
    opacity: 0;
  }
  43% {
    opacity: 0;
  }
  43.01% {
    opacity: 1;
  }
  45.99% {
    opacity: 1;
  }
  46% {
    opacity: 0;
  }
  46.9% {
    opacity: 0;
  }
  46.91% {
    opacity: 1;
  }
  51.99% {
    opacity: 1;
  }
  52% {
    opacity: 0;
  }
  52.8% {
    opacity: 0;
  }
  52.81% {
    opacity: 1;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console