]> _ Git - fluidbook-v3.git/commitdiff
wip #4 @2
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 20 Jul 2016 15:04:25 +0000 (15:04 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 20 Jul 2016 15:04:25 +0000 (15:04 +0000)
14 files changed:
framework/application/forms/CMS/Home.php
framework/application/views/helpers/BackgroundBlock.php
framework/application/views/helpers/Home.php [new file with mode: 0644]
framework/application/views/helpers/HomeCustomers.php [new file with mode: 0644]
framework/application/views/helpers/HomeFeatures.php [new file with mode: 0644]
framework/application/views/helpers/HomeIntro.php [new file with mode: 0644]
framework/application/views/helpers/HomeLayer.php [new file with mode: 0644]
framework/application/views/helpers/HomeReferences.php [new file with mode: 0644]
framework/application/views/helpers/HomeServices.php [new file with mode: 0644]
framework/application/views/scripts/templates/home.phtml
js/002-common.js
js/210-home.js
less/002-common.less
less/210-home.less

index 53d939c541457022ce756d82089c1e056d63130d..5d9b6568b9c46a5b41f3e63cd2385d26bd5b32e0 100644 (file)
@@ -10,7 +10,6 @@ class Fluidbook_Form_CMS_Home extends Fluidbook_Form_CMS {
                        'customers' => array('class' => 'Fluidbook_Form_CMS_Sub_Home_Customers', 'label' => 'Clients'),
                        'services' => array('class' => 'Fluidbook_Form_CMS_Sub_Home_Services', 'label' => 'Services'),
                        'references' => array('class' => 'Fluidbook_Form_CMS_Sub_Home_References', 'label' => 'Référeces'),
-                       'contact' => array('class' => 'Fluidbook_Form_CMS_Sub_Home_Contact', 'label' => 'Contactez-nous'),
                );
 
                foreach ($blocs as $name => $data) {
index ea33aa4b1bfd101928b607f4cadca8117f3c558b..db265f86ff588454ed606a9740a3d63910163e78 100644 (file)
@@ -8,6 +8,10 @@ class Fluidbook_View_Helper_BackgroundBlock extends CubeIT_View_Helper_Abstract
                $style = '';\r
                $attributes = array('class' => $class);\r
 \r
+               if (isset($data['backgroundimage']) && !isset($data['bg_image'])) {\r
+                       $data['bg_image'] = $data['backgroundimage'];\r
+               }\r
+\r
                $bgimage = CubeIT_Util_Cms::extractFile($data['bg_image']);\r
                $extra_attributes = array();\r
                if ($bgimage) {\r
diff --git a/framework/application/views/helpers/Home.php b/framework/application/views/helpers/Home.php
new file mode 100644 (file)
index 0000000..31f894c
--- /dev/null
@@ -0,0 +1,25 @@
+<?php\r
+\r
+class Fluidbook_View_Helper_Home extends CubeIT_View_Helper_Abstract {\r
+       /**\r
+        * @return string\r
+        */\r
+       public function home() {\r
+               $res = '';\r
+               $blocs = array(\r
+                       'intro',\r
+                       'features',\r
+                       'customers',\r
+                       'services',\r
+                       'references'\r
+               );\r
+\r
+               foreach ($blocs as $bloc) {\r
+                       $viewHelper = 'home' . ucfirst($bloc);\r
+                       $res .= $this->$viewHelper($this->{$bloc});\r
+               }\r
+               $res.=$this->contactFooter();\r
+\r
+               return $res;\r
+       }\r
+}
\ No newline at end of file
diff --git a/framework/application/views/helpers/HomeCustomers.php b/framework/application/views/helpers/HomeCustomers.php
new file mode 100644 (file)
index 0000000..b61b771
--- /dev/null
@@ -0,0 +1,15 @@
+<?php\r
+\r
+class Fluidbook_View_Helper_HomeCustomers extends Fluidbook_View_Helper_HomeLayer {\r
+       /**\r
+        * @return string\r
+        */\r
+       public function homeCustomers($data) {\r
+               $this->data=$data;\r
+\r
+               $res = '';\r
+\r
+\r
+               return $this->_layer($res, 'customers');\r
+       }\r
+}
\ No newline at end of file
diff --git a/framework/application/views/helpers/HomeFeatures.php b/framework/application/views/helpers/HomeFeatures.php
new file mode 100644 (file)
index 0000000..c97ac7c
--- /dev/null
@@ -0,0 +1,14 @@
+<?php\r
+\r
+class Fluidbook_View_Helper_HomeFeatures extends Fluidbook_View_Helper_HomeLayer {\r
+       /**\r
+        * @return string\r
+        */\r
+       public function homeFeatures($data) {\r
+               $this->data=$data;\r
+\r
+               $res='';\r
+\r
+               return $this->_layer($res, 'features');\r
+       }\r
+}
\ No newline at end of file
diff --git a/framework/application/views/helpers/HomeIntro.php b/framework/application/views/helpers/HomeIntro.php
new file mode 100644 (file)
index 0000000..af06e4e
--- /dev/null
@@ -0,0 +1,14 @@
+<?php\r
+\r
+class Fluidbook_View_Helper_HomeIntro extends Fluidbook_View_Helper_HomeLayer {\r
+       /**\r
+        * @return string\r
+        */\r
+       public function homeIntro($data) {\r
+               $this->data=$data;\r
+\r
+               $res='';\r
+\r
+               return $this->_layer($res, 'intro');\r
+       }\r
+}
\ No newline at end of file
diff --git a/framework/application/views/helpers/HomeLayer.php b/framework/application/views/helpers/HomeLayer.php
new file mode 100644 (file)
index 0000000..7153807
--- /dev/null
@@ -0,0 +1,14 @@
+<?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()) {\r
+               $defaultAttributes = array('class' => $class);\r
+               $attributes = $this->_mergeAttributes($attributes, $defaultAttributes);\r
+\r
+               $content = $this->backgroundBlock($content, $this->data, array('content-wrapper', 'no-shrink', 'fullheight'));\r
+\r
+               return $this->htmlElement($content, 'section', $attributes);\r
+       }\r
+}
\ No newline at end of file
diff --git a/framework/application/views/helpers/HomeReferences.php b/framework/application/views/helpers/HomeReferences.php
new file mode 100644 (file)
index 0000000..52ffc0c
--- /dev/null
@@ -0,0 +1,14 @@
+<?php\r
+\r
+class Fluidbook_View_Helper_HomeReferences extends Fluidbook_View_Helper_HomeLayer {\r
+       /**\r
+        * @return string\r
+        */\r
+       public function homeReferences($data) {\r
+               $this->data=$data;\r
+\r
+               $res = '';\r
+\r
+               return $this->_layer($res, 'references');\r
+       }\r
+}
\ No newline at end of file
diff --git a/framework/application/views/helpers/HomeServices.php b/framework/application/views/helpers/HomeServices.php
new file mode 100644 (file)
index 0000000..b7824a4
--- /dev/null
@@ -0,0 +1,14 @@
+<?php\r
+\r
+class Fluidbook_View_Helper_HomeServices extends Fluidbook_View_Helper_HomeLayer {\r
+       /**\r
+        * @return string\r
+        */\r
+       public function homeServices($data) {\r
+               $this->data = $data;\r
+\r
+               $res = '';\r
+\r
+               return $this->_layer($res, 'services');\r
+       }\r
+}
\ No newline at end of file
index d19ed4effd32a7eb52089f0afcaa6702a42992a2..d8fed733254f73bd84b5c98364ac44cff86ff3bb 100644 (file)
@@ -1,9 +1,3 @@
 <?php\r
 $this->headScript()->addScriptAndStyle('210-home');\r
-\r
-echo $this->picture(\r
-       array(\r
-               array('src' => '/images/test.png', 'width' => 840),\r
-               array('src' => '/images/test-portrait.png', 'media' => '(orientation: portrait)', 'width' => 550)\r
-       )\r
-);
\ No newline at end of file
+echo $this->home();
\ No newline at end of file
index ee3e75ab6d8348905062531f0df3dfe7960e5848..59b9b73cc4b69093bfeaa6685d2807218b81ae57 100644 (file)
@@ -18,11 +18,12 @@ function resize() {
     $('main').css('min-height', mainHeight);\r
 \r
     // Handle divs with background images that must have a proportional min-height\r
-    $('[data-bg-ratio]').each(function () {\r
+    $('[data-bg-ratio]:not(.fullheight)').each(function () {\r
         $(this).css('min-height', Math.round($(this).outerWidth() * $(this).data('bg-ratio')));\r
     });\r
 \r
     setZoom(ww);\r
+    $(window).trigger('fluidbookresize');\r
 }\r
 \r
 function setZoom(ww) {\r
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b5daeaf073adfbad29b256ba93d1c40346085ec2 100644 (file)
@@ -0,0 +1,11 @@
+registerLoader(load_home, true);\r
+function load_home() {\r
+    $(window).on('fluidbookresize', resizeHome);\r
+\r
+    resizeHome();\r
+}\r
+\r
+function resizeHome() {\r
+    var wh = $(window).outerHeight() / zoom;\r
+    $('main>section').css('height', wh);\r
+}
\ No newline at end of file
index fee54f407aa046e7b4afd3781544383569f4fd52..659861b4933d3f81e6c980849ae40a656e25aed5 100644 (file)
@@ -74,6 +74,10 @@ a {
        width: 100%;\r
        padding-top: 4%;\r
        padding-bottom: 5%;\r
+       &.fullheight {\r
+               min-height: 100%;\r
+               background-size: cover;\r
+       }\r
 }\r
 \r
 .no-shrink {\r
index faee775ff2e5d2936b91b43fb910f45f580b9de3..1eb1637921ba44c4ee51aaaa60b134db7a4fc9dc 100644 (file)
@@ -1,4 +1,4 @@
-main {\r
-       height: 3000px;\r
-       background-image: linear-gradient(to bottom, rgba(30, 87, 153, 1) 0%, rgba(125, 185, 232, 1) 100%);;\r
+main>section{\r
+       width: 100%;\r
+       overflow: hidden;\r
 }
\ No newline at end of file