From 29a1547e91505d4bc689fbdd7dc615917884077b Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 8 Jan 2015 15:11:35 +0000 Subject: [PATCH] hide admin bar on small resolutions updated the slideshow (continuous) to make is responsive --- js/slideshow.js | 25 ++++++++++++++++++------- less/admin.less | 32 ++++++++++++++++++-------------- less/mixins.less | 10 ++++++---- 3 files changed, 42 insertions(+), 25 deletions(-) diff --git a/js/slideshow.js b/js/slideshow.js index 99d99c5..a22d4c7 100644 --- a/js/slideshow.js +++ b/js/slideshow.js @@ -1,13 +1,24 @@ registerLoader(loadCarrousel); function loadCarrousel() { - $(window).on('cubeitresize', function () { - var s = $(".slideshow,.slideshowcontinuous"); - var ww = $(window).width(); - var m = (ww - 1600) / 2; - $(s).find(".imgholder").css({marginLeft: m}); - $(s).find(".arrows").css({left: 960 + ((ww - 960) / 2) - 77 - 10 - 30}); - }); + $(window).on('cubeitresize', function () { + var s = $(".slideshow,.slideshowcontinuous"); + var ww = $(window).width(); + var cw = Math.min(960, ww - 70); + var m = (ww - 1600) / 2; + $(s).find(".imgholder").css({marginLeft: m}); + $(s).find(".arrows").css({left: cw + ((ww - cw) / 2) - 77 - 10 - 30}); + + if (ww < 1024) { + var ratio = 1024 / 650; + var h = ww / ratio; + try { + $(".slideshowcontinuous").data('slideshowContinuous').setHeight(h); + } catch (err) { + + } + } + }); } diff --git a/less/admin.less b/less/admin.less index ed35cff..301c58c 100644 --- a/less/admin.less +++ b/less/admin.less @@ -1,27 +1,31 @@ -#adminBar{ - background:#84AE1E; - padding:3px 0 3px; +@import "mixins"; +#adminBar { + @media @small{ + display: none; + } + + background: #84AE1E; + padding: 3px 0 3px; - .bar{ - color:#fff; - font-size:11px; + .bar { + color: #fff; + font-size: 11px; line-height: 8px; font-weight: 400; - height:auto; - #adminBar a{ - color:#fff; - margin:0 5px; + height: auto; + #adminBar a { + color: #fff; + margin: 0 5px; } - &.right{ - .right{ - float:right; + &.right { + .right { + float: right; } } } } - #tags_secondaires-element select, #technologies-element select { height: 200px; diff --git a/less/mixins.less b/less/mixins.less index 058487a..109edee 100644 --- a/less/mixins.less +++ b/less/mixins.less @@ -1,3 +1,5 @@ +@small : ~"screen and (max-width: 1024px)"; + /* REMOVED FOR NOW - too much refactoring required to apply this neatly... @@ -27,14 +29,14 @@ REMOVED FOR NOW - too much refactoring required to apply this neatly... // PLAN B: .media { - overflow: hidden; + overflow: hidden; } .media--item { - float: left; - margin-right: 25px; + float: left; + margin-right: 25px; } .media--body { - overflow: hidden; + overflow: hidden; } \ No newline at end of file -- 2.39.5