Instantly share code, notes, and snippets.
Last active
February 7, 2018 10:15
-
Star
(0)
0
You must be signed in to star a gist -
Fork
(0)
0
You must be signed in to fork a gist
-
Save Rockbeard/093c24fe22a828eb3a06d9c825738d7a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.header_nav .nav_item { | |
position: relative; | |
margin-right: 15px; | |
display: inline-block; | |
} | |
.header_nav .nav_item:last-child { | |
margin-right: 0; | |
} | |
.header_nav .nav_item a { | |
position: relative; | |
} | |
.header_nav .nav_item a:before { | |
content: ''; | |
height: 4px; | |
width: 0; | |
position: absolute; | |
bottom: -4px; | |
background-color: #62cbe9; | |
transition: width 0.3s; | |
} | |
.header_nav .nav_item a:hover:before { | |
width: 100%; | |
} | |
.header_nav .nav_item .item_name { | |
cursor: default; | |
} | |
.header_nav .item_dropdawn { | |
display: none; | |
width: 210px; | |
padding: 20px 10px; | |
margin: 0; | |
/*opacity: 0;*/ | |
position: absolute; | |
top: 100%; | |
left: 0; | |
text-align: left; | |
transition: opacity 0.3s; | |
background: rgba(98, 205, 233, 0.7); | |
} | |
.header_nav .nav_item:hover .item_dropdawn { | |
display: block; | |
/*opacity: 1;*/ | |
} | |
.header_nav .item_dropdawn .dropdawn_item { | |
color: #fff; | |
margin-bottom: 10px; | |
} | |
.header_nav .item_dropdawn .dropdawn_item:last-child { | |
margin-bottom: 0; | |
} | |
.header_nav .item_dropdawn .dropdawn_item a:before { | |
background-color: #fff; | |
} | |
#humburger-icon { | |
display: none; | |
} | |
@media only screen and (max-width: 1200px) { | |
.header_nav { | |
opacity: 0; | |
width: 100%; | |
margin: 0; | |
position: fixed; | |
top: 0; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
z-index: -1; | |
text-align: center; | |
background: rgba(50, 50, 50, 0.9); | |
} | |
.header_nav > ul { | |
position: absolute; | |
width: 500px; | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%); | |
} | |
.header_nav .nav_item { | |
display: block; | |
margin-right: 0; | |
margin-bottom: 30px; | |
color: #fff; | |
} | |
.header_nav .nav_item:last-child { | |
margin-bottom: 0; | |
} | |
.header_nav .item_dropdawn { | |
position: static; | |
display: none; | |
margin: auto; | |
text-align: center; | |
} | |
#humburger-icon { | |
display: block; | |
} | |
#humburger-icon.open { | |
z-index: 2; | |
} | |
} | |
/* =========================== | |
* ANIMATIONS | |
** =========================== */ | |
#humburger-icon { | |
width: 35px; | |
height: 45px; | |
position: absolute; | |
bottom: -20px; | |
right: 15px; | |
margin: 50px auto; | |
-webkit-transform: rotate(0deg); | |
-moz-transform: rotate(0deg); | |
-o-transform: rotate(0deg); | |
transform: rotate(0deg); | |
-webkit-transition: .5s ease-in-out; | |
-moz-transition: .5s ease-in-out; | |
-o-transition: .5s ease-in-out; | |
transition: .5s ease-in-out; | |
cursor: pointer; | |
} | |
#humburger-icon span { | |
display: block; | |
position: absolute; | |
height: 6px; | |
width: 100%; | |
background: #62cbe9; | |
border-radius: 9px; | |
opacity: 1; | |
left: 0; | |
-webkit-transform: rotate(0deg); | |
-moz-transform: rotate(0deg); | |
-o-transform: rotate(0deg); | |
transform: rotate(0deg); | |
-webkit-transition: .25s ease-in-out; | |
-moz-transition: .25s ease-in-out; | |
-o-transition: .25s ease-in-out; | |
transition: .25s ease-in-out; | |
} | |
/* Icon 3 */ | |
#humburger-icon span:nth-child(1) { | |
top: 0px; | |
} | |
#humburger-icon span:nth-child(2),#humburger-icon span:nth-child(3) { | |
top: 9px; | |
} | |
#humburger-icon span:nth-child(4) { | |
top: 18px; | |
} | |
#humburger-icon.open span:nth-child(1) { | |
top: 9px; | |
width: 0%; | |
left: 50%; | |
} | |
#humburger-icon.open span:nth-child(2) { | |
-webkit-transform: rotate(45deg); | |
-moz-transform: rotate(45deg); | |
-o-transform: rotate(45deg); | |
transform: rotate(45deg); | |
} | |
#humburger-icon.open span:nth-child(3) { | |
-webkit-transform: rotate(-45deg); | |
-moz-transform: rotate(-45deg); | |
-o-transform: rotate(-45deg); | |
transform: rotate(-45deg); | |
} | |
#humburger-icon.open span:nth-child(4) { | |
top: 18px; | |
width: 0%; | |
left: 50%; | |
} | |
/* =========================== | |
* ANIMATIONS | |
** =========================== */ | |
.s-show { | |
animation: show 0.3s forwards; | |
} | |
.s-hide { | |
animation: hide 0.3s forwards; | |
} | |
@keyframes show { | |
1% { | |
opacity: 0; | |
} | |
2% { | |
z-index: 2; | |
} | |
to { | |
z-index: 2; | |
opacity: 1; | |
} | |
} | |
@keyframes hide { | |
from { | |
opacity: 1; | |
} | |
to { | |
z-index: 0; | |
opacity: 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment