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 includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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 id="wfl_logo">
  <div></div>
  <div></div>
  <div></div>
</div>

<!-- Documentation:
Just created this for fun. Thinking about a future glitch-themed design that I may do, so I wanted to come up with my own CMYK glitch method for my logo. -->
              
            
!

CSS

              
                $darkgray: #36393D;
$glitch-pink: magenta;
$glitch-yellow: yellow;
$glitch-blue: cyan;
$glitch-duration: .2s;

#wfl_logo {
    height:250px;
    width:250px;
    display:flex;
    margin:10vh auto;
    z-index:9999 !important;
    justify-content:space-between;
}

#wfl_logo div:first-child, #wfl_logo div:last-child {
    width:26%;
    height:88.33%;
    background-color:$darkgray;
    align-self:flex-start;
    border-radius:400px;
    transition:all .1s;
}

#wfl_logo div:nth-child(2) {
    width:26%;
    height:78.33%;
    background-color:$darkgray;
    align-self:flex-end;
    border-radius:400px;
    transition:all .1s;
}

.wfl_logo--glitch1 > div {
    animation:glitch1 $glitch-duration;
}

.wfl_logo--glitch2 > div {
    animation:glitch2 $glitch-duration;
}

.wfl_logo--glitch3 > div {
    animation:glitch3 $glitch-duration;
}

.wfl_logo--glitch4 > div {
    animation:glitch4 $glitch-duration;
}

/* Animation */
@keyframes glitch1 {
    0% {
        box-shadow:none;
    }
    20% {
        box-shadow:15px 10px 0 0 $glitch-yellow, 5px 9px 0 0 $glitch-pink;
    }
    50% {
        box-shadow:12px 1px 0 0 $glitch-yellow, 0px 0px 0 0 $glitch-pink, -5px 6px 0 0 $glitch-blue;
    }
    60% {
        box-shadow:-3px -10px 0 0 $glitch-yellow, -9px -2px 0 0 $glitch-pink, 1px 12px 0 0 $glitch-blue;
    }
    75% {
        box-shadow:-4px 2px 0 0 $glitch-yellow, 10px 11px 0 0 $glitch-pink, 4px -8px 0 0 $glitch-blue;
    }
    100% {
        box-shadow:none;
    }
}

@keyframes glitch2 {
    0% {
        box-shadow:none;
    }
    30% {
        box-shadow:15px 10px 0 0 $glitch-yellow, 5px 9px 0 0 $glitch-pink;
    }
    40% {
        box-shadow:12px 1px 0 0 $glitch-yellow, 0px 0px 0 0 $glitch-pink, -5px 6px 0 0 $glitch-blue;
    }
    60% {
        box-shadow:-3px -10px 0 0 $glitch-yellow, -9px -2px 0 0 $glitch-pink, 1px 12px 0 0 $glitch-blue;
    }
    85% {
        box-shadow:-4px 2px 0 0 $glitch-yellow, 10px 11px 0 0 $glitch-pink, 4px -8px 0 0 $glitch-blue;
    }
    100% {
        box-shadow:none;
    }
}

@keyframes glitch3 {
    0% {
        box-shadow:none;
    }
    10% {
        box-shadow:3px 3px 0 0 $glitch-blue, -2px 5px 0 0 $glitch-pink;
    }
    30% {
        box-shadow:6px 1px 0 0 $glitch-yellow, 2px -10px 0 0 $glitch-pink, -12px 5px 0 0 $glitch-blue;
    }
    60% {
        box-shadow:10px -3px 0 0 $glitch-yellow, 5px -4px 0 0 $glitch-pink, 7px 4px 0 0 $glitch-blue;
    }
    70% {
        box-shadow:-14px -5px 0 0 $glitch-yellow, 0px 7px 0 0 $glitch-pink, 2px 3px 0 0 $glitch-blue;
    }
    100% {
        box-shadow:none;
    }
}

@keyframes glitch4 {
    0% {
        box-shadow:none;
    }
    25% {
        box-shadow:10px -3px 0 0 $glitch-yellow, 7px 1px 0 0 $glitch-blue;
    }
    40% {
        box-shadow:-13px 6px 0 0 $glitch-yellow, 2px 12px 0 0 $glitch-pink, 6px 9px 0 0 $glitch-blue;
    }
    65% {
        box-shadow:0px 0px 0 0 $glitch-yellow, -3px 14px 0 0 $glitch-pink, 5px -3px 0 0 $glitch-blue;
    }
    90% {
        box-shadow:-8px 4px 0 0 $glitch-yellow, 5px 2px 0 0 $glitch-pink, 14px -5px 0 0 $glitch-blue;
    }
    100% {
        box-shadow:none;
    }
}
              
            
!

JS

              
                glitchTimer = setInterval(function(){setTimeout(addGlitch,genTimer())},1000);

function addGlitch() {
    var logo = document.getElementById("wfl_logo");
    var currentGlitch = logo.classList.item(0);
    var glitchNum = Math.floor(Math.random() * 4) + 1;
    var glitchType = "wfl_logo--glitch" + glitchNum.toString();
    
    //This isn't foolproof, but we don't really need it to be. We just need to minimize, rather than eliminate, duplicates
    if (glitchType === currentGlitch) {
        var glitchNum = Math.floor((Math.random() * 4) + 1);
        var glitchType = "wfl_logo--glitch" + glitchNum.toString();
    }

    logo.className = glitchType;
}

function genTimer() {
    return Math.floor(Math.random() * 5000);
}
              
            
!
999px

Console