diff --git a/js/script.js b/js/script.js index ac95b74e5a..aa35b766a2 100755 --- a/js/script.js +++ b/js/script.js @@ -46,7 +46,7 @@ function px(n){ var kub = (function () { var HEADER_HEIGHT; - var html, header, mainNav, quickstartButton, hero, encyclopedia, footer, wishField; + var html, header, mainNav, quickstartButton, hero, encyclopedia, footer, wishField, headlineWrapper; $(document).ready(function () { html = $('html'); @@ -58,6 +58,7 @@ var kub = (function () { hero = $('#hero'); encyclopedia = $('#encyclopedia'); footer = $('footer'); + headlineWrapper = $('#headlineWrapper'); HEADER_HEIGHT = header.outerHeight(); resetTheView(); @@ -121,6 +122,17 @@ var kub = (function () { } classOnCondition(html, 'flip-nav', window.pageYOffset > 0); + + if (html[0].id == 'home') { + setHomeHeaderStyles(); + } + } + + function setHomeHeaderStyles() { + var Y = window.pageYOffset; + var quickstartBottom = quickstartButton[0].getBoundingClientRect().bottom; + + classOnCondition(html[0], 'y-enough', Y > quickstartBottom); } function toggleMenu() { @@ -439,4 +451,4 @@ var pushmenu = (function(){ }; })(); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIs+ALWJhc2VDb21wb25lbnRzLmpzIiwic2NyaXB0LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FDTkE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FB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