started responsive dev for mobile

This commit is contained in:
2017-02-28 17:28:05 +01:00
parent 7edbac2b53
commit 0509d74884
4 changed files with 320 additions and 143 deletions
@@ -35,15 +35,20 @@
header_height = $header.height(),
$slogan = $('#header h2'),
fontsize = parseInt($slogan.css('font-size')), tmpfs,
scrolltop;
scrolltop, limit = 300;
console.log('font-size', fontsize);
$(window).on('scroll', function(event) {
scrolltop = $(this).scrollTop() * .5;
console.log('scrolltop', scrolltop);
$header.height(header_height-scrolltop > 90 ? header_height-scrolltop : 90);
tmpfs = (300 - (scrolltop < 100 ? scrolltop : 100)) / 300 * fontsize;
scrolltop = limit - $(this).scrollTop() * .5;
scrolltop = Math.max(limit*0.35,scrolltop);
// console.log('scrolltop', scrolltop);
alpha = scrolltop/limit;
console.log('scrolltop '+scrolltop+' | allpha '+alpha);
$header.height(header_height*alpha);
tmpfs = fontsize*alpha;
$slogan.css('font-size', tmpfs+"px");
});
};