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.

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

  <div class="contain">
    <div class="ring"></div>
    <div class="ring"></div>
    <div class="ring"></div>
    <div class="ring"></div>
    <div class="ring"></div>
  </div>
</div>

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

CSS

              
                $stripe-light:#c8e6e6;
$stripe-dark:#5eb3b3;
$day-text-light:#a5be3e;
$day-text-dark:#567c15;

@mixin pseudo($width,$height) {
  content:"";
  display:block;
  height:$height;
  width:$width;
}

* {
  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;
}
/* Window
--------------------*/
.window {
  background:#932724;
  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:"5";
  color:#fff;
  font-family:"Playfair Display";
  font-size:18rem;
  top:-1rem;
  position:absolute;
}
.shutters:nth-child(1):after {
  color:$day-text-light;
  left:63.5%;
}
.shutters:nth-child(2):after {
  color:$day-text-dark;
  right:63.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;
}
/* Golden rings
--------------------*/
.contain {
  display:block;
  transform:perspective(0); /* Undoing the perspective set on the body so we can spin the rings correctly (i.e. without a lot of silly math or strange perspectives haha). Setting perspective as a function instead of a property sets the perspective on the element, not the stack. */
}
.ring {
  animation:spinY linear 1000ms infinite backwards;
  background:transparent;
  border:.5rem solid #fa0;
  border-radius:100%;
  display:block;
  height:4rem;
  position:absolute;
  width:4rem;
}
.ring:nth-of-type(1) {
  left:calc(50% - 2rem);
  top:4.5rem;
}
.ring:nth-of-type(2) {
  /* animation-delay:1000ms; */
  right:4rem;
  top:8rem;
}
.ring:nth-of-type(3) {
  /* animation-delay:2000ms; */
  right:6rem;
  top:14rem;
}
.ring:nth-of-type(4) {
  /* animation-delay:3000ms; */
  left:6rem;
  top:14rem;
}
.ring:nth-of-type(5) {
  /* animation-delay:4000ms; */
  left:4rem;
  top:8rem;
}
.upholstery {
  background:
radial-gradient(hsl(0, 100%, 27%) 4%, hsl(0, 100%, 18%) 9%, hsla(0, 100%, 20%, 0) 9%) 0 0,
radial-gradient(hsl(0, 100%, 27%) 4%, hsl(0, 100%, 18%) 8%, hsla(0, 100%, 20%, 0) 10%) 50px 50px,
radial-gradient(hsla(0, 100%, 30%, 0.8) 20%, hsla(0, 100%, 20%, 0)) 50px 0,
radial-gradient(hsla(0, 100%, 30%, 0.8) 20%, hsla(0, 100%, 20%, 0)) 0 50px,
radial-gradient(hsla(0, 100%, 20%, 1) 35%, hsla(0, 100%, 20%, 0) 60%) 50px 0,
radial-gradient(hsla(0, 100%, 20%, 1) 35%, hsla(0, 100%, 20%, 0) 60%) 100px 50px,
radial-gradient(hsla(0, 100%, 15%, 0.7), hsla(0, 100%, 20%, 0)) 0 0,
radial-gradient(hsla(0, 100%, 15%, 0.7), hsla(0, 100%, 20%, 0)) 50px 50px,
linear-gradient(45deg, hsla(0, 100%, 20%, 0) 49%, hsla(0, 100%, 0%, 1) 50%, hsla(0, 100%, 20%, 0) 70%) 0 0,
linear-gradient(-45deg, hsla(0, 100%, 20%, 0) 49%, hsla(0, 100%, 0%, 1) 50%, hsla(0, 100%, 20%, 0) 70%) 0 0;
background-color: #300; 
background-size: 100px 100px;
}
/* animations
--------------------*/
@keyframes spinY {
  0% {
    box-shadow:0 1.5rem 3rem rgba(0,0,0,.0);
    transform:rotateY(-90deg);
  }
  50% {
    box-shadow:0 1.5rem 3rem rgba(0,0,0,.2);
  }
  100% {
    box-shadow:0 1.5rem 3rem rgba(0,0,0,.0);
    transform:rotateY(90deg);
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console