Menu Concept #2

HTML
<a href="#" data-toggle="menu" class="menu-toggle"> <span class="label">Menu</span><i class="close fa fa-times"></i> </a> <nav id="menu" class="menu"> <ul> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Work</a></li> <li><a href="#">Contact</a></li> </ul> </nav>
CSS
*, *::before, *::after { box-sizing: border-box; } html { font-size: 62.5%; } body { margin: 0; background: #4C6085; color: #ffffff; font-family: 'Oswald', 'sans-serif'; font-size: 1.4rem; font-weight: 700; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; line-height: 1.5; } .menu-toggle { position: absolute; top: 20px; left: 50%; height: 33px; width: 61px; margin-left: -30px; padding: 4px 12px; color: #ffffff; border: 2px solid #ffffff; overflow: hidden; text-decoration: none; text-transform: uppercase; z-index: 20; transform-origin: center center; transition-property: color, border-color, margin-left, width, transform; transition-duration: 0.1s; transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94); transition-delay: 0s, 0s, 0.2s, 0.2s, 0s; } .menu-toggle .label { transition-property: opacity; transition-duration: 0.1s; transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94); transition-delay: 0.4s; } .menu-toggle .close { display: block; position: absolute; top: 6px; left: 8px; font-size: 1.8rem; opacity: 0; transition-property: opacity, transform; transition-duration: 0.1s; transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94); transition-delay: 0s, 0s; } .menu-toggle:hover { border-color: #36F1CD; color: #36F1CD; } .menu-toggle.open { margin-left: -16px; border-color: #36F1CD; color: #36F1CD; height: 33px; width: 33px; transform: rotate(45deg); transition-delay: 0s, 0s, 0s, 0s, 0.2s; } .menu-toggle.open .label { opacity: 0; transition-delay: 0; } .menu-toggle.open .close { opacity: 1; transform: rotate(-45deg); transition-delay: 0.2s, 0s; } .menu-toggle.open:hover { border-color: #ffffff; color: #ffffff; } .menu { position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px; background: rgba(0, 0, 0, 0.4); opacity: 0; z-index: 10; transition: opacity 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); pointer-events: none; } .menu ul { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.6); margin: 0; padding: 0; list-style: none; transition-property: transform; transition-duration: 0.2s; transition-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53); } .menu ul li { position: relative; text-align: center; } .menu ul li a { padding: 0 12px; color: #ffffff; font-size: 3.6rem; text-decoration: none; text-transform: uppercase; letter-spacing: 4px; position: relative; } .menu ul li a::after { position: absolute; bottom: 0; right: 0px; left: auto; transform: translate(0, -50%); display: block; content: ""; height: 4px; width: 0%; background: #36F1CD; transition: width 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); } .menu ul li a:hover::after { left: 0; right: auto; width: 100%; } .menu.open { opacity: 1; pointer-events: auto; } .menu.open ul { transform: translate(-50%, -50%) scale(1); transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94); }
JAVASCRIPT
(function () { $('.menu-toggle').on('click', function (e) { var target; e.preventDefault(); target = $(this).toggleClass('open').data('toggle'); return $('#' + target).toggleClass('open'); }); }.call(this));
Expand for more options Login