From: vincent@cubedesigners.com Date: Wed, 6 Jul 2016 17:49:34 +0000 (+0000) Subject: Add support of scaling for header | #431 @0:50 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=8f3cea915cd1ad09009c0b37212047989d45e3ac;p=fluidbook-v3.git Add support of scaling for header | #431 @0:50 --- diff --git a/framework/application/views/scripts/common/content.phtml b/framework/application/views/scripts/common/content.phtml index 483d1be..b0ce4f9 100644 --- a/framework/application/views/scripts/common/content.phtml +++ b/framework/application/views/scripts/common/content.phtml @@ -1,8 +1,8 @@ layout()->content . "\n"; -echo '
'; echo $this->render('common/header.phtml'); +echo '
'; echo '
'; echo $content; echo '
'; diff --git a/js/002-common.js b/js/002-common.js index b0b57bf..4fbb3da 100644 --- a/js/002-common.js +++ b/js/002-common.js @@ -1,4 +1,5 @@ registerLoader(load_common, true); +var zoom = 1; function load_common() { $(window).on('cubeitresize', resize); @@ -25,10 +26,11 @@ function resize() { } function setZoom(ww) { - var z = 1; + zoom = 1; if (ww >= 1680) { - z = ww / 1680; + zoom = ww / 1680; } - $('#z').css('transform', 'scale(' + z + ')'); + $('#z,header').css('transform', 'scale(' + zoom + ')'); + } \ No newline at end of file diff --git a/js/101-header.js b/js/101-header.js index 33972ba..c13f7b5 100644 --- a/js/101-header.js +++ b/js/101-header.js @@ -54,7 +54,7 @@ function headerScroll() { goingUp = false; } var adminHeight = $("#adminBar").outerHeight(); - var headerHeight = $("header").outerHeight(); + var headerHeight = $("header").outerHeight() * zoom; if (scrollUp != goingUp) { lastDirChange = s; scrolledDistance = 0; diff --git a/less/101-header.less b/less/101-header.less index 0729a51..d2a3f3c 100644 --- a/less/101-header.less +++ b/less/101-header.less @@ -3,9 +3,9 @@ header { position: fixed; top: 0px; - left: 50%; - transform: translateX(-50%); + //left: 50%; z-index: 10; + transform-origin: 0 0 0; height: 90px; width: 100%; @@ -15,11 +15,12 @@ header { padding: 0 5%; vertical-align: bottom; + #header { height: 90px; width: 100%; position: relative; - + transform-origin: 0 0 0; } nav {