From afaa8a304203329b752b6ae2d76bfcaeb8a127f0 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 29 Aug 2016 11:53:05 +0000 Subject: [PATCH] wip #600 @2 --- .../views/helpers/BackgroundBlock.php | 14 +++++++--- less/002-common.less | 26 +++++++++++++++++++ less/102-intro.less | 1 - 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/framework/application/views/helpers/BackgroundBlock.php b/framework/application/views/helpers/BackgroundBlock.php index e52c1c6..cfa7dda 100644 --- a/framework/application/views/helpers/BackgroundBlock.php +++ b/framework/application/views/helpers/BackgroundBlock.php @@ -11,6 +11,9 @@ class Fluidbook_View_Helper_BackgroundBlock extends CubeIT_View_Helper_Abstract if (isset($data['backgroundimage']) && !isset($data['bg_image'])) { $data['bg_image'] = $data['backgroundimage']; } + if (isset($data['backgroundcolor']) && !isset($data['bg_color'])) { + $data['bg_color'] = $data['backgroundcolor']; + } if (isset($data['bg_image'])) { $bgimage = CubeIT_Util_Cms::extractFile($data['bg_image']); $extra_attributes = array(); @@ -22,10 +25,15 @@ class Fluidbook_View_Helper_BackgroundBlock extends CubeIT_View_Helper_Abstract $image_ratio = $image_height / $image_width; $attributes['data-bg-ratio'] = $image_ratio; - $style = "background-image: url($image_path);"; + if ( + Bootstrap::getInstance()->getAuthUser()->getEmail() == 'vincent@cubedesigners.com' + ) { + $mobile = $this->imageProcess()->imageProcessGetURL($image_path, '', $image_width * 0.55, $image_height, array(), 'C', 'R', 'M'); - if (isset($data['backgroundcolor'])) { - $style .= 'background-color:' . $data['backgroundcolor']; + $bg = $this->htmlElement($this->picture(array(array('src' => $image_path, "width" => 1680), array("src" => $mobile, "width" => 1680, 'media' => '(max-width: 900px)'))), 'div', array('class' => 'picture')); + $content = $bg . $content; + } else { + $style .= "background-image: url($image_path);"; } } } diff --git a/less/002-common.less b/less/002-common.less index 759f525..3692fb3 100644 --- a/less/002-common.less +++ b/less/002-common.less @@ -87,6 +87,7 @@ a { } .content-wrapper { + position: relative; width: 100%; padding-top: 4%; padding-bottom: 5%; @@ -94,6 +95,31 @@ a { min-height: 100%; background-size: 100%; } + + .picture { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 1000px; + z-index: 0; + picture { + img { + width: 100%; + height: auto; + display: block; + position: absolute; + right: 0; + bottom: 0; + } + } + } + + + .grid { + position: relative; + z-index: 1; + } } .no-shrink { diff --git a/less/102-intro.less b/less/102-intro.less index eb5b753..2ba80ee 100644 --- a/less/102-intro.less +++ b/less/102-intro.less @@ -22,7 +22,6 @@ @media @m768 { padding-top: 80px; } - } blockquote { -- 2.39.5