Skip to content

Commit 20f7400

Browse files
committed
Refactor header: fixed to relative
HUGE improvement on mobile. Blasting fast
1 parent e105664 commit 20f7400

File tree

4 files changed

+113
-142
lines changed

4 files changed

+113
-142
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
-------------------------------------------------------------------------------------- -->
4545

4646
<div class="header" id="featuredProj">
47+
<a name="featured" class="anchor" data-magellan-destination="featured"></a>
4748
<div class="wrapper" ng-repeat="featured in featureds['projects']" ng-class="{actual: $index <= indexFeatured['projects']}">
4849
<div class="row">
4950
<div class="large-5 columns text-header">
@@ -65,7 +66,6 @@
6566
</div>
6667

6768
<div class="main top">
68-
<a name="featured" class="featured" data-magellan-destination="featured"></a>
6969

7070
<!-- --------------------------------------------------------------------------------------
7171
Projects

js/script.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,8 @@ var scrollUpdate = function () {
338338
// ----------------------------------------------------------------------------
339339
// First parallax: header
340340
if (scrollTop < ($("#featuredProj").height() + 20) ) {
341-
var topLogo_header = ( $(window).scrollTop()/3 ) - 70;
341+
var topLogo_header = ( $(window).scrollTop()*1.5 ) - 70;
342342
$("#featuredProj .logo").css({ top: topLogo_header });
343-
$("#featuredProj .text-header").css({ bottom: 0 + scrollTop });
344343
}
345344

346345
// ----------------------------------------------------------------------------
@@ -353,8 +352,7 @@ var scrollUpdate = function () {
353352
// ----------------------------------------------------------------------------
354353
// 3rd parrallax: footer
355354
var bottomScreen = scrollTop + $(window).height();
356-
var footerBottom = $("#footer").position().top + $("#footer").height() + 350;
357-
var topLogo_footer = Math.round(bottomScreen - footerBottom);
358-
console.log(bottomScreen, footerBottom, topLogo_footer);
355+
var footerBottom = $("#footer").position().top + $("#footer").height();
356+
var topLogo_footer = Math.round(bottomScreen - footerBottom - $(".menu").height());
359357
$("#logo3").css({ bottom: topLogo_footer });
360358
}

0 commit comments

Comments
 (0)