From 373cf3402cf04f7d77d27516c1e05e5dee4b3ce4 Mon Sep 17 00:00:00 2001 From: "stephen@cubedesigners.com" Date: Wed, 27 Jul 2016 10:22:19 +0000 Subject: [PATCH] WIP #4 @2.25 --- .../views/helpers/BackgroundBlock.php | 8 ++++++-- .../views/helpers/HomeCustomers.php | 8 +++++--- .../views/helpers/HomeFeatures.php | 7 +++++-- .../views/helpers/HomeServices.php | 4 +++- js/101-header.js | 20 +++++++++++-------- less/002-common.less | 2 +- less/104-nav.less | 6 +++++- less/210-home.less | 15 +++++++------- 8 files changed, 44 insertions(+), 26 deletions(-) diff --git a/framework/application/views/helpers/BackgroundBlock.php b/framework/application/views/helpers/BackgroundBlock.php index 175ca25..9313c5f 100644 --- a/framework/application/views/helpers/BackgroundBlock.php +++ b/framework/application/views/helpers/BackgroundBlock.php @@ -20,9 +20,13 @@ class Fluidbook_View_Helper_BackgroundBlock extends CubeIT_View_Helper_Abstract // Work out the ratio of the background image CubeIT_Image::getDimensions($image_path, $image_width, $image_height); $image_ratio = $image_height / $image_width; + $attributes['data-bg-ratio'] = $image_ratio; - $style = "background-image: url($image_path);"; - $attributes['data-bg-ratio'] = $image_ratio; + $style = "background-image: url($image_path);"; + + if (isset($data['backgroundcolor'])) { + $style .= 'background-color:'. $data['backgroundcolor']; + } } if (isset($data['bg_color'])) { diff --git a/framework/application/views/helpers/HomeCustomers.php b/framework/application/views/helpers/HomeCustomers.php index b61b771..84f2b37 100644 --- a/framework/application/views/helpers/HomeCustomers.php +++ b/framework/application/views/helpers/HomeCustomers.php @@ -5,11 +5,13 @@ class Fluidbook_View_Helper_HomeCustomers extends Fluidbook_View_Helper_HomeLaye * @return string */ public function homeCustomers($data) { - $this->data=$data; - $res = ''; + $this->data = $data; + $res = $this->title($data['title']); + $res .= $this->markupDotclear($data['content']); + $res .= $this->linkCMS($data['button'], ['class' => 'btn', 'style' => 'background:'. $data['themecolor']]); - return $this->_layer($res, 'customers'); + return $this->_layer($res, 'customers'); } } \ No newline at end of file diff --git a/framework/application/views/helpers/HomeFeatures.php b/framework/application/views/helpers/HomeFeatures.php index c97ac7c..40f9e4c 100644 --- a/framework/application/views/helpers/HomeFeatures.php +++ b/framework/application/views/helpers/HomeFeatures.php @@ -5,9 +5,12 @@ class Fluidbook_View_Helper_HomeFeatures extends Fluidbook_View_Helper_HomeLayer * @return string */ public function homeFeatures($data) { - $this->data=$data; - $res=''; + $this->data = $data; + + $res = $this->title($data['title']); + $res .= $this->markupDotclear($data['content']); + $res .= $this->linkCMS($data['button'], ['class' => 'btn', 'style' => 'background:'. $data['themecolor']]); return $this->_layer($res, 'features'); } diff --git a/framework/application/views/helpers/HomeServices.php b/framework/application/views/helpers/HomeServices.php index b7824a4..442d7f6 100644 --- a/framework/application/views/helpers/HomeServices.php +++ b/framework/application/views/helpers/HomeServices.php @@ -7,7 +7,9 @@ class Fluidbook_View_Helper_HomeServices extends Fluidbook_View_Helper_HomeLayer public function homeServices($data) { $this->data = $data; - $res = ''; + $res = $this->title($data['title']); + $res .= $this->markupDotclear($data['content']); + $res .= $this->linkCMS($data['button'], ['class' => 'btn', 'style' => 'background:'. $data['themecolor']]); return $this->_layer($res, 'services'); } diff --git a/js/101-header.js b/js/101-header.js index cf3f587..b6fd865 100644 --- a/js/101-header.js +++ b/js/101-header.js @@ -129,15 +129,19 @@ function changeHeaderStyle() { } }); - var headerClass = $(section).data('headerstyle'); - if (headerClass == 'light') { - if (!$("header").hasClass('light')) { - $("header,#nav-icon").addClass('light').removeClass('dark'); - } - } else { - if (!$("header").hasClass('dark')) { - $("header,#nav-icon").addClass('dark').removeClass('light'); + if (section !== undefined) { + + var headerClass = section.data('headerstyle'); + if (headerClass == 'light') { + if (!$("header").hasClass('light')) { + $("header,#nav-icon").addClass('light').removeClass('dark'); + } + } else { + if (!$("header").hasClass('dark')) { + $("header,#nav-icon").addClass('dark').removeClass('light'); + } } + } } \ No newline at end of file diff --git a/less/002-common.less b/less/002-common.less index 1219281..74e60ce 100644 --- a/less/002-common.less +++ b/less/002-common.less @@ -85,7 +85,7 @@ a { padding-bottom: 5%; &.fullheight { min-height: 100%; - background-size: cover; + background-size: 100%; } } diff --git a/less/104-nav.less b/less/104-nav.less index 8201306..f5d6b26 100644 --- a/less/104-nav.less +++ b/less/104-nav.less @@ -116,11 +116,15 @@ nav#menu { a { transition: @transition-time-buttons color; + + header#h.light & { + color: @color-header-grey; + } } &.active a, a:hover { border-bottom-color: transparent; - color: @color-submenu-hover; + color: @color-submenu-hover !important; } } } diff --git a/less/210-home.less b/less/210-home.less index b33df7b..56cea0d 100644 --- a/less/210-home.less +++ b/less/210-home.less @@ -14,12 +14,10 @@ transform: translateY(-50%); } - .dotclear { - max-width: 500px; - } - .btn { .button(); + color: #fff; + margin-top: 30px; } section { @@ -36,12 +34,13 @@ } } + .dotclear { + max-width: 500px; + } + // Sections &.intro { - .btn { - color: #fff; - margin-top: 30px; - } + } } } \ No newline at end of file -- 2.39.5