From 7fffbc23f71f4af04e26f6fe8978246d52456d27 Mon Sep 17 00:00:00 2001 From: JT Date: Tue, 8 Apr 2014 21:00:59 -0700 Subject: [PATCH] responsive/finishing touches --- website/source/javascripts/app/deploy/site.js | 8 +++++++- .../source/javascripts/app/deploy/site.min.js | 2 +- website/source/javascripts/app/homepage.js | 8 +++++++- website/source/layouts/_footer.erb | 6 +++--- website/source/stylesheets/_docs.less | 4 ++-- website/source/stylesheets/_header.less | 16 +++++++++++----- website/source/stylesheets/_variables.less | 2 +- website/source/stylesheets/main.css | 8 ++++++-- 8 files changed, 38 insertions(+), 16 deletions(-) diff --git a/website/source/javascripts/app/deploy/site.js b/website/source/javascripts/app/deploy/site.js index 79a6dd002..098863ffd 100644 --- a/website/source/javascripts/app/deploy/site.js +++ b/website/source/javascripts/app/deploy/site.js @@ -66,7 +66,8 @@ var APP = APP || {}; //cache elements this.ui = { $doc: $(window), - $hero: $('#jumbotron') + $hero: $('#jumbotron'), + $collapse: $('.navbar-collapse') } this.addEventListeners(); @@ -80,6 +81,11 @@ var APP = APP || {}; return; _this.ui.$doc.scroll(function() { + + //if collapseable menu is open dont do parrallax. It looks wonky. Bootstrap conflict + if( _this.ui.$collapse.hasClass('in')) + return; + var top = _this.ui.$doc.scrollTop(), speedAdj = (top*0.8), speedAdjOffset = speedAdj - top; diff --git a/website/source/javascripts/app/deploy/site.min.js b/website/source/javascripts/app/deploy/site.min.js index 17bca6be4..ea3bd58f6 100644 --- a/website/source/javascripts/app/deploy/site.min.js +++ b/website/source/javascripts/app/deploy/site.min.js @@ -1 +1 @@ -var APP=function(){function a(){APP.Utils.runIfClassNamePresent("page-home",b)}function b(){APP.Homepage.init()}return{initialize:a}}(),APP=APP||{};APP.Utils=function(){return{isMobile:function(){return navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i)?!0:!1}(),runIfClassNamePresent:function(a,b){var c=document.getElementsByClassName(a);c.length>0&&b()}}}();var APP=APP||{};!function(){APP.Homepage=function(){return{ui:null,init:function(){this.ui={$doc:$(window),$hero:$("#jumbotron")},this.addEventListeners()},addEventListeners:function(){var a=this;APP.Utils.isMobile||a.ui.$doc.scroll(function(){var b=a.ui.$doc.scrollTop(),c=.8*b,d=c-b;a.ui.$hero.css("webkitTransform","translate(0, "+c+"px)"),a.ui.$hero.find(".container").css("webkitTransform","translate(0, "+d+"px)")})}}}()}(jQuery,this); \ No newline at end of file +var APP=function(){function a(){APP.Utils.runIfClassNamePresent("page-home",b)}function b(){APP.Homepage.init()}return{initialize:a}}(),APP=APP||{};APP.Utils=function(){return{isMobile:function(){return navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i)?!0:!1}(),runIfClassNamePresent:function(a,b){var c=document.getElementsByClassName(a);c.length>0&&b()}}}();var APP=APP||{};!function(){APP.Homepage=function(){return{ui:null,init:function(){this.ui={$doc:$(window),$hero:$("#jumbotron"),$collapse:$(".navbar-collapse")},this.addEventListeners()},addEventListeners:function(){var a=this;APP.Utils.isMobile||a.ui.$doc.scroll(function(){if(!a.ui.$collapse.hasClass("in")){var b=a.ui.$doc.scrollTop(),c=.8*b,d=c-b;a.ui.$hero.css("webkitTransform","translate(0, "+c+"px)"),a.ui.$hero.find(".container").css("webkitTransform","translate(0, "+d+"px)")}})}}}()}(jQuery,this); \ No newline at end of file diff --git a/website/source/javascripts/app/homepage.js b/website/source/javascripts/app/homepage.js index d51e369ee..9af3e6d7c 100644 --- a/website/source/javascripts/app/homepage.js +++ b/website/source/javascripts/app/homepage.js @@ -14,7 +14,8 @@ var APP = APP || {}; //cache elements this.ui = { $doc: $(window), - $hero: $('#jumbotron') + $hero: $('#jumbotron'), + $collapse: $('.navbar-collapse') } this.addEventListeners(); @@ -28,6 +29,11 @@ var APP = APP || {}; return; _this.ui.$doc.scroll(function() { + + //if collapseable menu is open dont do parrallax. It looks wonky. Bootstrap conflict + if( _this.ui.$collapse.hasClass('in')) + return; + var top = _this.ui.$doc.scrollTop(), speedAdj = (top*0.8), speedAdjOffset = speedAdj - top; diff --git a/website/source/layouts/_footer.erb b/website/source/layouts/_footer.erb index 86e90bf30..baba29eff 100644 --- a/website/source/layouts/_footer.erb +++ b/website/source/layouts/_footer.erb @@ -22,9 +22,9 @@ - - - + + +