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="overlay">
    <nav class="overlayMenu">  
        <ul role="menu">
            <li><a href="#" role="menuitem">Parity</a></li>
            <li><a href="#" role="menuitem">Abstract</a></li>
            <li><a href="#" role="menuitem">Educated</a></li>
            <li><a href="#" role="menuitem">Decorum</a></li>
            <li><a href="#" role="menuitem">Tenuous</a></li>
        </ul>
    </nav>
</div>

<div class="navBurger" role="navigation" id="navToggle"></div> 


<h1>Full Screen Mobile Nav</h1><br>
<p>Itaque illo, fames interdum illo quae. Error quidem atque aliquet tempora egestas sodales nibh posuere, proin iure odio assumenda dignissim, voluptatum adipisicing lobortis ab volutpat erat nam, elit adipisci accusantium tenetur laborum, senectus elementum
    nemo vehicula, tempore penatibus voluptatem totam, cubilia nisl praesentium taciti lorem corrupti, et varius ac nullam non, ornare, cubilia commodi a euismod. Nisl, reprehenderit, lacus ad habitant orci! Minim cubilia aliquet vulputate amet perferendis
    class faucibus. Provident morbi. Exercitation curae soluta, architecto arcu magnis beatae ullamcorper iusto placeat cras. Ac. Adipisicing. Minus corporis harum magni tortor, tempore varius. Quasi explicabo? Sociis! Laoreet. Phasellus unde sociosqu,
    dolores.
</p>
<p>Itaque illo, fames interdum illo quae. Error quidem atque aliquet tempora egestas sodales nibh posuere, proin iure odio assumenda dignissim, voluptatum adipisicing lobortis ab volutpat erat nam, elit adipisci accusantium tenetur laborum, senectus elementum
    nemo vehicula, tempore penatibus voluptatem totam, cubilia nisl praesentium taciti lorem corrupti, et varius ac nullam non, ornare, cubilia commodi a euismod. Nisl, reprehenderit, lacus ad habitant orci! Minim cubilia aliquet vulputate amet perferendis
    class faucibus. Provident morbi. Exercitation curae soluta, architecto arcu magnis beatae ullamcorper iusto placeat cras. Ac. Adipisicing. Minus corporis harum magni tortor, tempore varius. Quasi explicabo? Sociis! Laoreet. Phasellus unde sociosqu,
    dolores.
</p><p>Itaque illo, fames interdum illo quae. Error quidem atque aliquet tempora egestas sodales nibh posuere, proin iure odio assumenda dignissim, voluptatum adipisicing lobortis ab volutpat erat nam, elit adipisci accusantium tenetur laborum, senectus elementum
    nemo vehicula, tempore penatibus voluptatem totam, cubilia nisl praesentium taciti lorem corrupti, et varius ac nullam non, ornare, cubilia commodi a euismod. Nisl, reprehenderit, lacus ad habitant orci! Minim cubilia aliquet vulputate amet perferendis
    class faucibus. Provident morbi. Exercitation curae soluta, architecto arcu magnis beatae ullamcorper iusto placeat cras. Ac. Adipisicing. Minus corporis harum magni tortor, tempore varius. Quasi explicabo? Sociis! Laoreet. Phasellus unde sociosqu,
    dolores.
</p>




    
    

              
            
!

CSS

              
                .navBurger {
    position: fixed;
    right: 20px;
    top: 20px;
    cursor: pointer;
    background: #111;
    box-sizing: border-box;
    background-clip: content-box;
    width: 30px;
    height: 24px;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
    -webkit-transition: all 0.25s ease-in-out;
    transition: all 0.25s ease-in-out;
    &:before,
    &:after {
        content: "";
        position: absolute;
        background: #111;
        height: 2px;
        width: 100%;
        right: 0;
        will-change: rotate;
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
        -webkit-transition: all 0.5s ease;
        transition: all 0.5s ease;
    }
    &:before {
        top: -10px;
    }
    &:after {
        bottom: -10px;
        width: 90%;
    }
    &.active {
        background: transparent;
        background-clip: content-box;
    }
    &.active:before {
        -webkit-transform: rotate(135deg);
        transform: rotate(135deg);
        top: 0;
        background: #eee;
        width: 110%;
    }
    &.active:after {
        bottom: 0;
        -webkit-transform: rotate(-135deg);
        transform: rotate(-135deg);
        background: #eee;
        width: 110%;
    }
}

.overlay {
    position: fixed;
    background: #2a3140;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform-origin: right top;
    transform: scale(0);
    visibility: hidden;
    transition: all 0.4s ease-in-out;
    overflow: hidden;
    &.open {
        opacity: 0.99;
        visibility: visible;
        transform: scale(1);
        li {
            display: block;
            animation: fadeInRight 0.4s cubic-bezier(0.42, 0.83, 0.7, 1.5)
                forwards;
            animation-delay: 0.4s;
            transform: rotate(-7deg);
            transform-origin: right bottom;
            &:nth-of-type(2) {
                animation-delay: 0.5s;
            }
            &:nth-of-type(3) {
                animation-delay: 0.6s;
            }
            &:nth-of-type(4) {
                animation-delay: 0.7s;
            }
            &:nth-of-type(5) {
                animation-delay: 0.8s;
            }
        }
    }
}

.overlayMenu {
    position: absolute;
    text-align: right;
    right: 10vw;
    bottom: 10vw;
    ul {
        list-style: none;
        padding: 0;
        margin: 0 auto;
        display: block;
        position: relative;
        height: 100%;
        li {
            display: block;
            position: relative;
            opacity: 0;
            width: 100%;
            a {
                display: inline-block;
                border: 1px solid rgba(255, 255, 255, 0.09);
                color: #fff;
                text-decoration: none;
                font-size: 30px;
                padding: 10px 40px 10px 40px;
                margin: 5px 0;
                transition: 0.2s;
                &:hover,
                &:active,
                &:focus {
                    transform: translateX(-2px);
                    padding-left: 80px;
                    outline: 1px solid rgba(255, 255, 255, 0.3);
                    background: rgba(255, 255, 255, 0.03);
                }
            }
        }
    }
}

.locked {
    overflow: hidden;
}

@keyframes fadeInRight {
    0% {
        opacity: 0;
        left: 50px;
    }
    100% {
        opacity: 1;
        left: 0;
        transform: rotate(0deg);
    }
}

// ---------------- Display --------------------
html {
    padding: 80px;
    margin: 0;
    background: #eee;
    color: #222;
    font-weight: 300;
    font-family: "Raleway";
}

h1 {
    font-size: 2rem;
    color: #222;
}

p {
    line-height: 40px;
    font-size: 16px;
    font-family: "Crimson Text";
    color: #222;
}

              
            
!

JS

              
                $("#navToggle").click(function() {
    $(this).toggleClass("active");
    $(".overlay").toggleClass("open");
    // this line ▼ prevents content scroll-behind
    $("body").toggleClass("locked"); 
});

              
            
!
999px

Console