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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <div class="window">
  <!-- <span class="halfStyle" data-content="X">X</span> -->
  <!-- <span class="number">1</span> -->
  <span class="shutters"></span>
  <span class="shutters"></span>

  <div class="human">
    <span class="head">
      <span class="hair"></span>
    </span>
    <span class="body">
      <span class="pail"></span>
      <span class="pail"></span>
    </span>
    <span class="skirt"></span>
  </div>
  
  <div class="human alt1">
    <span class="head">
      <span class="hair"></span>
    </span>
    <span class="body">
      <span class="pail"></span>
      <span class="pail"></span>
    </span>
    <span class="skirt"></span>
  </div>
  
  <div class="human alt2">
    <span class="head">
      <span class="hair"></span>
    </span>
    <span class="body">
      <span class="pail"></span>
      <span class="pail"></span>
    </span>
    <span class="skirt"></span>
  </div>
  
  <div class="human alt3">
    <span class="head">
      <span class="hair"></span>
    </span>
    <span class="body">
      <span class="pail"></span>
      <span class="pail"></span>
    </span>
    <span class="skirt"></span>
  </div>

  <div class="human alt2">
    <span class="head">
      <span class="hair"></span>
    </span>
    <span class="body">
      <span class="pail"></span>
      <span class="pail"></span>
    </span>
    <span class="skirt"></span>
  </div>

  <div class="human alt3">
    <span class="head">
      <span class="hair"></span>
    </span>
    <span class="body">
      <span class="pail"></span>
      <span class="pail"></span>
    </span>
    <span class="skirt"></span>
  </div>

  <div class="human">
    <span class="head">
      <span class="hair"></span>
    </span>
    <span class="body">
      <span class="pail"></span>
      <span class="pail"></span>
    </span>
    <span class="skirt"></span>
  </div>

  <div class="human alt1">
    <span class="head">
      <span class="hair"></span>
    </span>
    <span class="body">
      <span class="pail"></span>
      <span class="pail"></span>
    </span>
    <span class="skirt"></span>
  </div>
</div>

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

CSS

            
              $thing-width:25%; /* Since we're nearing the end of birds, change to "thing" from "bird." */
$dress-color:#5aaac3;
$apron-color:#eee;
$hair-color:#fecf30;
$face-color:#ffdfdf;
$eye-color:#86bf86;
$window-bg:#8d2623;
$stripe-light:#a5be3e;
$stripe-dark:#567c15;
$day-text-light:#c8e6e6;
$day-text-dark:#5eb3b3;
@mixin pseudo($size) {
  content:"";
  display:block;
  height:$size;
  width:$size;
}
@mixin alts($alt-number,$alt-hair-color,$alt-skin-color,$alt-eye-color) {
  .human.alt#{$alt-number} .hair:before,.human.alt#{$alt-number} .hair:after,.human.alt#{$alt-number} .head { /* Interpolation to print out the variable. Neato! */
    border-color:$alt-hair-color;
  }
  .human.alt#{$alt-number} .head, .human.alt#{$alt-number} .pail:after {
    background:$alt-skin-color;
  }
  .human.alt#{$alt-number} .head:before,.human.alt#{$alt-number} .head:after {
    background:$alt-eye-color;
  }
}

* {
  box-sizing:border-box;
  position:relative;
}
body {
  background:#333;
  background-image:repeating-linear-gradient(90deg,rgba($stripe-dark,.8),rgba($stripe-dark,.8) 5vmin,rgba($stripe-light,.8) 5vmin,rgba($stripe-light,.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;
}
span {
  display:block;
}
/* Window
--------------------*/
.window {
  background:$window-bg;
  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:"8";
  color:#fff;
  font-family:"Playfair Display";
  font-size:18rem;
  top:-1rem;
  position:absolute;
}
.shutters:nth-child(1):after {
  color:$day-text-light;
  left:55%;
}
.shutters:nth-child(2):after {
  color:$day-text-dark;
  right:55%;
}
.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;
}
/* maid
--------------------*/
.human {
  /* display:inline-block; */
  height:$thing-width*2;
  /* margin-right:-.3rem; */
  position:absolute;
  top:0;
  width:$thing-width;
}
.head {
  background:$face-color;
  border-radius:50%;
  border-top:.5rem solid $hair-color;
  height:20%;
  margin:auto;
  width:50%;
}
/* eyes
--------------------*/
.head:before, .head:after {
  @include pseudo(.4rem);
  background:$eye-color;
  border-radius:100%;
  height:.6rem;
  position:absolute;
  top:.5rem;
}
.head:before {
  left:.8rem;
}
.head:after {
  right:.8rem;
}
/* hair
--------------------*/
.hair:before, .hair:after {
  @include pseudo(1.5rem);
  border-radius:50%;
  border-bottom:.5rem solid $hair-color;
  height:1rem;
  position:absolute;
  top:.5rem;
}
.hair:after {
  right:2.5rem;
}
.hair:before {
  left:2.5rem;
}
/* body
--------------------*/
.body {
  background:$dress-color;
  border:.5rem solid $apron-color;
  border-bottom:2rem solid $apron-color;
  border-radius:10% 10% 30% 30%;
  border-top:0;
  height:30%;
  margin:auto;
  width:40%;
  z-index:3;
}
/* arms
--------------------*/
.body:before,.body:after {
  @include pseudo(0);
  border:1rem solid transparent;
	border-bottom-color:$dress-color;
  border-width:0 .5rem 3rem .5rem;
  height:0;
  position:absolute;
  top:.5rem;
  z-index:1;
}
.body:before {
  left:-1rem;
  transform:rotate(34deg);
  transform-origin:right top;
}
.body:after {
  right:-1rem;
  transform:rotate(-30deg);
  transform-origin:left top;
}
/* skirt
--------------------*/
.skirt {
  background:$dress-color;
  border-radius:50% 50% 0 0;
  bottom:0;
  height:52%; /* Creates the overlap between skirt and body. */
  overflow:hidden;
  position:absolute;
  width:100%;
}
/* apron
--------------------*/
.skirt:before {
  @include pseudo(40%);
  height:0;
  margin:auto;
  border:1rem solid transparent;
	border-bottom-color:$apron-color;
  border-width:0 1rem 4rem 1rem;
}
/* pail
--------------------*/
.pail {
  border:1rem solid transparent;
	border-top-color:#aaa;
  border-width:2rem .4rem 0 .4rem;
  height:0;
  position:absolute;
  width:2rem;
  z-index:10;
}
.pail:first-of-type {
  left:-3rem;
  top:4rem;
}
.pail:last-of-type {
  right:-3rem;
  top:4rem;
}
.pail:before,.pail:after {
  @include pseudo(1rem);
  position:absolute;
}
.pail:before {
  border:2px solid #aaa;
  border-bottom:0;
  border-radius:1rem 1rem 0 0;
  bottom:2rem;
  left:-.4rem;
  width:calc(2rem - 4px);
}
/* hands
--------------------*/
.pail:after {
  background:$face-color;
  border-radius:50%;
  bottom:2.8rem;
}
/* iterations
--------------------*/
.human:nth-of-type(1n+5) {
  top:$thing-width*2;
}
.human:nth-of-type(1),.human:nth-of-type(5) {
  left:0;
}
.human:nth-of-type(2),.human:nth-of-type(6) {
  left:$thing-width;
}
.human:nth-of-type(3),.human:nth-of-type(7) {
  right:$thing-width;
}
.human:nth-of-type(4),.human:nth-of-type(8) {
  right:0;
}
.human:nth-of-type(1),.human:nth-of-type(4) {
  transform:translateY(1.5rem) scale(.65);
}
.human:nth-of-type(5),.human:nth-of-type(8) {
  transform:translateY(-1.5rem) scale(.65);
}
.human:nth-of-type(2),.human:nth-of-type(3) {
  transform:translateY(-1rem) scale(.65);
}
.human:nth-of-type(6),.human:nth-of-type(7) {
  transform:translateY(1rem) scale(.65);
}

@include alts(1,#292b30,#b19178,#866340);
@include alts(2,#483522,#e3b88c,#86bf86);
@include alts(3,#866340,#ffdfdf,#866340);
            
          
!

JS

            
              
            
          
!
999px

Console