A Pen by White Wolf Wizard on CodePen.
Created
February 24, 2015 21:29
-
-
Save anonymous/357710f0fb9743c48eab to your computer and use it in GitHub Desktop.
Subtle but Bold Navigation
This file contains hidden or 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
<nav id="navigation"> | |
<ul> | |
<li><a href="#" class="active">Home</a></li> | |
<li><a href="#">About</a></li> | |
<li><a href="#">Work</a></li> | |
<li><a href="#">Blog</a></li> | |
<li><a href="#">Contact</a></li> | |
</ul> | |
</nav> |
This file contains hidden or 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
$('#navigation ul li a').on('click', function () { | |
$('#navigation ul li a.active').removeClass('active'); | |
$(this).addClass('active'); | |
}); |
This file contains hidden or 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
$color-base: #fff; | |
$color-text: #888; | |
$color-accent: #848ba0; | |
*, *:before, *:after { box-sizing: border-box; } | |
html, body { width: 100%; height: 100%; } | |
body { background: #efefef; } | |
#navigation { | |
position: absolute; | |
top: 50%; left: 50%; | |
transform: translate(-50%,-50%); | |
ul { | |
padding: 8px; | |
border: 1px solid shade($color-base,10%); | |
border-radius: 5px; | |
background-color: $color-base; | |
background-image: linear-gradient(rgba(#000,0.1),transparent); | |
display: flex; | |
flex-flow: row nowrap; | |
box-shadow: inset 0 1px rgba(#fff,0.5); | |
li { | |
a { | |
position: relative; | |
height: 30px; | |
padding: 0 12px; | |
border: 1px solid shade($color-base,15%); | |
border-right-width: 0; | |
background-color: $color-base; | |
background-image: linear-gradient(transparent,rgba(#000,0.1)); | |
display: block; | |
box-shadow: inset 0 0 0 1px rgba($color-base,0.3); | |
font-size: 8pt; | |
color: $color-text; | |
font-weight: 600; | |
line-height: 29px; | |
text-decoration: none; | |
text-shadow: 0 1px rgba($color-base,0.8); | |
&:hover { background-image: linear-gradient(transparent,rgba(#000,0.06)); } | |
&:active { background-image: linear-gradient(rgba(#000,0.1),transparent); } | |
&.active { | |
border: 1px solid shade($color-accent,15%); | |
border-right-width: 0; | |
background-color: $color-accent; | |
background-image: linear-gradient(rgba(#fff,0.1),rgba(#000,0.1)); | |
z-index: 1; | |
box-shadow: inset 0 1px rgba(#fff,0.3), 1px 0 shade($color-accent,15%); | |
color: $color-base; | |
text-shadow: none; | |
} | |
} | |
&:first-child a { border-radius: 3px 0 0 3px; } | |
&:last-child a { | |
border-right-width: 1px; | |
border-radius: 0 3px 3px 0; | |
&.active { box-shadow: inset 0 1px rgba(#fff,0.3); } | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment