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">';
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
}
$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);";
}
--- /dev/null
+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
--- /dev/null
+@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