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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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="bird">
      <span class="head">
        <i class="fa fa-music"></i>
        <i class="fa fa-music"></i>
      </span>
      <span class="body"></span>
    </div>
    <div class="bird">
      <span class="head">
        <i class="fa fa-music"></i>
        <i class="fa fa-music"></i>
      </span>
      <span class="body"></span>
    </div>
    <div class="bird">
      <span class="head">
        <i class="fa fa-music"></i>
        <i class="fa fa-music"></i>
      </span>
      <span class="body"></span>
    </div>
    <div class="bird">
      <span class="head">
        <i class="fa fa-music"></i>
        <i class="fa fa-music"></i>
      </span>
      <span class="body"></span>
    </div>
  
</div>

<h1>The Fourth Day of CSS-mas</h1>
<p>Press or hover over to open!</p>
            
          
!
            
              $bird-width:10rem;
$bird-height:5rem;
$body-color:#b5302d;
$wing-color:#932724;
$head-color:#b5302d;
$tail-color:$wing-color;
$eye-color:#222;
$beak-color:#fa0;
$window-bg:#5a827c;
$day-text-light:#c8e6e6;
$day-text-dark:#5eb3b3;
/* @mixin half-circle($width,$height) { */
@mixin half-circle($width) {
  border-radius:0 0 $width $width;
  height:$width/2;
  width:$width;
}
@mixin pseudo($size) {
  content:"";
  display:block;
  height:$size;
  width:$size;
}

* {
  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);
  /* background-image:repeating-linear-gradient(90deg,rgba(#5eb3b3,.8),rgba(#5eb3b3,.8) 5vmin,rgba(#c8e6e6,.8) 5vmin,rgba(#c8e6e6,.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:$window-bg;
  border:2em solid #362f1f;
  height:25rem;
  margin:1rem auto 0;
  position:relative;
  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:"4";
  color:#fff;
  font-family:"Playfair Display";
  font-size:18rem;
  top:-1rem;
  position:absolute;
}
.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 200ms;
}
.window .shutters:after, .window .shutters:after {
  visibility:visible;
  transition:visibility 400ms 250ms;
}
/* bird
--------------------*/
.bird {
  display:block;
  height:$bird-height;
  position:absolute;
  width:$bird-width;
}
.bird > * {
  display:block;
}
.head {
  background:$head-color;
  border-radius:100%;
  bottom:60%;
  height:80%;
  position:absolute;
  right:-20%;
  width:40%;
  z-index:5;
}
.head:before,.head:after {
  @include pseudo(1rem);
}
.head:before {
  background:$eye-color;
  border-radius:100%;
  left:40%;
  position:relative;
  top:30%;
}
.head:after {
  @include pseudo(0);
  border:.5rem solid transparent;
  border-left:1rem solid $beak-color;
  position:absolute;
  right:-1.4rem;
  top:1.5rem;
}
.body {
  @include half-circle($bird-width);
  background:$body-color;
}
.body:before,
.body:after {
  @include pseudo(1rem);
  z-index:6;
}
.body:before {
  @include half-circle(7rem);
  background:$wing-color;
  right:2rem;
  position:absolute;
  z-index:10;
}
.body:after {
  @include pseudo(0);
  border-left:3rem solid transparent;
  border-top:2rem solid $tail-color;
  left:-1rem;
  position:absolute;
}
/* additional birds
--------------------*/
.bird:nth-of-type(n) {
  left:2rem;
  top:3rem;
  transform:scale(.75);
}
.bird:nth-of-type(2) {
  left:12rem;
  top:4.5rem;
  transform:scale(.75) rotate(90deg);
}
.bird:nth-of-type(3) {
  left:10.5rem;
  top:14.5rem;
  transform:scaleX(-1);
  transform:scale(.75) rotate(180deg);
}
.bird:nth-of-type(4) {
  left:.5rem;
  top:13rem;
  transform:scale(.75) rotate(270deg);
}

.fa {
  color:#222;
  font-size:2rem;
  position:absolute;
  top:-2rem;
}
.fa ~ .fa {
  right:-1rem;
  top:3rem;
}
            
          
!
999px
Loading ..................

Console