]> _ Git - fluidbook-v3.git/commitdiff
wait #3282 @0.75
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 19 Dec 2019 11:52:44 +0000 (11:52 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 19 Dec 2019 11:52:44 +0000 (11:52 +0000)
framework/application/views/helpers/BackgroundBlock.php
framework/application/views/helpers/HomeLayer.php
framework/application/views/helpers/IntroBlock.php
less/210-home.less

index 1bbd15e216f33d6f42bb8cf153f69d87e5deaec7..78e49a2e588c8b5f9921706ec5f3f2d52d7fe314 100644 (file)
@@ -1,62 +1,81 @@
 <?php\r
 \r
-class Fluidbook_View_Helper_BackgroundBlock extends CubeIT_View_Helper_Abstract {\r
-       /**\r
-        * @return string\r
-        */\r
-       public function backgroundBlock($content, $data, $class = array('content-wrapper', 'no-shrink')) {\r
-               $style = '';\r
-               $attributes = array('class' => $class);\r
+class Fluidbook_View_Helper_BackgroundBlock extends CubeIT_View_Helper_Abstract\r
+{\r
+    /**\r
+     * @return string\r
+     */\r
+    public function backgroundBlock($content, $data, $class = array('content-wrapper', 'no-shrink'))\r
+    {\r
+        $style = '';\r
+        $attributes = array('class' => $class);\r
 \r
-               if (isset($data['backgroundimage']) && !isset($data['bg_image'])) {\r
-                       $data['bg_image'] = $data['backgroundimage'];\r
-               }\r
-               if (isset($data['backgroundcolor']) && !isset($data['bg_color'])) {\r
-                       $data['bg_color'] = $data['backgroundcolor'];\r
-               }\r
-               if (isset($data['bg_image'])) {\r
-                       $bgimage = CubeIT_Util_Cms::extractFile($data['bg_image']);\r
-                       $extra_attributes = array();\r
-                       if ($bgimage) {\r
-                               $image_path = CubeIT_View_Helper_ImageCms::getPath($bgimage);\r
+        if (isset($data['backgroundimage']) && !isset($data['bg_image'])) {\r
+            $data['bg_image'] = $data['backgroundimage'];\r
+        }\r
+        if (isset($data['backgroundcolor']) && !isset($data['bg_color'])) {\r
+            $data['bg_color'] = $data['backgroundcolor'];\r
+        }\r
+        if (isset($data['bg_image'])) {\r
+            $bgimage = CubeIT_Util_Cms::extractFile($data['bg_image']);\r
+            $extra_attributes = array();\r
+            if ($bgimage) {\r
+                $image_path = CubeIT_View_Helper_ImageCms::getPath($bgimage);\r
 \r
-                               // Work out the ratio of the background image\r
-                               CubeIT_Image::getDimensions($image_path, $image_width, $image_height);\r
-                               $image_ratio = $image_height / $image_width;\r
-                               $attributes['data-bg-ratio'] = $image_ratio;\r
+                // Work out the ratio of the background image\r
+                CubeIT_Image::getDimensions($image_path, $image_width, $image_height);\r
+                $image_ratio = $image_height / $image_width;\r
+                $attributes['data-bg-ratio'] = $image_ratio;\r
 \r
-                               // Create a cropped version of the image for mobile that cuts off the left 45% of the image\r
+                // Create a cropped version of the image for mobile that cuts off the left 45% of the image\r
                 // Make sure image is not wider than 900px when finished\r
                 $mobile_max_width = 900;\r
                 // Scale image, factoring in crop that will take place...\r
                 // Image will be cropped to 900px wide so ensure that we have 45% extra and then determine the target height\r
                 $target_height = ($mobile_max_width / 0.55) * $image_ratio;\r
                 //$mobile = $this->imageProcess()->imageProcessGetURL($image_path, '', $image_width * 0.55, $image_height, array(), 'C', 'R', 'M');\r
-                $mobile = $this->imageProcess()->imageProcessGetURL($image_path, '', $mobile_max_width, $target_height, array(), 'C', 'R', 'M');\r
+                if (isset($data['backgroundmobileimage'])) {\r
+                    $bgmobileimage = CubeIT_Util_Cms::extractFile($data['backgroundmobileimage']);\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
+                        $mobile = $this->imageProcess()->imageProcessGetURL($mobile_path, '', $mobile_max_width, $target_height, array(), 'C', 'R', 'M');\r
+                    }else{\r
+                        $attributes['data-bg-ratio'] = $attributes['data-bg-ratio'];\r
+                        $mobile = $this->imageProcess()->imageProcessGetURL($image_path, '', $mobile_max_width, $target_height, array(), 'C', 'R', 'M');\r
+                    }\r
+                } else {\r
+                    $attributes['data-bg-ratio'] = $attributes['data-bg-ratio'];\r
+                    $mobile = $this->imageProcess()->imageProcessGetURL($image_path, '', $mobile_max_width, $target_height, array(), 'C', 'R', 'M');\r
+                }\r
 \r
-                               $bg = $this->htmlElement($this->picture([\r
-                                   [\r
-                                       'src' => $image_path,\r
-                        'width' => 1680\r
+                $bg = $this->htmlElement($this->picture([\r
+                    [\r
+                        'src' => $image_path,\r
+                        'width' => 1920\r
                     ],\r
                     [\r
                         'src' => $mobile,\r
-                        'width' => 900,\r
+                        'width' => $mobile_max_width,\r
                         'media' => '(max-width: 900px)'\r
                     ]\r
                 ],\r
-                [\r
-                    'alt' => $data['title']\r
-                ]), 'div', array('class' => 'picture'));\r
-                               $content = $bg . $content;\r
-                       }\r
-               }\r
+                    [\r
+                        'alt' => $data['title']\r
+                    ]), 'div', array('class' => 'picture'));\r
+                $content = $bg . $content;\r
+            }\r
+        }\r
 \r
-               if (isset($data['bg_color'])) {\r
-                       $style .= "background-color:" . $data['bg_color'] . ";";\r
-               }\r
-               $attributes['style'] = $style;\r
+        if (isset($data['bg_color'])) {\r
+            $style .= "background-color:" . $data['bg_color'] . ";";\r
+        }\r
+        $attributes['style'] = $style;\r
 \r
-               return $this->htmlElement($content, 'div', $attributes);\r
-       }\r
+        return $this->htmlElement($content, 'div', $attributes);\r
+    }\r
 }\r
index d46f636384cb3bfa90f39a446a237b43abd4292d..2add350f9fecb033e31bc08d0fdfd85e2f7a8d97 100644 (file)
@@ -1,31 +1,35 @@
 <?php\r
 \r
-class Fluidbook_View_Helper_HomeLayer extends CubeIT_View_Helper_Abstract {\r
-       public $data;\r
-\r
-       protected function _layer($content, $class, $attributes = array(), $outerContent = '') {\r
-\r
-               $section = $class;\r
-\r
-               $class .= ' section ' . $this->data['headerstyle'];\r
-\r
-               $defaultAttributes = array('class' => $class,\r
-                                          'data-headerstyle' => $this->data['headerstyle'],\r
-                                          'data-themecolor' => $this->data['themecolor'],\r
-                                          'data-section-name' => $section, 'data-puce' => $this->data['puce']);\r
-               $attributes = $this->_mergeAttributes($attributes, $defaultAttributes);\r
-\r
-               $content = $this->htmlElement($content, 'div', array('class' => 'content-inner'));\r
-               $content .= $outerContent;\r
-               $content = $this->backgroundBlock($content, $this->data, array('content-wrapper', 'no-shrink', 'fullheight'));\r
-\r
-               return $this->htmlElement($content, 'section', $attributes);\r
-       }\r
-\r
-       protected function _leftText($title_element = 'h2') {\r
-               $res = $this->title($this->data['title'], $title_element);\r
-               $res .= $this->markupDotclear($this->data['content']);\r
-               $res .= $this->linkCMS($this->data['button'], ['class' => 'btn', 'style' => 'background:' . $this->data['themecolor']]);\r
-               return $res;\r
-       }\r
+class Fluidbook_View_Helper_HomeLayer extends CubeIT_View_Helper_Abstract\r
+{\r
+    public $data;\r
+\r
+    protected function _layer($content, $class, $attributes = array(), $outerContent = '')\r
+    {\r
+\r
+        $section = $class;\r
+\r
+        $class .= ' section ' . $this->data['headerstyle'];\r
+\r
+        $defaultAttributes = array('class' => $class,\r
+            'data-headerstyle' => $this->data['headerstyle'],\r
+            'data-themecolor' => $this->data['themecolor'],\r
+            'data-has-mobile' => isset($this->data['backgroundmobileimage']),\r
+            'data-section-name' => $section, 'data-puce' => $this->data['puce']);\r
+        $attributes = $this->_mergeAttributes($attributes, $defaultAttributes);\r
+\r
+        $content = $this->htmlElement($content, 'div', array('class' => 'content-inner'));\r
+        $content .= $outerContent;\r
+        $content = $this->backgroundBlock($content, $this->data, array('content-wrapper', 'no-shrink', 'fullheight'));\r
+\r
+        return $this->htmlElement($content, 'section', $attributes);\r
+    }\r
+\r
+    protected function _leftText($title_element = 'h2')\r
+    {\r
+        $res = $this->title($this->data['title'], $title_element);\r
+        $res .= $this->markupDotclear($this->data['content']);\r
+        $res .= $this->linkCMS($this->data['button'], ['class' => 'btn', 'style' => 'background:' . $this->data['themecolor']]);\r
+        return $res;\r
+    }\r
 }\r
index 250f96816faccea05ce9053205feb65aa7bdd92f..440973e9307e00499e2ebf2b72a07f91ed0074ed 100644 (file)
@@ -1,84 +1,87 @@
 <?php
 
-class Fluidbook_View_Helper_IntroBlock extends CubeIT_View_Helper_Abstract {
-
-       public function introBlock($intro, $additionnalContent = '', $outsideContent = '', $paddingTop = true) {
-               $this->addScriptAndStyle('102-intro');
-
-
-               $res = '<div class="grid">';
-               $res .= '<div class="col-2">';
-               $res .= $this->title($intro['title']);
-               $res .= $this->_content($intro['content']);
-               if ($additionnalContent) {
-                       $res .= $additionnalContent;
-               }
-
-               $res .= '</div>'; // .col-2
-               $res .= '</div>'; // .grid
-
-               $attrs = array('class' => array('intro'));
-
-               if ($outsideContent) {
-                       $res .= $outsideContent;
-               }
-
-               if (isset($intro['backgroundimage']) && !isset($intro['bg_image'])) {
-                       $intro['bg_image'] = $intro['backgroundimage'];
-               }
-               if (!isset($intro['bg_image']) || !$intro['bg_image']) {
-                       $attrs['class'][] = 'nobg';
-               } else {
-                       $attrs['data-bg'] = print_r($intro['bg_image'], true);
-               }
-
-               $res = $this->backgroundBlock($res, $intro);
-               if ($intro['chapo']) {
-                       $res .= $this->htmlElement($this->htmlElement(nl2br($intro['chapo']), 'div'), 'blockquote');
-               }
-
-
-               if (!$paddingTop) {
-                       $attrs['class'][] = 'nopad';
-               }
-
-               if ($intro['header_theme']) {
-                       $attrs['data-header-theme'] = 'light';
-               }
-
-               $style = '';
-               if ($intro['text_color']) {
-                       $s = '@color:' . $intro['text_color'] . ' ;';
-                       $s .= '.intro{' . "\n";
-                       $s .= 'h1,h2,h3,h4,h5,h6,b,strong,i,em,p,a,address{color:@color !important;}' . "\n";
-                       $s .= 'h1.title,h2.title,hr{&:after{background-color:@color !important;}}' . "\n";
-                       $s .= '}';
-                       $style = $this->styleLess($s);
-               }
-
-               return $style . $this->htmlElement($res, 'section', $attrs);
-       }
-
-       protected function _content($c) {
-
-               $res = $this->markupDotclear($c);
-               if (stristr($res, '$adresse')) {
-                       $address = $this->option('address');
-                       $locale = new Zend_Locale();
-                       $country = strtoupper($locale->getTranslation($address['pays'], 'Territory'));
-                       $content = '<address>';
-                       $content .= '<h4>' . $address['company'] . '</h4>';
-                       $content .= $address['adresse'];
-                       $content .= '<br>';
-                       $content .= "{$address['code_postal']} {$address['ville']} - $country";
-                       $content .= '<br>';
-                       $content .= __('Tél :') . ' ' . $this->linkPhone($address['phone']);
-                       $content .= '<br>';
-                       $content .= __('email :') . ' ' . $this->linkEmail($address['email']);
-                       $content .= '</address>';
-
-                       $res = str_replace('$adresse', $content, $res);
-               }
-               return $res;
-       }
+class Fluidbook_View_Helper_IntroBlock extends CubeIT_View_Helper_Abstract
+{
+
+    public function introBlock($intro, $additionnalContent = '', $outsideContent = '', $paddingTop = true)
+    {
+        $this->addScriptAndStyle('102-intro');
+
+
+        $res = '<div class="grid">';
+        $res .= '<div class="col-2">';
+        $res .= $this->title($intro['title']);
+        $res .= $this->_content($intro['content']);
+        if ($additionnalContent) {
+            $res .= $additionnalContent;
+        }
+
+        $res .= '</div>'; // .col-2
+        $res .= '</div>'; // .grid
+
+        $attrs = array('class' => array('intro'));
+
+        if ($outsideContent) {
+            $res .= $outsideContent;
+        }
+
+        if (isset($intro['backgroundimage']) && !isset($intro['bg_image'])) {
+            $intro['bg_image'] = $intro['backgroundimage'];
+        }
+        if (!isset($intro['bg_image']) || !$intro['bg_image']) {
+            $attrs['class'][] = 'nobg';
+        } else {
+            $attrs['data-bg'] = print_r($intro['bg_image'], true);
+        }
+
+        $res = $this->backgroundBlock($res, $intro);
+        if ($intro['chapo']) {
+            $res .= $this->htmlElement($this->htmlElement(nl2br($intro['chapo']), 'div'), 'blockquote');
+        }
+
+
+        if (!$paddingTop) {
+            $attrs['class'][] = 'nopad';
+        }
+
+        if ($intro['header_theme']) {
+            $attrs['data-header-theme'] = 'light';
+        }
+
+        $style = '';
+        if ($intro['text_color']) {
+            $s = '@color:' . $intro['text_color'] . ' ;';
+            $s .= '.intro{' . "\n";
+            $s .= 'h1,h2,h3,h4,h5,h6,b,strong,i,em,p,a,address{color:@color !important;}' . "\n";
+            $s .= 'h1.title,h2.title,hr{&:after{background-color:@color !important;}}' . "\n";
+            $s .= '}';
+            $style = $this->styleLess($s);
+        }
+
+        return $style . $this->htmlElement($res, 'section', $attrs);
+    }
+
+    protected function _content($c)
+    {
+
+        $res = $this->markupDotclear($c);
+        if (stristr($res, '$adresse')) {
+            $address = $this->option('address');
+            $locale = new Zend_Locale();
+            $country = strtoupper($locale->getTranslation($address['pays'], 'Territory'));
+            $content = '<address>';
+            $content .= '<h4>' . $address['company'] . '</h4>';
+            $content .= $address['adresse'];
+            $content .= '<br>';
+            $content .= "{$address['code_postal']} {$address['ville']} - $country";
+            $content .= '<br>';
+            $content .= __('Tél :') . ' ' . $this->linkPhone($address['phone']);
+            $content .= '<br>';
+            $content .= __('email :') . ' ' . $this->linkEmail($address['email']);
+            $content .= '</address>';
+
+            $res = str_replace('$adresse', $content, $res);
+        }
+        return $res;
+    }
 }
\ No newline at end of file
index a710719414fa75d22e04f471dbe957bbbe399686..85c7928a6a421a8686c6e366967f6741cb0267e1 100644 (file)
 @import "000-imports";\r
 \r
 .home {\r
-       .content-wrapper.fullheight {\r
-               position: relative;\r
-               background-position: bottom right;\r
-\r
-               @media @m900 {\r
-                       background-size: 180%;\r
-               }\r
-       }\r
-\r
-       .content-inner {\r
-               position: absolute;\r
-               padding: 0 5%;\r
-               top: 50%;\r
-               left: 0;\r
-               width: 100%;\r
-               transform: translateY(-50%);\r
-\r
-               @media @m900 {\r
-                       position: relative;\r
-                       transform: none;\r
-                       padding-top: 5%;\r
-                       padding-bottom: 80%;\r
-                       text-align: center;\r
-               }\r
-       }\r
-\r
-       .btn {\r
-               .button();\r
-               .longarrow-button(16px, 40px, 18px);\r
-               color: #fff;\r
-               margin-top: 30px;\r
-       }\r
-\r
-       section {\r
-               overflow: hidden;\r
-\r
-               &.light {\r
-                       color: #fff;\r
-\r
-                       .title {\r
-                               color: #fff;\r
-\r
-                               &:after {\r
-                                       background-color: #fff;\r
-                               }\r
-                       }\r
-               }\r
-\r
-               .dotclear {\r
-                       max-width: 500px;\r
-\r
-                       @media @m900 {\r
-                               max-width: none;\r
-\r
-                               ul {\r
-                                       display: inline-block;\r
-                                       text-align: left;\r
-                               }\r
-                       }\r
-               }\r
-       }\r
+  .content-wrapper.fullheight {\r
+    position: relative;\r
+    background-position: bottom right;\r
+\r
+    @media @m900 {\r
+      background-size: 180%;\r
+    }\r
+\r
+    &[data-has-mobile="1"] .content-inner {\r
+      @media @m900 {\r
+        padding-bottom: 55%;\r
+      }\r
+    }\r
+  }\r
+\r
+  .content-inner {\r
+    position: absolute;\r
+    padding: 0 5%;\r
+    top: 50%;\r
+    left: 0;\r
+    width: 100%;\r
+    transform: translateY(-50%);\r
+\r
+    @media @m900 {\r
+      position: relative;\r
+      transform: none;\r
+      padding-top: 5%;\r
+      padding-bottom: 80%;\r
+      text-align: center;\r
+\r
+\r
+    }\r
+\r
+\r
+  }\r
+\r
+  .btn {\r
+    .button();\r
+    .longarrow-button(16px, 40px, 18px);\r
+    color: #fff;\r
+    margin-top: 30px;\r
+  }\r
+\r
+  section {\r
+    overflow: hidden;\r
+\r
+    &.light {\r
+      color: #fff;\r
+\r
+      .title {\r
+        color: #fff;\r
+\r
+        &:after {\r
+          background-color: #fff;\r
+        }\r
+      }\r
+    }\r
+\r
+    .dotclear {\r
+      max-width: 500px;\r
+\r
+      @media @m900 {\r
+        max-width: none;\r
+\r
+        ul {\r
+          display: inline-block;\r
+          text-align: left;\r
+        }\r
+      }\r
+    }\r
+  }\r
 }\r
 \r
 .pagination {\r
-       position: fixed;\r
-       top: 50%;\r
-       left: 15px;\r
-       transform: translateY(-50%);\r
-       font-size: 30px;\r
-       line-height: 1;\r
-       transition: opacity 0.3s;\r
-       cursor: pointer;\r
-       z-index: 10;\r
-       display: none; // Displayed only when in pagination mode\r
-       list-style: none;\r
-\r
-       .fullpages & {\r
-               display: block;\r
-       }\r
-\r
-       li {\r
-               //margin: 10px 0;\r
-               height: 22px;\r
-               position: relative;\r
-               padding: 0 10px 0 25px;\r
-               &:before {\r
-                       content: "";\r
-                       background-color: #e1e2e3;\r
-                       display: block;\r
-                       width: 10px;\r
-                       height: 10px;\r
-                       border-radius: 5px;\r
-                       position: absolute;\r
-                       left: 6px;\r
-                       top: 6px;\r
-               }\r
-               &:hover {\r
-                       &:before {\r
-                               background-color: #fff !important;\r
-                       }\r
-                       border-radius: 10px;\r
-                       span {\r
-                               position: relative;\r
-                               display: inline-block;\r
-                               color: #fff;\r
-                               top: -10px;\r
-                       }\r
-               }\r
-               span {\r
-                       font-size: 14px;\r
-                       line-height: 22px;\r
-               }\r
-       }\r
-\r
-       span {\r
-               display: none;\r
-       }\r
+  position: fixed;\r
+  top: 50%;\r
+  left: 15px;\r
+  transform: translateY(-50%);\r
+  font-size: 30px;\r
+  line-height: 1;\r
+  transition: opacity 0.3s;\r
+  cursor: pointer;\r
+  z-index: 10;\r
+  display: none; // Displayed only when in pagination mode\r
+  list-style: none;\r
+\r
+  .fullpages & {\r
+    display: block;\r
+  }\r
+\r
+  li {\r
+    //margin: 10px 0;\r
+    height: 22px;\r
+    position: relative;\r
+    padding: 0 10px 0 25px;\r
+\r
+    &:before {\r
+      content: "";\r
+      background-color: #e1e2e3;\r
+      display: block;\r
+      width: 10px;\r
+      height: 10px;\r
+      border-radius: 5px;\r
+      position: absolute;\r
+      left: 6px;\r
+      top: 6px;\r
+    }\r
+\r
+    &:hover {\r
+      &:before {\r
+        background-color: #fff !important;\r
+      }\r
+\r
+      border-radius: 10px;\r
+\r
+      span {\r
+        position: relative;\r
+        display: inline-block;\r
+        color: #fff;\r
+        top: -10px;\r
+      }\r
+    }\r
+\r
+    span {\r
+      font-size: 14px;\r
+      line-height: 22px;\r
+    }\r
+  }\r
+\r
+  span {\r
+    display: none;\r
+  }\r
 }
\ No newline at end of file