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="window">
  <span class="shutters"></span>
  <span class="shutters"></span>
  
  <div class="tree">
    <span class="leaves">
      <span class="pear"></span>
      <span class="pear"></span>
      <span class="pear"></span>

      <span class="bird">
        <span class="crest"></span>
      </span>

    </span>
    <span class="trunk"></span>  
  </div>

  <div class="ground"></div>

</div>

<h1>The First Day of CSS-mas</h1>
<p>Press or hover over to open!</p>
            
          
!
            
              $day-text-light:#b0302d;
$day-text-dark:#8d2623;

* {
  box-sizing:border-box;
  position:relative;
}
body {
  background:#333;
  background-image:repeating-linear-gradient(90deg,rgba(#567c15,.8),rgba(#567c15,.8) 5vmin,rgba(#a5be3e,.8) 5vmin,rgba(#a5be3e,.8) 10vmin);
  font-size:10px;
  perspective: 1000; /* Thanks to @davidmogar, this makes the shutters actually look like opening shutters. No complex 3d transforms needed! Everyone loves that. =D */
}
h1 {
  color:#fff;
  font-family:"Playfair Display";
  font-size:2rem;
  font-style:italic;
  margin:1.25rem auto;
  text-align:center;
  text-shadow:0 0 .5rem #000;
}
p {
  color:#fff;
  font-size:1rem;
  text-align:center;
  text-shadow:0 0 .5rem #000;
}
/* Window
--------------------*/
.window {
  background:#5eb3b3;
  border:2em solid #362f1f;
  height:25rem;
  margin:1rem auto 0;
  width:25rem;
}
.shutters {
  background:#532900;
  border:1px solid #281400;
  float:left;
  height:100%;
  overflow:hidden;
  transition:transform 800ms;
  width:50%;
  z-index:15;
}
.window:hover .shutters, .window:focus .shutters { /* Work on hover or touch. Cancel when input device is outside the window. */
  transform:rotateY(170deg); /* "Opens" the shutters. */
}
.window:hover .shutters:first-child, .window:focus .shutters:first-child {
  transform: rotateY(-170deg);
}
.shutters:nth-child(1) {
  transform-origin:0%; /* Set the "hinge" on the left-hand side. This is necessary because the default origin is 0,0 or center. */
}
.shutters:nth-child(2) {
  transform-origin:100%; /* Set the "hinge" on the right-hand side. */
}

/* day text
--------------------*/
.shutters:after {
  content:"1";
  color:#fff;
  font-family:"Playfair Display";
  font-size:18rem;
  position:absolute;
  top:-1rem;
}
.shutters:nth-child(1):after {
  color:$day-text-light;
  left:66.5%;
}
.shutters:nth-child(2):after {
  color:$day-text-dark;
  right:72.5%;
}
.window:hover .shutters:after, .window:focus .shutters:after {
  visibility:hidden;
  transition:visibility 220ms;
}
.window .shutters:after, .window .shutters:after {
  visibility:visible;
  transition:visibility 400ms 220ms;
}
/* Tree
--------------------*/
.tree {
  height:20rem;
  margin:2rem auto 0;
  width:20rem;
}
.tree * {
  display:block;
  margin:auto;
}
.leaves {
  background:#15601b;
  border-radius:100%;
  height:70%;
  width:70%;
}
.trunk {
  background:#362f1f;
  height:35%;
  margin-top:-1%;
  width:15%;
  z-index:-0;
}
.ground {
  background:#15601b;
  bottom:0;
  display:block;
  height:2em;
  position:absolute;
  width:100%;
}
.pear {
  background:#b2db00;
  border-radius:10% 50% 70%;
  /* border-bottom:.25rem solid #92b000; */
  display:block;
  height:4em;
  margin:auto;
  transform:rotate(45deg);
  width:4em;
}
.pear:before {
  background:#567c15;
  border-radius:0 100%;
  content:"";
  display:block;
  height:2em;
  left:-1em;
  position:relative;
  top:-2em;
  transform:rotate(45deg);
  width:2em;
  z-index:-1;
}
.pear:nth-child(1) {
  left:3rem;
  top:2rem;
}
.pear:nth-child(2) {
  right:6rem;
  top:6rem;
}
.pear:nth-child(3) {
  left:4rem;
  top:6rem;
}
/* Bird
--------------------*/
.bird {
  background:#a38c5c;
  border-right:1rem solid #6c5d3e;
  border-radius:0 3rem;
  bottom:1rem;
  height:4rem;
  width:5rem;
}
.bird:before {
  background:#6c5d3e;
  border-radius:2rem 1rem 1rem 0;
  content:"";
  display:block;
  height:2rem;
  position:absolute;
  top:-2rem;
  width:3rem;
}
.bird:after {
  border:.25rem solid transparent;
	border-left:.5rem solid #fde22f;
  display:block;
  content:"";
  position:absolute;
  right:.3rem;
  top:-1.25rem;
}
.crest {
  background:#6c5d3e;
  border-radius:100%;
  bottom:2.7rem;
  height:.5rem;
  right:-.25rem;
  transform:rotate(35deg);
  width:.5rem;
}
.crest:before {
  border:.25rem solid transparent;
  border-top:.5rem solid #6c5d3e;
  content:"";
  display:block;
  left:0;
  right:0;
  margin:auto;
  position:absolute;
  top:.4rem;
}
            
          
!
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