Permalink
Browse files

invert menu on dark background

  • Loading branch information...
1 parent 077e1d5 commit 3959a695f42b9d2b3fd85b3b8952f85969bf7a36 @digitaltom digitaltom committed Feb 28, 2013
Showing with 21 additions and 9 deletions.
  1. +6 −5 css/hackweek.css
  2. +3 −1 index.html
  3. +12 −3 js/hackweek.js
View
@@ -26,7 +26,6 @@ li {
margin: 0 auto;
width: 100%;
height: 100%;
- z-index: 0;
}
#navigation {
margin-left: 20px;
@@ -43,13 +42,15 @@ li {
#navigation .active{
font-weight: bold;
}
-.inactive{
- font-weight: normal;
+
+#navigation .invert{
+ color: #fff;
}
+
#start-link{
height: 80px;
}
-.logo-color{
+.logo{
background: url('../images/suse-logo-color.png');
background-repeat: no-repeat;
background-position: left top;
@@ -59,7 +60,7 @@ li {
background-repeat: no-repeat;
background-position: left top;
}
-.logo-white{
+.logo.invert{
background: url('../images/suse-logo-white.png');
background-repeat: no-repeat;
background-position: left top;
View
@@ -8,7 +8,9 @@
</head>
<body>
<div id="navigation">
- <div id="start-link" class="logo-color"></div>
+ <li id="start-link" class="logo">
+
+ </li>
<li id="what-is-link">
what is hack week?
</li>
View
@@ -61,12 +61,12 @@ $(function () {
$(window).scroll(function () {
/* hide - unhide navigation */
- if (!$('#navigation').is(":visible") && $(window).scrollTop() >= $('#what-is').height()/2) {
+ if (!$('#navigation').is(":visible") && $(window).scrollTop() >= $('#what-is').height()/1.5) {
$('#navigation').fadeIn()
$('#arrow-start').fadeOut()
}
- if ($('#navigation').is(":visible") && $(window).scrollTop() < $('#what-is').height()/2) {
+ if ($('#navigation').is(":visible") && $(window).scrollTop() < $('#what-is').height()/1.5) {
$('#navigation').fadeOut()
$('#arrow-start').fadeIn()
}
@@ -85,7 +85,7 @@ $(function () {
/* where page text scroll animation */
if ($(window).scrollTop() > $('#join').position().top) {
var percent_scrolled_out = -($(window).scrollTop() - $('#where').position().top) / $('#where').height()
- $('#where-title').css({'opacity': 1 - percent_scrolled_out,
+ $('#where-title').css({'opacity': 1 - percent_scrolled_out/2,
right: percent_scrolled_out * -500})
}
@@ -107,6 +107,15 @@ $(function () {
$('#what-is-link').addClass('active')
}
+ /* invert navigation color */
+ $('#navigation li').each(function( index ) {
+ $(this).removeClass('invert')
+ if (($(this).position().top + $(this).height() > $("#projects").position().top - $(window).scrollTop()) &&
+ ($(this).position().top + $(this).height() < $("#agenda").position().top - $(window).scrollTop())) {
+ $(this).addClass('invert')
+ }
+ });
+
})

0 comments on commit 3959a69

Please sign in to comment.