Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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="menu_btn" role="button"><a href="#" title="open menu">menu</a></div>
        
        <nav class="navigation" role="navigation">
            <h2>main navigation</h2>
            <div class="panel panel--left">
                <ul class="menu">
                    <li><a href="#" title="drinks"><span class="litem">Drinks</span></a>
                        <i class="line"></i>
                    </li>
                    <li><a href="#" title="food"><span class="litem">food</span></a>
                        <ul class="sub-menu">
                            <li><a href="#" title="Breakfast"><span class="litem">Breakfast</span></a></li>
                            <li><a href="#" title="Lunch"><span class="litem">Lunch</span></a></li>
                            <li><a href="#" title="Dinner"><span class="litem">Dinner</span></a></li>
                        </ul>
                        <i class="line"></i>
                    </li>
                    <li><a href="#" title="coffee"><span class="litem">coffee</span></a>
                        <ul class="sub-menu">
                            <li><a href="#" title="Espresso"><span class="litem">Espresso</span></a></li>
                            <li><a href="#" title="Macchiato"><span class="litem">Macchiato</span></a></li>
                            <li><a href="#" title="Macchiato"><span class="litem">Macchiato</span></a></li>
                        </ul>
                        <i class="line"></i>
                    </li>
                    <li><a href="#" title="events"><span class="litem">events</span></a>
                        <i class="line"></i>
                    </li>
                    <li><a href="#" title="catalog"><span class="litem">catalog</span></a>
                        <i class="line"></i>
                    </li>
                </ul>
                <footer class="footer">
                    <span class="footer__gredits">developed by <a href="#" title="">vn</a></span>
                    <span class="footer__social"><a href="#" title="facebook">facebook</a> - <a href="#" title="instagram">instagram</a></span>
                </footer>
            </div>
            <div class="panel panel--right">
                <div class="close_btn"><a href="#">close</a></div>
                <div class="data">
                    <div class="data__content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas egestas, nulla id tincidunt dignissim, magna magna imperdiet metus, vel porta enim metus ac justo. Nam aliquam est nec felis condimentum, sed rhoncus.</div>
                    <div class="data__sub">"Nvagelis"</div>
                </div>
            </div>	
        </nav>
              
            
!

CSS

              
                $red: #e2001a;
$transition: ease-in-out .4s;
html {
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
    margin: 0;
    padding: 0;
}
ul{
    list-style: none;
    margin: 0;
    padding: 0;
}
a {
  text-decoration: none;
}

body {
    font-family: open_sansregular,sans-serif;
    font-size: 100%;
    font-style: normal;
    text-transform: none;
    text-align: left;
    letter-spacing: normal;
    word-spacing: normal;
    line-height: 1.4;
    vertical-align: baseline;
    background-color: #292a2e;
    
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
.menu_btn{
    position:relative;
    visibility: visible;
    opacity: 1;
    z-index: 20;
    a{
        font-size: 2em;
        padding: 20px 15px;
        display: inline-block;
        letter-spacing: 3px;
        transition: color $transition;
        color: #fff;
        &:hover,
        &:focus,
        &:focus-within{
            color: $red;
        }
        }
    
}
nav{
    display: block;
}


.panel{
    position: absolute;
    top: 0;
    width: 0;
    height: 100%;
    overflow: hidden;
    width: 0%;
    &--left {
        display: flex;
        flex-direction: column;
        align-items: center;
        
        background-color: #292b2f;
        right: 50%;
    }
    &--right {
        display: flex;
        align-items: center;
        justify-content: center;
    
        background-color: #2f3135;
        right: 0;
    }
}
.line {
    display: block;
    position: absolute;
    left: 0;
    top: 1em;
    width: 28px;
    height: 1px;
    background: rgba(130,130,130,.6);
    opacity: 0;
}
.navigation ul li, 
.navigation ul li a, 
.navigation ul li a span {
    position: relative;
    display: block;
}
.navigation {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    z-index: 10;
    h2 {
        width: 0;
        height: 0;
        text-indent: -9999px;
    }
    .menu{
        display: flex;
        flex: 8;
        flex-direction: column;
        justify-content: center;
        text-align: left;
        transform: translate(-100%, 0);
        >li{
            line-height: 30px;
            font-size: 20px;
            font-size: 1.25em;
            font-size: 1.25rem;
            padding: .4em 0 .4em 42px;
            margin: .2em 0;
            text-align: left;
            float: left;
            clear: both;
            >a{
                color: #fff;
                text-decoration: none;
                overflow: hidden;
                transition: color $transition;
                &:hover,
                &:focus,
                &:focus-within{
                    color: $red;
                }
                >span{
                    top: 0;
                    text-transform: capitalize;
                }
            }
        }
    }
    .sub-menu{
        >li{
            display: block;
            float: left;
            clear: both;
            line-height: 30px;
            font-size: 14px;
            font-size: .875em;
            font-size: .875rem;
            padding: 0;
            margin: 0;
            >a{
                color: #828282;
                text-transform: none;
                overflow: hidden;
                transition: color $transition;
                &:hover,
                &:focus,
                &:focus-within{
                    color: $red;
                }
            }
        }
    }
}
.litem{
    transform: translate(0, -100%);
}

.footer{
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 32px 70px;
    
    opacity: 0;
    
    font-size: 12px;
    font-size: .75em;
    font-size: .75rem;
    &__gredits,
    &__social{
        display: block;
        color: #828282;
        >a{
            color: #828282;
            margin: 0 5px;
            text-decoration: none;
            transition: color $transition;
            &:hover,
            &:focus,
            &:focus-within{
                color: $red;
            }
        }
    }
}

.close_btn{
    position: absolute;
    top: 10px;
    right: 10px;
    a{
        font-size: 1em;
        padding: 20px 15px;
        display: inline-block;
        letter-spacing: 3px;
        transition: color $transition;
        color: #fff;
        &:hover,
        &:focus,
        &:focus-within{
            color: $red;
        }
    }
    
}

.data {
    padding: 0 20%;
    &__content{
        font-family: open_sansregular,arial;
        font-size: 26px;
        font-size: 1.625em;
        font-size: 1.625rem;
        line-height: 38px;
        color: #828282;
        font-style: italic;
        text-align: justify;
        opacity: 0;
        transform: translate(0, 50px);
        @media(max-width:680px){
            font-size: 16px;
            font-size: 1em;
            font-size: 1rem;
            line-height: 18px;
        }
    }
    &__sub{
        color: #fff;
        float: left;
        margin-top: 2%;
        font-size: 11px;
        font-size: .6875em;
        font-size: .6875rem;
        opacity: 0;
        transform: translate(0, 50px);
    }
}

              
            
!

JS

              
                $(document).ready(function (){
               
               var open_btn = $('.menu_btn');
               var close_btn = $('.close_btn');
               
               var panels = $('.panel');
               var links = $('.litem');
               var lines = $('.line');
               var data_content = $('.data__content');
               var data_sub = $('.data__sub');
               var footer = $('.footer');
               
               var tl = new TimelineLite({paused:true});
               
               tl.to(panels, 0.5, {width: '50%'})
                       .to(open_btn, 0.5, {opacity: 0, visibility: 'hidden', 'z-index':0}, "-=0.5")
                       .to(data_content, 0.5, {y:0, opacity: 1})
                       .to(data_sub, 0.5, {y:0, opacity: 1}, "-=0.25")
                       .staggerTo(links, 0.3, {y:0}, 0.05, "-=0.75")
                       .to(lines, 0.5, {opacity: 1})
                       .to(footer, 0.5, {opacity: 1}, "-=0.5");
               
               
               
               
               
               open_btn.on('click', function (e){
                   e.preventDefault();
                   tl.play();
               });
               
               close_btn.on('click', function (e){
                   e.preventDefault();
                   tl.reverse();
               });

            });
              
            
!
999px

Console