From e50e95225290dd4000ba6f8a6fb148689dfbe670 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 20 Jul 2016 15:04:25 +0000 Subject: [PATCH] wip #4 @2 --- framework/application/forms/CMS/Home.php | 1 - .../views/helpers/BackgroundBlock.php | 4 +++ framework/application/views/helpers/Home.php | 25 +++++++++++++++++++ .../views/helpers/HomeCustomers.php | 15 +++++++++++ .../views/helpers/HomeFeatures.php | 14 +++++++++++ .../application/views/helpers/HomeIntro.php | 14 +++++++++++ .../application/views/helpers/HomeLayer.php | 14 +++++++++++ .../views/helpers/HomeReferences.php | 14 +++++++++++ .../views/helpers/HomeServices.php | 14 +++++++++++ .../views/scripts/templates/home.phtml | 8 +----- js/002-common.js | 3 ++- js/210-home.js | 11 ++++++++ less/002-common.less | 4 +++ less/210-home.less | 6 ++--- 14 files changed, 135 insertions(+), 12 deletions(-) create mode 100644 framework/application/views/helpers/Home.php create mode 100644 framework/application/views/helpers/HomeCustomers.php create mode 100644 framework/application/views/helpers/HomeFeatures.php create mode 100644 framework/application/views/helpers/HomeIntro.php create mode 100644 framework/application/views/helpers/HomeLayer.php create mode 100644 framework/application/views/helpers/HomeReferences.php create mode 100644 framework/application/views/helpers/HomeServices.php diff --git a/framework/application/forms/CMS/Home.php b/framework/application/forms/CMS/Home.php index 53d939c..5d9b656 100644 --- a/framework/application/forms/CMS/Home.php +++ b/framework/application/forms/CMS/Home.php @@ -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) { diff --git a/framework/application/views/helpers/BackgroundBlock.php b/framework/application/views/helpers/BackgroundBlock.php index ea33aa4..db265f8 100644 --- a/framework/application/views/helpers/BackgroundBlock.php +++ b/framework/application/views/helpers/BackgroundBlock.php @@ -8,6 +8,10 @@ class Fluidbook_View_Helper_BackgroundBlock extends CubeIT_View_Helper_Abstract $style = ''; $attributes = array('class' => $class); + if (isset($data['backgroundimage']) && !isset($data['bg_image'])) { + $data['bg_image'] = $data['backgroundimage']; + } + $bgimage = CubeIT_Util_Cms::extractFile($data['bg_image']); $extra_attributes = array(); if ($bgimage) { diff --git a/framework/application/views/helpers/Home.php b/framework/application/views/helpers/Home.php new file mode 100644 index 0000000..31f894c --- /dev/null +++ b/framework/application/views/helpers/Home.php @@ -0,0 +1,25 @@ +$viewHelper($this->{$bloc}); + } + $res.=$this->contactFooter(); + + return $res; + } +} \ 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 index 0000000..b61b771 --- /dev/null +++ b/framework/application/views/helpers/HomeCustomers.php @@ -0,0 +1,15 @@ +data=$data; + + $res = ''; + + + return $this->_layer($res, 'customers'); + } +} \ 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 index 0000000..c97ac7c --- /dev/null +++ b/framework/application/views/helpers/HomeFeatures.php @@ -0,0 +1,14 @@ +data=$data; + + $res=''; + + return $this->_layer($res, 'features'); + } +} \ 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 index 0000000..af06e4e --- /dev/null +++ b/framework/application/views/helpers/HomeIntro.php @@ -0,0 +1,14 @@ +data=$data; + + $res=''; + + return $this->_layer($res, 'intro'); + } +} \ 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 index 0000000..7153807 --- /dev/null +++ b/framework/application/views/helpers/HomeLayer.php @@ -0,0 +1,14 @@ + $class); + $attributes = $this->_mergeAttributes($attributes, $defaultAttributes); + + $content = $this->backgroundBlock($content, $this->data, array('content-wrapper', 'no-shrink', 'fullheight')); + + return $this->htmlElement($content, 'section', $attributes); + } +} \ 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 index 0000000..52ffc0c --- /dev/null +++ b/framework/application/views/helpers/HomeReferences.php @@ -0,0 +1,14 @@ +data=$data; + + $res = ''; + + return $this->_layer($res, 'references'); + } +} \ 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 index 0000000..b7824a4 --- /dev/null +++ b/framework/application/views/helpers/HomeServices.php @@ -0,0 +1,14 @@ +data = $data; + + $res = ''; + + return $this->_layer($res, 'services'); + } +} \ No newline at end of file diff --git a/framework/application/views/scripts/templates/home.phtml b/framework/application/views/scripts/templates/home.phtml index d19ed4e..d8fed73 100644 --- a/framework/application/views/scripts/templates/home.phtml +++ b/framework/application/views/scripts/templates/home.phtml @@ -1,9 +1,3 @@ headScript()->addScriptAndStyle('210-home'); - -echo $this->picture( - array( - array('src' => '/images/test.png', 'width' => 840), - array('src' => '/images/test-portrait.png', 'media' => '(orientation: portrait)', 'width' => 550) - ) -); \ No newline at end of file +echo $this->home(); \ No newline at end of file diff --git a/js/002-common.js b/js/002-common.js index ee3e75a..59b9b73 100644 --- a/js/002-common.js +++ b/js/002-common.js @@ -18,11 +18,12 @@ function resize() { $('main').css('min-height', mainHeight); // Handle divs with background images that must have a proportional min-height - $('[data-bg-ratio]').each(function () { + $('[data-bg-ratio]:not(.fullheight)').each(function () { $(this).css('min-height', Math.round($(this).outerWidth() * $(this).data('bg-ratio'))); }); setZoom(ww); + $(window).trigger('fluidbookresize'); } function setZoom(ww) { diff --git a/js/210-home.js b/js/210-home.js index e69de29..b5daeaf 100644 --- a/js/210-home.js +++ b/js/210-home.js @@ -0,0 +1,11 @@ +registerLoader(load_home, true); +function load_home() { + $(window).on('fluidbookresize', resizeHome); + + resizeHome(); +} + +function resizeHome() { + var wh = $(window).outerHeight() / zoom; + $('main>section').css('height', wh); +} \ No newline at end of file diff --git a/less/002-common.less b/less/002-common.less index fee54f4..659861b 100644 --- a/less/002-common.less +++ b/less/002-common.less @@ -74,6 +74,10 @@ a { width: 100%; padding-top: 4%; padding-bottom: 5%; + &.fullheight { + min-height: 100%; + background-size: cover; + } } .no-shrink { diff --git a/less/210-home.less b/less/210-home.less index faee775..1eb1637 100644 --- a/less/210-home.less +++ b/less/210-home.less @@ -1,4 +1,4 @@ -main { - height: 3000px; - background-image: linear-gradient(to bottom, rgba(30, 87, 153, 1) 0%, rgba(125, 185, 232, 1) 100%);; +main>section{ + width: 100%; + overflow: hidden; } \ No newline at end of file -- 2.39.5