Skip to content

Commit

Permalink
Adding parallax BG because everybody loves that shit
Browse files Browse the repository at this point in the history
and I do too
  • Loading branch information
Angry-Russian committed Aug 28, 2016
1 parent 45b3f01 commit cbdfebb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion script.js
Expand Up @@ -3,8 +3,11 @@ $(function(){

// Fade the top bar to black when scrolling beyond 30% of the first screen by adding .dark
$(window).on('scroll', function(e){
var isDark = $("body").scrollTop() > $('section').first().height() * 0.3;
var top = $("body").scrollTop();
var isDark = top > $('#cover').first().height() * 0.3;
$('nav').toggleClass('dark', isDark);

$('#cover').css({"background-position-y": -top/2 + "px"})
}).trigger('scroll');

})
2 changes: 0 additions & 2 deletions style.css
Expand Up @@ -138,8 +138,6 @@ section#cover .underline{
.divider{
min-height: 6em;
background: rgba(250, 250, 250, 0.85);
/*background: url(http://thumb7.shutterstock.com/display_pic_with_logo/2785297/382739011/stock-photo-macro-shot-of-beer-and-beer-foam-in-glass-ideal-for-use-as-a-background-or-backdrop-in-your-382739011.jpg) center top repeat-x;
*/
}

.divider.by-three .container > div{
Expand Down

0 comments on commit cbdfebb

Please sign in to comment.