From 1410984d32ad32647340f56845de5f2c46d3d226 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 20 Dec 2017 17:07:58 +0000 Subject: [PATCH] #1809 --- .../forms/CMS/Sub/Features/Feature.php | 3 + .../forms/CMS/Sub/Home/Services/Example.php | 4 ++ .../views/helpers/FeaturesSection.php | 4 ++ .../views/helpers/HomeServices.php | 21 ++++--- less/106-logos.less | 2 + less/410-features.less | 62 +++++++++++++++++++ 6 files changed, 88 insertions(+), 8 deletions(-) diff --git a/framework/application/forms/CMS/Sub/Features/Feature.php b/framework/application/forms/CMS/Sub/Features/Feature.php index d0a59a0..2ddc078 100644 --- a/framework/application/forms/CMS/Sub/Features/Feature.php +++ b/framework/application/forms/CMS/Sub/Features/Feature.php @@ -37,5 +37,8 @@ class Fluidbook_Form_CMS_Sub_Features_Feature extends CubeIT_Form_SubForm { )); $this->addElement($layout); + $link = new CubeIT_Form_Element_Link('link'); + $link->setLabel('Lien'); + $this->addSubForm($link, 'link'); } } \ No newline at end of file diff --git a/framework/application/forms/CMS/Sub/Home/Services/Example.php b/framework/application/forms/CMS/Sub/Home/Services/Example.php index 8bf4a75..8dff399 100644 --- a/framework/application/forms/CMS/Sub/Home/Services/Example.php +++ b/framework/application/forms/CMS/Sub/Home/Services/Example.php @@ -16,5 +16,9 @@ class Fluidbook_Form_CMS_Sub_Home_Services_Example extends CubeIT_Form_SubForm { $image = new CubeIT_Form_Element_File_Image('image'); $image->setLabel('Image'); $this->addElement($image); + + $link = new CubeIT_Form_Element_Link('link'); + $link->setLabel('Link'); + $this->addSubForm($link, 'link'); } } \ No newline at end of file diff --git a/framework/application/views/helpers/FeaturesSection.php b/framework/application/views/helpers/FeaturesSection.php index e4e37cb..12044f9 100644 --- a/framework/application/views/helpers/FeaturesSection.php +++ b/framework/application/views/helpers/FeaturesSection.php @@ -19,6 +19,10 @@ class Fluidbook_View_Helper_FeaturesSection extends CubeIT_View_Helper_Abstract $text_colour = $this->hasGradient($block) ? 'light' : 'dark'; $res .= '
'; + $link = $this->linkCMS($block['link'], ['class' => 'button']); + if ($link) { + $res .= $this->htmlElement($link, 'div', ['class' => 'more']); + } $res .= $this->_CSS($id, $block); diff --git a/framework/application/views/helpers/HomeServices.php b/framework/application/views/helpers/HomeServices.php index b4b0613..00063f1 100644 --- a/framework/application/views/helpers/HomeServices.php +++ b/framework/application/views/helpers/HomeServices.php @@ -33,7 +33,7 @@ class Fluidbook_View_Helper_HomeServices extends Fluidbook_View_Helper_HomeLayer $res .= '
'; foreach ($data['examples'] as $example) { - $img = $this->imageProcess($example['image'], $example['title'], 810, 506, [], 'C', 'C', 'M', false, 'auto', null, 82); + $img = $this->imageProcess($example['image'], $example['title'], 810, 506, [], 'C', 'C', 'M', false, 'auto', null, 82); $rollover = $this->_rollover($example); $res .= $this->htmlElement($img . $rollover, 'div', ['data-title' => $example['title']]); } @@ -48,22 +48,27 @@ class Fluidbook_View_Helper_HomeServices extends Fluidbook_View_Helper_HomeLayer public function _rollover($example) { - $res = ''; - + $link = false; if ($example['exemple']) { $model = Fluidbook_Model_Reference::findOneById($example['exemple']); if ($model) { - $ex = $model->unserialize(); + $ex = $model->unserialize(); - if ($ex->hasUrl()) { - $res .= $this->linkTruePopupFullscreen(__('Voir le Fluidbook'), $ex->getFinalUrl(), ['class' => 'button']); - } - } + if ($ex->hasUrl()) { + $link = true; + $res .= $this->linkTruePopupFullscreen(__('Voir le Fluidbook'), $ex->getFinalUrl(), ['class' => 'button']); + } + } } + if (!$link) { + $res .= $this->linkCMS($example['link'], ['class' => 'button']); + } + + $res = $this->htmlElement($res, 'div', ['class' => 'inner']); // Wrapper for vertical centering return $this->htmlElement($res, 'div', ['class' => 'more']); } diff --git a/less/106-logos.less b/less/106-logos.less index a554e48..bbd6b75 100644 --- a/less/106-logos.less +++ b/less/106-logos.less @@ -37,6 +37,8 @@ img { vertical-align: middle; + max-width: 100%; + max-height: 100%; } } } diff --git a/less/410-features.less b/less/410-features.less index 2653514..ac213cc 100644 --- a/less/410-features.less +++ b/less/410-features.less @@ -120,6 +120,68 @@ background-size: 100%; color: @color-text; + .more { + //display: none; + opacity: 0; + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + background-color: rgba(42, 50, 58, .9); + color: #fff; + z-index: 3; + text-align: center; + padding-top: 30%; + padding-left: 10px; + padding-right: 10px; + transition: opacity @transition-time-buttons; + @media @m640 { + //padding-top: 55%; + } + a.others { + display: block; + color: #fff; + text-transform: uppercase; + font-family: @montserrat; + font-size: 12px; + font-weight: 300; + margin-top: 35px; + text-decoration: none; + @media @m640 { + display: none; + } + } + p, h3 { + transition: color @transition-time-buttons; + } + + .button { + background-color: transparent; + color: #343c44; + border: 0; + text-transform: uppercase; + font-family: @montserrat; + font-weight: 300; + font-size: 12px; + line-height: 18px; + cursor: pointer; + float: none; + display: inline-block; + margin-top: 0; + + .border-button-fill(#fff, rgba(231, 92, 123, 1)); + .longarrow-button(16px, 40px, 18px); + } + } + + &:hover { + .more { + //display: block; + opacity: 1; + } + } + [data-cols="1"] & { width: 100% !important; padding-bottom: 0 !important; -- 2.39.5