\r
$extra_attributes = array();\r
$bg = '';\r
+ $mobiles = [];\r
if ($data['bg_image']) {\r
- foreach ($data['bg_image'] as $img) {\r
+ foreach ($data['bg_image'] as $key => $img) {\r
$bgimage = CubeIT_Util_Cms::extractFile($img);\r
$image_path = CubeIT_View_Helper_ImageCms::getPath($bgimage);\r
\r
}\r
} else {\r
if (isset($data['backgroundmobileimage'])) {\r
- $bgmobileimage = CubeIT_Util_Cms::extractFile($data['backgroundmobileimage']);\r
+ $bgmobileimage = CubeIT_Util_Cms::extractFile($data['backgroundmobileimage'][$key]);\r
if ($bgmobileimage) {\r
$attributes['data-has-mobile'] = '1';\r
$mobile_path = CubeIT_View_Helper_ImageCms::getPath($bgmobileimage);\r
CubeIT_Image::getDimensions($mobile_path, $image_width, $image_height);\r
$image_ratio = $image_height / $image_width;\r
$attributes['data-mobile-ratio'] = $image_ratio;\r
- $target_height = $mobile_max_width * $image_ratio;\r
+ $target_height = 2000 * $image_ratio;\r
$mobile = $this->imageProcess()->imageProcessGetURL($mobile_path, '', $mobile_max_width, $target_height, array(), 'C', 'R', 'M');\r
} else {\r
$mobile = $this->imageProcess()->imageProcessGetURL($image_path, '', $mobile_max_width, $target_height, array(), 'C', 'R', 'M');\r
$mobile = $this->imageProcess()->imageProcessGetURL($image_path, '', $mobile_max_width, $target_height, array(), 'C', 'R', 'M');\r
}\r
\r
- $pict = $this->picture([\r
- [\r
- 'src' => $image_path,\r
- 'width' => 2560\r
+\r
+ $pict = $this->picture([\r
+ [\r
+ 'src' => $image_path,\r
+ 'width' => 2560\r
+ ],\r
+ [\r
+ 'src' => $mobile,\r
+ 'width' => $mobile_max_width,\r
+ 'media' => '(max-width: 900px)'\r
+ ]\r
],\r
- [\r
- 'src' => $mobile,\r
- 'width' => $mobile_max_width,\r
- 'media' => '(max-width: 900px)'\r
- ]\r
- ],\r
- [\r
- 'alt' => $data['title']\r
- ]);\r
+ [\r
+ 'alt' => $data['title']\r
+ ]);\r
}\r
$bg .= $this->htmlElement($pict, 'div', array('class' => 'picture'));\r
}\r
- $content = $bg . $content;\r
+ $content = '<div class="pictures-container">'.$bg . '</div>'.$content;\r
}\r
}\r
\r
@import "000-imports";\r
\r
.home {\r
- .intro .picture {\r
- background-color: #f2f6ff;\r
- opacity: 0;\r
+ .intro {\r
+ .content-wrapper {\r
+ @media @m900 {\r
+ flex-direction: column-reverse;\r
+ padding: 55px 0 0;\r
+ }\r
+ }\r
+\r
+ .pictures-container {\r
+ @media @m900 {\r
+ width: 100%;\r
+ height: 60vh;\r
+ position: relative;\r
+ overflow: hidden;\r
+ }\r
+ }\r
+\r
+ .picture {\r
+ background-color: #f2f6ff;\r
+ opacity: 0;\r
+\r
+ @media @m900 {\r
+ height: 100%;\r
+ padding-top: 0;\r
+ position: static;\r
+ }\r
+\r
+ img {\r
+ @media @m900 {\r
+ object-position: bottom center !important;\r
+ }\r
+ }\r
+ }\r
+\r
+ .content-inner {\r
+\r
+ @media @m900 {\r
+ height: auto;\r
+ text-align: left;\r
+ padding-top: 10px;\r
+ padding-bottom: 0 !important;\r
+ }\r
+\r
+ h1 {\r
+ @media @m900 {\r
+ text-align: left;\r
+ }\r
+ }\r
+\r
+ h1:after, h2:after {\r
+ @media @m900 {\r
+ left: 0;\r
+ margin-left: 0;\r
+ }\r
+ }\r
+ }\r
+\r
+ .scroll-arrow {\r
+ @media @m900 {\r
+ display: none !important;\r
+ }\r
+ }\r
}\r
\r
+\r
.content-wrapper {\r
&.fullheight {\r
position: relative;\r
background-size: 180%;\r
}\r
\r
- &[data-has-mobile="1"] .content-inner {\r
- @media @m900 {\r
- padding-bottom: 55%;\r
+ &[data-has-mobile="1"] {\r
+ background-color: #f2f6ff;\r
+\r
+ .picture {\r
+ @media @m900 {\r
+ height: 0;\r
+ padding-bottom: 54%;\r
+ }\r
+ }\r
+\r
+ .content-inner {\r
+ @media @m900 {\r
+ padding-bottom: 55%;\r
+ }\r
}\r
}\r
}\r