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="container">
  <div class="sh sheet-1">
    <div class="face">
      <div class="eye left"></div>
      <div class="eye right"></div>
      <div class="mouth"></div>
    </div>
  </div>
  <div class="sh sheet-2"></div>
  <div class="sh sheet-3"></div>
  <div class="sh sheet-4"></div>
  <div class="sh sheet-5"></div>
  <div class="sh sheet-6"></div>
  <div class="sh sheet-7"></div>
  <div class="sh sheet-8"></div>
  <div class="sh sheet-9"></div>
  <div class="sh sheet-10"></div>
  <div class="sh sheet-11"></div>
  <div class="sh sheet-12"></div>
  <div class="sh sheet-13"></div>
  <div class="sh sheet-14"></div>
  <div class="sh sheet-15"></div>
</div>
<div class="rain-hold">
<div class="rain r1"></div>
    <div class="rain r2"></div>    
    <div class="rain r3"></div>
    <div class="rain r4"></div>
    <div class="rain r5"></div>
    <div class="rain r6"></div>
  </div>
            
          
!

CSS

            
              .sh {
  background: #fff;
  display: block;
  width: 50px;
  height: 50px;
  position: absolute;
  border-radius: 50%;
}

.container {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  height: 400px;
  z-index: 1;
  margin-top: 150px;
}

@keyframes updown {
    0%   {margin-top: 0px;}
    33%  {margin-top: 15px;}
    67%  {margin-top: -15px;}
    100% {margin-top: 0px;}
}

@for $i from 1 through 15 {
  .sheet-#{$i} {
    right: #{15*$i}px;
    top: #{15*$i}px;
    z-index: #{$i*-10};
    background: #FFC7C7;
    display: block;
    width: #{(51-$i)}px;
    height: #{(51-$i)}px;
    position: absolute;
    transition: margin-top .25s;
    transition-delay:#{($i*.125)}s;
    // box-shadow: -1px 1px 0px #eee;
    
    .container:hover & {
      animation: updown .5s ease-in-out infinite;
      animation-delay:#{($i*.025)-.025}s;
      // margin-top: -10px;
      
      .eye {
        height: 7px;
        width: 7px;
      }
      .mouth {
        height: 15px;
      }
    }
  }
}

// .sh:nth-child(7n+2) {
//   background: #BE1E2D;
// }

// .sh:nth-child(7n+3) {
//   background: #F15A29;
// }

// .sh:nth-child(7n+4) {
//   background: yellow;
// }

// .sh:nth-child(7n+5) {
//   background: #48B74D;
// }

// .sh:nth-child(7n+6) {
//   background: #2B8EBF;
// }

// .sh:nth-child(7n+7) {
//   background: #3A3C97;
// }

// .sh:nth-child(7n+8) {
//   background: #92278F;
// }

.face {
  position: relative;


.eye {
  height: 1px;
  width: 7px;
  background: #000;
  border-radius:50%;
  transform: rotate(-12deg);
  
  &.left {
    position: absolute;
    left: 15px;
    top: 15px;
  }
  &.right {
    position: absolute;
    right: 5px;
    top: 10px;
  }
}
  
  .mouth {
     height:1px;
     width:30px;
     border-radius: 90px 90px 0 0;
     -moz-border-radius: 90px 90px 0 0;
     -webkit-border-radius: 0px 0px 90px 90px;
     background:#000;
     transform: rotate(-12deg);
    top: 27px;
    left: 16px;
    position: absolute;
  }
  
}

body {
      overflow: hidden;
      /* lightning animation */
      -webkit-animation: flash 8s linear infinite;
      -moz-animation: flash linear 8s infinite;
      -o-animation: flash linear 8s infinite;
      animation: flash linear 8s infinite;
  background: #000;
    }

.rain-hold {
  transform: rotate(55deg);
}

 .rain {
      position: absolute;
      width: 3004px; /* (2560 + 1244) */
      height: 4800px;
      top: -5800px;
      left: -1844px;
    }
 body:hover {   
    /* Two waves of nearby rain */
    .r1 {
      -webkit-animation: fall 2.2s infinite linear;
      -moz-animation: fall 2.2s infinite linear;
      -o-animation: fall 2.2s infinite linear;
      animation: fall 2.2s infinite linear;
      background: url(https://raw.githubusercontent.com/bryanbraun/after-dark-css/gh-pages/img/rain-tile-near.png) repeat;     
    }
    .r2 {
      -webkit-animation: fall 2.2s 1s infinite linear;
      -moz-animation: fall 2.2s 1s infinite linear;
      -o-animation: fall 2.2s 1s infinite linear;
      animation: fall 2.2s 1s infinite linear;
      background: url(https://raw.githubusercontent.com/bryanbraun/after-dark-css/gh-pages/img/rain-tile-near.png) repeat;     
    }
    
    /* Two waves of mid-distant rain */
    .r3 {
      -webkit-animation: fall 4s infinite linear;
      -moz-animation: fall 4s infinite linear;
      -o-animation: fall 4s infinite linear;
      animation: fall 4s infinite linear;
      background: url(https://raw.githubusercontent.com/bryanbraun/after-dark-css/gh-pages/img/rain-tile-mid.png) repeat;  
    }
    .r4 {
      -webkit-animation: fall 4.5s 3.2s infinite linear;
      -moz-animation: fall 4.5s 3.2s infinite linear;
      -o-animation: fall 4.5s 3.2s infinite linear;
      animation: fall 4.5s 3.2s infinite linear;
      background: url(https://raw.githubusercontent.com/bryanbraun/after-dark-css/gh-pages/img/rain-tile-mid.png) repeat;
    } 
    
    /* Two waves of distant rain */
    .r5 {
      -webkit-animation: fall 6s infinite linear;
      -moz-animation: fall 6s infinite linear;
      -o-animation: fall 6s infinite linear;
      animation: fall 6s infinite linear;
      background: url(https://raw.githubusercontent.com/bryanbraun/after-dark-css/gh-pages/img/rain-tile-distant.png) repeat;  
    }
    .r6 {
      -webkit-animation: fall 6s 4s infinite linear;
      -moz-animation: fall 6s 4s infinite linear;
      -o-animation: fall 6s 4s infinite linear;
      animation: fall 6s 4s infinite linear;
      background: url(https://raw.githubusercontent.com/bryanbraun/after-dark-css/gh-pages/img/rain-tile-distant.png) repeat;
    }
    }   
    /**
     * Falling rain animation
     * Assumes a max screen resolution of 2560px x 1600px.
     * Rain falls the size of the div + the estimated 
     * height of the screen (1600 max). 4800 + 1600 = 6400.
     *
     * Making the rain fall straight down is easier for ensuring there is always
     * rain on the screen. However I can preserve the angle of falling rain with
     * a translateY of 1244px.
     */
    @-webkit-keyframes fall {
      from { 
        -webkit-transform: translate(0, 0);
        -moz-transform: translate(0, 0);
        -o-transform: translate(0, 0);
        -ms-transform: translate(0, 0);
        transform: translate(0, 0);
      }
      to {
        -webkit-transform: translate(1244px, 6400px);
        -moz-transform: translate(1244px, 6400px);
        -o-transform: translate(1244px, 6400px);
        -ms-transform: translate(1244px, 6400px);
        transform: translate(1244px, 6400px);
      }
    }
    @-moz-keyframes fall {
      from { 
        -webkit-transform: translate(0, 0);
        -moz-transform: translate(0, 0);
        -o-transform: translate(0, 0);
        -ms-transform: translate(0, 0);
        transform: translate(0, 0);
      }
      to {
        -webkit-transform: translate(1244px, 6400px);
        -moz-transform: translate(1244px, 6400px);
        -o-transform: translate(1244px, 6400px);
        -ms-transform: translate(1244px, 6400px);
        transform: translate(1244px, 6400px);
      }
    }
    @-o-keyframes fall {
      from { 
        -webkit-transform: translate(0, 0);
        -moz-transform: translate(0, 0);
        -o-transform: translate(0, 0);
        -ms-transform: translate(0, 0);
        transform: translate(0, 0);
      }
      to {
        -webkit-transform: translate(1244px, 6400px);
        -moz-transform: translate(1244px, 6400px);
        -o-transform: translate(1244px, 6400px);
        -ms-transform: translate(1244px, 6400px);
        transform: translate(1244px, 6400px);
      }
    }
    @keyframes fall {
      from { 
        -webkit-transform: translate(0, 0);
        -moz-transform: translate(0, 0);
        -o-transform: translate(0, 0);
        -ms-transform: translate(0, 0);
        transform: translate(0, 0);
      }
      to {
        -webkit-transform: translate(1244px, 6400px);
        -moz-transform: translate(1244px, 6400px);
        -o-transform: translate(1244px, 6400px);
        -ms-transform: translate(1244px, 6400px);
        transform: translate(1244px, 6400px);
      }
    }


            
          
!

JS

            
              
            
          
!
999px

Console