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.

            
              - raindrops = 30              #this needs to match the SASS

- #for each particle, create a particle div with a unique numbered class
- ( 1..raindrops ).each do |i|
    %div{:class => "raindrop raindrop--#{i}"}
            
          
!
            
              $particles:          30;        //this needs to match the HAML

//width/height of each raindrop
$raindropDim:        .5rem;
$animDuration:       2s;

html, body {
    height: 100%;
    background: black;
}

//particles- each is absolutely positioned
.raindrop {
    width: $raindropDim;
    height: $raindropDim;
    background: lightBlue;
    position: absolute;
    top: 0;
    left: 0;
    //Set animation to loop infinitely, with a linear timing function
    animation: $animDuration infinite anim-particle linear;
    border-radius: 999px;
}

//randomly set left position of each particle, and anim delay
@for $i from 1 through $particles {
    .raindrop--#{$i} {
        left: random() * 100%;
        animation-delay: -( random() * $animDuration );
    }
}

//keyframes for a particle. Go from top to bottom
@keyframes anim-particle {
    0% {
        transform: translate( 0, 0 );
    }
    
    100% {
        transform: translate( 0, 100vh );
    }
}
            
          
!
999px
Loading ..................

Console