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

              
                - var numLinesFromStem = 30

.container
    .stem.line
    - for (var x = 0; x < numLinesFromStem - 1; x++)
        .line
              
            
!

CSS

              
                $n: 30; /* Make sure it's the same as the Jade (Pug) */
$bgColor: #c9c9c9;
$middleColor: white;
$lineColor: black;
$animLength: 5; /* In seconds */
$ease: cubic-bezier(0.13, 0.25, 0.25, 1.00);

// Returns a number between -1 and 1 in a normalized (Gaussian) way using the central limit theorum
@function genNormalizedVal() {
    @return (((random(100) + random(100) + random(100) + random(100) + random(100) + random(100)) / 100 - 3)) / 3;
}

html, body { 
    height: 100%; 
    margin: 0;
    overflow: hidden;
}

body { 
    /* Set the mood */
    background-color: $bgColor;
    background-image: radial-gradient(circle, $middleColor 0%, $middleColor 10%, $bgColor 100%);
}

.container {
    height: 100%;
    position: relative;
    animation: containerAnim ($animLength * 2 + s) linear infinite;
    transform-style: preserve-3d;
    transform-origin: 47% 53%; // A little offset to make it more interesting
}

.line {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 100%;
    width: 2px;
    background-color: $lineColor;
    transform-origin: top center;
}

.stem {
    height: 40%;
    transform-origin: bottom center;
    animation: stemAnim ($animLength + s) $ease infinite;
}

@for $i from 2 to ($n + 1) {
    $xRot: random(90) + deg;
    $yRot: random(360) + deg;
    $zRot: (180 + 250 * genNormalizedVal()) + deg;
    @keyframes line#{$i}Anim {
        0.001%, 90% { opacity: 1; }
        99.999% { opacity: 0; }
        
        0%, 40% { transform: rotateX($xRot) rotateY($yRot) rotateZ($zRot) scaleY(0); }
        100% { transform: rotateX($xRot) rotateY($yRot) rotateZ($zRot) scaleY(1); }
    }
    .line:nth-of-type(#{$i}) {
        transform: rotateX($xRot) rotateZ($zRot) scaleY(1);
        animation: line#{$i}Anim ($animLength + s) $ease infinite;
    }
}

@keyframes stemAnim {
    0.001%, 90% { opacity: 1; }
    99.999% { opacity: 0; }
    
    0% { transform: scaleY(0); }
    50%, 100% { transform: scaleY(1); }
}

@keyframes containerAnim {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}
              
            
!

JS

              
                // For more check out zachsaucier.com
              
            
!
999px

Console