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="app inv">
							<div class="top_fixed">
								<div class="nav">
									<ul>
										<li class="down">
											<a href="works" data-page="works">Работы</a>
										</li>
										<li class="nl"></li>
										<li class="down">
											<a href="agency" data-page="agency">Агентство</a>
										</li>
										<li class="nl"></li>
										<li class="down">
											<a href="contact" data-page="contact">Контакты</a>
										</li>
										<li class="nl"></li>
									</ul>
									<div class="close_btn">
										<span></span>
									</div>
								</div>
								<div class="nav_btn">
									<div class="layer wh">
										<span></span>
									</div>
									<div class="layer bk">
										<span></span>
									</div>
								</div>
							</div>
						</div>
						<!-- /.app inv -->
              
            
!

CSS

              
                .top_fixed {
    position: absolute;
    display: block;
    padding: 0 130px;
    top: 63px;
    right: 0;
    bottom: auto;
    left: 0;
    z-index: 2;
    -webkit-animation: .3s forwards show;
    animation: .3s forwards show
}

@media screen and (max-width: 575px) {
    .top_fixed {
        padding:0 80px
    }
}

.nav {
    font-weight: 400;
    position: absolute;
    display: block;
    top: 0;
    left: 60%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none
}

.nav.active {
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0)
}

@media screen and (max-width: 575px) {
    .nav {
        position:fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background: rgba(4,0,15,.9);
        -webkit-transform: translateY(-100%);
        -ms-transform: translateY(-100%);
        transform: translateY(-100%);
        -webkit-transition: all .5s ease;
        transition: all .5s ease
    }
}

.nav ul {
    position: relative;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-size: 14px
}

@media screen and (max-width: 575px) {
    .nav ul {
        position:absolute;
        display: block;
        top: 50%;
        right: 0;
        bottom: auto;
        left: 0;
        -webkit-transform: translateY(-50%);
        -ms-transform: translateY(-50%);
        transform: translateY(-50%);
        text-align: center;
        font-size: 42px
    }
}

.nav ul li {
    position: relative;
    display: inline-block;
    margin: 0 50px 0 -10px;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255,255,255,0);
    overflow: hidden
}

@media screen and (max-width: 575px) {
    .nav ul li {
        margin:0
    }
}

.nav ul li.nl {
    display: none
}

@media screen and (max-width: 575px) {
    .nav ul li.nl {
        display:block
    }
}

.nav ul li.up a {
    -webkit-transform: translateY(-100%);
    -ms-transform: translateY(-100%);
    transform: translateY(-100%)
}

.nav ul li.down a {
    -webkit-transition: none;
    transition: none;
    -webkit-transform: translateY(100%);
    -ms-transform: translateY(100%);
    transform: translateY(100%)
}

.nav ul li a {
    position: relative;
    display: block;
    z-index: 1;
    -webkit-transition: all .4s cubic-bezier(.55,0,.28,1);
    transition: all .4s cubic-bezier(.55,0,.28,1);
    padding: 5px 10px;
    color: #b2b1bc;
    -webkit-tap-highlight-color: rgba(255,255,255,0)
}

.nav ul li:after {
    content: '';
    position: absolute;
    display: block;
    top: 7px;
    right: 100%;
    bottom: auto;
    left: 0;
    z-index: 0;
    height: 3px;
    background: -webkit-gradient(linear,left top,right top,from(#0d3ff4),to(#852bff));
    background: -webkit-linear-gradient(left,#0d3ff4 0,#852bff 100%);
    background: -webkit-gradient(linear,left top,right top,color-stop(0,#0d3ff4),to(#852bff));
    background: linear-gradient(to right,#0d3ff4 0,#852bff 100%);
    opacity: 0
}

@media screen and (max-width: 575px) {
    .nav ul li:after {
        top:20px;
        opacity: 1
    }
}

.nav ul li:before {
    content: '';
    position: absolute;
    display: block;
    top: 7px;
    right: 100%;
    bottom: auto;
    left: 0;
    z-index: 0;
    height: 3px;
    background: -webkit-gradient(linear,left top,right top,from(#0d3ff4),to(#852bff));
    background: -webkit-linear-gradient(left,#0d3ff4 0,#852bff 100%);
    background: -webkit-gradient(linear,left top,right top,color-stop(0,#0d3ff4),to(#852bff));
    background: linear-gradient(to right,#0d3ff4 0,#852bff 100%);
    opacity: 0
}

@media screen and (max-width: 575px) {
    .nav ul li:before {
        top:20px;
        opacity: 1
    }
}

.inv .nav ul li:after,.inv .nav ul li:before,.right_inv .nav ul li:after,.right_inv .nav ul li:before {
    -webkit-transition: all .4s cubic-bezier(.55,0,.28,1);
    transition: all .4s cubic-bezier(.55,0,.28,1);
    opacity: 1
}

@media screen and (max-width: 575px) {
    .nav ul li a,.nav ul li.active a,.nav ul li:hover a {
        color:#fff
    }
}

.inv .nav ul li a,.right_inv .nav ul li a {
    color: #fff;
    opacity: .8
}

.close_btn {
    position: absolute;
    display: none;
    top: 65px;
    left: 50%;
    -webkit-transform: rotate(45deg) translateX(-50%);
    -ms-transform: rotate(45deg) translateX(-50%);
    transform: rotate(45deg) translateX(-50%);
    margin-left: -4px;
    margin-top: 4px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    overflow: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: rgba(255,255,255,0)
}

.close_btn.active span {
    -webkit-transform: translateX(0);
    -ms-transform: translateX(0);
    transform: translateX(0);
    -webkit-transition: all .3s ease;
    transition: all .3s ease
}

.close_btn.active span:after {
    -webkit-transform: rotate(90deg) translateX(0);
    -ms-transform: rotate(90deg) translateX(0);
    transform: rotate(90deg) translateX(0);
    -webkit-transition: all .3s ease .3s;
    transition: all .3s ease .3s
}

.close_btn.active span:before {
    -webkit-transform: rotate(90deg) translateX(0);
    -ms-transform: rotate(90deg) translateX(0);
    transform: rotate(90deg) translateX(0);
    -webkit-transition: all .3s ease .3s;
    transition: all .3s ease .3s
}

.close_btn span {
    position: relative;
    display: block;
    height: 2px;
    width: 22px;
    margin-top: 10px;
    background-color: #fff;
    -webkit-transition: all .3s ease .3s;
    transition: all .3s ease .3s;
    -webkit-transform: translateX(-100%);
    -ms-transform: translateX(-100%);
    transform: translateX(-100%)
}

.close_btn span:before {
    position: absolute;
    display: block;
    content: '';
    background-color: #fff;
    height: 100%;
    width: 50%;
    top: -7px;
    left: 5px;
    z-index: 1;
    -webkit-transition: all .3s ease;
    transition: all .3s ease;
    -webkit-transform: rotate(90deg) translateX(-200%);
    -ms-transform: rotate(90deg) translateX(-200%);
    transform: rotate(90deg) translateX(-200%)
}

.close_btn span:after {
    position: absolute;
    display: block;
    content: '';
    background-color: #fff;
    height: 100%;
    width: 50%;
    top: -7px;
    left: 5px;
    z-index: 1;
    -webkit-transition: all .3s ease;
    transition: all .3s ease;
    -webkit-transform: rotate(90deg) translateX(-200%);
    -ms-transform: rotate(90deg) translateX(-200%);
    transform: rotate(90deg) translateX(-200%);
    top: 7px;
    -webkit-transform: rotate(90deg) translateX(200%);
    -ms-transform: rotate(90deg) translateX(200%);
    transform: rotate(90deg) translateX(200%)
}

@media screen and (max-width: 575px) {
    .close_btn {
        display:block
    }
}

.nav_btn {
    position: absolute;
    display: none;
    top: -33px;
    right: 0;
    -webkit-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    cursor: pointer;
    overflow: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: rgba(255,255,255,0)
}

@media screen and (max-width: 575px) {
    .nav_btn {
        display:block
    }
}

.nav_btn.hid .layer span {
    -webkit-transform: translateX(125%);
    -ms-transform: translateX(125%);
    transform: translateX(125%)
}

.nav_btn.hid .layer span:after {
    -webkit-transform: translateX(-250%);
    -ms-transform: translateX(-250%);
    transform: translateX(-250%)
}

.nav_btn.hid .layer span:before {
    -webkit-transform: translateX(-250%);
    -ms-transform: translateX(-250%);
    transform: translateX(-250%)
}

.nav_btn .layer {
    position: absolute;
    display: block;
    top: 12px;
    right: 4px;
    bottom: 4px;
    left: 4px;
    -webkit-transition: all .3s ease;
    transition: all .3s ease;
    z-index: 2
}

.nav_btn .layer span {
    position: relative;
    display: block;
    height: 2px;
    width: 22px;
    background-color: #5473b6;
    -webkit-transition: all .3s ease;
    transition: all .3s ease
}

.nav_btn .layer span:after {
    position: absolute;
    display: block;
    content: '';
    background-color: #5473b6;
    height: 100%;
    width: 100%;
    top: -7px;
    top: 7px;
    z-index: 1;
    -webkit-transition: all .3s ease;
    transition: all .3s ease
}

.nav_btn .layer span:before {
    position: absolute;
    display: block;
    content: '';
    background-color: #5473b6;
    height: 100%;
    width: 100%;
    top: -7px;
    z-index: 1;
    -webkit-transition: all .3s ease;
    transition: all .3s ease
}

.nav_btn .layer.wh {
    -webkit-transform: scale(0,1);
    -ms-transform: scale(0,1);
    transform: scale(0,1)
}

.nav_btn .layer.bk {
    -webkit-transform: scale(0,1);
    -ms-transform: scale(0,1);
    transform: scale(0,1)
}

.nav_btn .layer.bk span {
    background-color: #232228
}

.nav_btn .layer.bk span:after {
    background-color: #232228;
    -webkit-transition: all .3s ease;
    transition: all .3s ease
}

.nav_btn .layer.bk span:before {
    background-color: #232228;
    -webkit-transition: all .3s ease;
    transition: all .3s ease
}

.inv .nav_btn .layer.wh,.right_inv .nav_btn .layer.wh {
    -webkit-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1)
}

@-webkit-keyframes show {
    0% {
        z-index: -1;
        opacity: 0
    }

    1% {
        opacity: 0
    }

    100% {
        opacity: 1
    }
}

@keyframes show {
    0% {
        z-index: -1;
        opacity: 0
    }

    1% {
        opacity: 0
    }

    100% {
        opacity: 1
    }
}
              
            
!

JS

              
                var nav = document.querySelector('.nav'),
    navItem = nav.querySelectorAll('.nav__item');

var helper = document.querySelector('.helper');

function showNav () {
  navItem.forEach(function (item, index) {
    setTimeout(function() {
        item.classList.remove("nav__item--down");
    }, 50 * index)
  })
}

function hideNav () {
  navItem.forEach(function (item, index) {
    setTimeout(function() {
        item.classList.add("nav__item--up");
    }, 50 * index);
  })
}

// reset
navItem.forEach(function (item) {
  item.addEventListener('transitionend', function (e) {
    
    if ( e.target.parentNode.classList.contains('nav__item--up') ) {
      item.classList.remove('nav__item--up');
      item.classList.add('nav__item--down');
    }

  });
})

// controll

helper.addEventListener('click', function (e) {
  
  if ( e.target.classList.contains('button--show') ) {
    showNav();
  } else if ( e.target.classList.contains('button--hide') ) {
    hideNav();
  }
  
});
              
            
!
999px

Console