]> _ Git - fluidbook-v3.git/commitdiff
Content and styling. WIP #488 @6.25
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 6 Jul 2016 16:18:41 +0000 (16:18 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 6 Jul 2016 16:18:41 +0000 (16:18 +0000)
framework/application/views/helpers/FeaturesSection.php
framework/application/views/scripts/templates/fonctionnalites.phtml
js/410-features.js [new file with mode: 0644]
less/410-features.less [new file with mode: 0644]

index 8666576d9ba76cf59bb0e30d98f0c67f29263261..01e8bbdc61120909875783782a37bcb0926b7959 100644 (file)
@@ -4,6 +4,8 @@ class Fluidbook_View_Helper_FeaturesSection extends CubeIT_View_Helper_Abstract
 
     public function featuresSection($title, $blocks) {
 
+        $this->headScript()->addMasonry()->addJQueryTransform();
+
         $res  = '<div class="content-wrapper grid wrap">';
         $res .= '<h1 class="title col-6">' . nl2br($title) . '</h1>';
         $res .= '<div class="feature-blocks">';
@@ -11,11 +13,22 @@ class Fluidbook_View_Helper_FeaturesSection extends CubeIT_View_Helper_Abstract
         foreach ($blocks as $block) {
 
             $gradient = $this->_gradient($block['background_gradient']);
+            $background_colour = empty($block['background_gradient']['color1']) ? '' : 'background-color: '. $block['background_gradient']['color1'] .';';
             $text_colour = $gradient ? 'light' : 'dark';
 
-            $res .= '<div class="feature-block text-'. $text_colour .'" style="'. $gradient .'">';
-            $res .= '<h4>'. $block['title'] .'</h4>';
+            $res .= '<div class="feature-block text-'. $text_colour .' '. $block['layout'] .'" style="'. $background_colour . $gradient .'">';
+            $res .= '<div class="feature-inner">';
+
+            if (is_array($block['icon'])) {
+                $res .= $this->imageCms($block['icon'], '', null, null, ['class' => 'feature-icon']);
+            }
+
+            $res .= '<div class="feature-text">';
+            $res .= '<h4 class="feature-title">'. $block['title'] .'</h4>';
             $res .= $this->markupDotclear($block['content']);
+            $res .= '</div>'; // .feature-text
+            
+            $res .= '</div>'; // .feature-inner
             $res .= '</div>'; // .feature-block
         }
 
@@ -35,10 +48,9 @@ class Fluidbook_View_Helper_FeaturesSection extends CubeIT_View_Helper_Abstract
         $c1 = $gradient['color1'];
         $c2 = $gradient['color2'];
 
-        return "background: $c1;
-background: -moz-linear-gradient($angle, $c1 0%, $c2 100%);
-background: -webkit-linear-gradient($angle, $c1 0%, $c2 100%);
-background: linear-gradient($angle, $c1 0%, $c2 100%);
+        return "background-image: -moz-linear-gradient($angle, $c1 0%, $c2 100%);
+background-image: -webkit-linear-gradient($angle, $c1 0%, $c2 100%);
+background-image: linear-gradient($angle, $c1 0%, $c2 100%);
 filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='$c1', endColorstr='$c2',GradientType=1);";
     }
 
index 13f1e665222430089cece761aa6e6c8f143f7d1e..30eb05bd346f67659429b4990518b7af24178ff1 100644 (file)
@@ -1,5 +1,7 @@
 <?php\r
 \r
+$this->headScript()->addScriptAndStyle('410-features');\r
+\r
 $res  = $this->introBlock($this->intro, '');\r
 \r
 $res .= $this->featuresSection($this->features_title, $this->features);\r
diff --git a/js/410-features.js b/js/410-features.js
new file mode 100644 (file)
index 0000000..b7cd13b
--- /dev/null
@@ -0,0 +1,12 @@
+registerLoader(load_features);
+
+function load_features() {
+
+    $(".feature-blocks").masonry({
+        itemSelector: ".feature-block",
+        //fitWidth: true,
+        columnWidth: ".small-rectangle-tall",
+        transitionDuration: 0,
+    });
+
+}
\ No newline at end of file
diff --git a/less/410-features.less b/less/410-features.less
new file mode 100644 (file)
index 0000000..ba6def8
--- /dev/null
@@ -0,0 +1,71 @@
+@import "000-imports";
+
+.feature-blocks {
+  width: 100%;
+}
+
+.feature-block {
+  position: relative;
+  overflow: hidden;
+
+  // Block layouts
+  &.rectangle-right, &.rectangle-bottom {
+    width: percentage(3/6);
+    padding-bottom: percentage(2/6); // 3:2 aspect ratio
+  }
+  &.square-top, &.square-bottom {
+    width: percentage(2/6);
+    padding-bottom: percentage(2/6); // 1:1 aspect ratio
+  }
+
+  &.small-rectangle-tall {
+    width: percentage(1/6);
+    padding-bottom: percentage(2/6); // 1:2 aspect ratio
+  }
+  &.small-rectangle-wide {
+    width: percentage(2/6);
+    padding-bottom: percentage(1/6); // 2:1 aspect ratio
+  }
+}
+
+.feature-inner {
+  position: absolute;
+  top: 0;
+  left: 0;
+  padding: 30px;
+  line-height: (22/14);
+}
+
+.feature-icon {
+  margin-bottom: 30px;
+  margin-right: 30px;
+
+  .small-rectangle-wide & {
+    float: left;
+  }
+}
+
+.feature-text {
+  .rectangle-right & {
+    width: 30%;
+  }
+
+  .square-top & {
+    margin-top: 50%;
+
+  }
+}
+
+.feature-title {
+  font-family: @montserrat;
+  font-size: 15px;
+  font-weight: 600;
+  line-height: 1;
+  margin-bottom: 15px;
+  text-transform: uppercase;
+}
+
+.text-light {
+  .font-thinning();
+  color: #fff;
+}
\ No newline at end of file