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="window">
  <span class="shutters"></span>
  <span class="shutters"></span>

  <div class="bush">

    <div class="bird one">
      <span class="head"></span>
      <span class="body"></span>
      <span class="tail"></span>
    </div>

    <div class="bird two">
      <span class="head"></span>
      <span class="body"></span>
      <span class="tail"></span>
    </div>

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

<h1>The Second Day of CSS-mas</h1>
<p>Press or hover over to open!</p>
              
            
!

CSS

              
                $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(180deg); /* "Opens" the shutters. */
}
.window:hover .shutters:first-child, .window:focus .shutters:first-child {
  transform: rotateY(-180deg);
}
.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:"2";
  color:#fff;
  font-family:"Playfair Display";
  font-size:18rem;
  position:absolute;
  top:-1rem;
}
.shutters:nth-child(1):after {
  color:$day-text-light;
  left:58%;
}
.shutters:nth-child(2):after {
  color:$day-text-dark;
  right:58%;
}
.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;
}
/* Bird
--------------------*/
.bird {
  display:inline-block;
  position:absolute;
  transform:scaleX(-1) rotate(-45deg);
  z-index:10;
}
.bird.one {
  right:3rem;
  top:-3rem;
}
.bird.two {
  left:2rem;
  top:2rem;
}
.body {
  background:#bec3c6;
  border-radius:0 0 8rem 8rem;
  bottom:0rem;
  display:block;
  height:3.5rem;
  position:relative;
  width:7rem;
}
.body:before,
.body:after {
  border-radius:0 0 5rem 5rem;
  bottom:0;
  content:"";
  display:block;
  height:2.5rem;
  position:absolute;
  transform-origin:100% 0; /* Rotate the wings from a point on the body instead of the center of the element. */
  width:5rem;
}
.one .body:before {
  background:#9ea4a7;
  transform:rotate(85deg) scale(.8);
  z-index:-1;
}
.body:after {
  background:#b4b9bc;
  background:#a9aeb1;
}
.one .body:after {
  transform:rotate(45deg);
}
.two .body:after {
  top:0;
  right:2rem;
  z-index:2;
}
.head {
  background:#bec3c6;
  display:block;
  height:2.5rem;
  position:absolute;
  right:-1.5rem;
  width:2.5rem;
  z-index:1;
}
.one .head {
  border-radius:1rem 2rem 0 2rem;
}
.two .head {
  border-radius:0rem 2rem 1rem 2rem;
  right:0rem;
  top:-2rem;
}
.head:after {
  background:#fff;
  border-radius:100%;
  content:"";
  display:block;
  height:.5rem;
  left:1rem;
  position:absolute;
  top:1rem;
  width:.5rem;
}
.tail {
  border:.25rem solid transparent;
  border-left:2rem solid #bec3c6;
  display:block;
  height:2rem;
  left:-1.5rem;
  position:absolute;
  top:-.25rem;
  width:3rem;
}
/* Bush
--------------------*/
.bush {
  background:#27720e;
  border-radius:10rem;
  /* border-left:1rem solid #215e0d; */
  bottom:2rem;
  height:10rem;
  margin:0 2em;
  position:absolute;
  width:20rem;
}
.bush:before,.bush:after {
  background:#27720e;
  /* border-left:1rem solid #215e0d; */
  content:"";
  display:block;
  position:absolute;
}
.bush:before {
  height:8rem;
  border-radius:90% 100%;
  bottom:5rem;
  left:2rem;
  /* transform:rotate(90deg); */
  width:8rem;
}
.bush:after {
  border-radius:100% 80%;
  bottom:5rem;
  height:10rem;
  right:2rem;
  width:10rem;
}
.ground {
  background:#215f0c;
  bottom:0;
  height:3rem;
  position:absolute;
  width:100%;
}
              
            
!

JS

              
                
              
            
!
999px

Console