From f4668e27dffa99eca136eeacb55b9d49d9121a85 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 21 Sep 2016 09:26:04 +0000 Subject: [PATCH] done #738 @1.5 --- .../views/helpers/SimeoxDocuments.php | 17 ++++-- .../views/helpers/SimeoxVideos.php | 7 ++- js/common.js | 41 +++++++++------ less/common.less | 10 +++- less/simeox.less | 52 +++++++++++++------ 5 files changed, 85 insertions(+), 42 deletions(-) diff --git a/framework/application/views/helpers/SimeoxDocuments.php b/framework/application/views/helpers/SimeoxDocuments.php index 7f7d884..050b9dc 100644 --- a/framework/application/views/helpers/SimeoxDocuments.php +++ b/framework/application/views/helpers/SimeoxDocuments.php @@ -4,9 +4,18 @@ class Simeox_View_Helper_SimeoxDocuments extends CubeIT_View_Helper_Abstract { /** * @return string */ - public function simeoxDocuments() { - $res=''; - - return $res; + public function simeoxDocuments($documents) { + $res = array(); + foreach ($documents as $doc) { + $res[] = $this->_document($doc); + } + return $this->listUnordered($res, array('class' => 'documents')); + } + + protected function _document($doc) { + $res = $this->imageProcess($doc['thumbnail'], '', 101, 100000, array(), 'R', 'C', 'M'); + $res .= $this->htmlElement($doc['title'], 'h4'); + + return $this->linkTruePopupFullscreen($res, $doc['url']); } } \ No newline at end of file diff --git a/framework/application/views/helpers/SimeoxVideos.php b/framework/application/views/helpers/SimeoxVideos.php index 54a5f30..c3190ee 100644 --- a/framework/application/views/helpers/SimeoxVideos.php +++ b/framework/application/views/helpers/SimeoxVideos.php @@ -5,11 +5,10 @@ class Simeox_View_Helper_SimeoxVideos extends CubeIT_View_Helper_Abstract { * @return string */ public function simeoxVideos($videos) { + $this->headScript()->addFeatherlight(); $res = array(); foreach ($videos as $video) { - for ($i = 0; $i < 6; $i++) { - $res[] = $this->_video($video); - } + $res[] = $this->_video($video); } return $this->listUnordered($res, array('class' => 'videos')); } @@ -18,6 +17,6 @@ class Simeox_View_Helper_SimeoxVideos extends CubeIT_View_Helper_Abstract { $res = $this->imageProcess($v['thumbnail'], '', 165, 96, array(), 'C', 'C', 'M'); $res .= $this->htmlElement($v['title'], 'h4'); - return $this->link($res, CubeIT_Util_WebVideo::getIframeUrl($v['url']), array('data-video' => $v['url'])); + return $this->link($res, CubeIT_Util_WebVideo::getIframeUrl($v['url'], null, array('autoplay' => 1, 'modestbranding' => 1, 'rel' => 0, 'cc_load_policy' => 0,''))); } } \ No newline at end of file diff --git a/js/common.js b/js/common.js index 64e12bd..21588b8 100644 --- a/js/common.js +++ b/js/common.js @@ -9,25 +9,34 @@ function load_common_once() { //$('a').click(function() { // if(!localScrollInitialised) { // Only initalise localscroll after first click - $('header.site').localScroll({ - axis: 'y', - duration: 1000, - //hash: true, - offset: -65 // For fixed header height - }); + $('header.site').localScroll({ + axis: 'y', + duration: 1000, + //hash: true, + offset: -65 // For fixed header height + }); // // localScrollInitialised = true; // } //}); // Shrinking fixed header - $(window).scroll(function() { + $(window).scroll(function () { shrinkHeader(); }); shrinkHeader(); // Trigger even when no scroll (eg. page refresh) $('.partners .logos').imagefit(); // Make sure logos fit onto one line + + + $(document).on('click', '.videos a', function () { + var iw = $(window).width() * 0.8; + var ih = Math.round(iw / 16 * 9); + iw = Math.round(iw); + $.featherlight($('')); + return false; + }); } function shrinkHeader() { @@ -40,7 +49,7 @@ function shrinkHeader() { function cookieBanner() { - if($('#cookieBanner').length) { + if ($('#cookieBanner').length) { var cookieBannerHeight = $('#cookieBanner').outerHeight(); @@ -79,11 +88,11 @@ function cookieBanner() { * Original code inspired by: http://www.ollicle.com/eg/jquery/imagefit/ * */ -(function($) { - $.fn.imagefit = function(options) { +(function ($) { + $.fn.imagefit = function (options) { var fit = { - scale: function(scaleFactor, imgs) { - imgs.each(function(){ + scale: function (scaleFactor, imgs) { + imgs.each(function () { var newWidth = Math.round(scaleFactor * $(this).width()); var newHeight = Math.round(scaleFactor * $(this).height()); $(this).width(newWidth); @@ -92,7 +101,7 @@ function cookieBanner() { } }; - this.each(function(){ + this.each(function () { var container = this; // Get list of contained images @@ -104,7 +113,7 @@ function cookieBanner() { var totalWidth = 0; // Calculate total width of all contained images - imgs.each(function(){ + imgs.each(function () { totalWidth += $(this).width(); }); @@ -112,7 +121,7 @@ function cookieBanner() { var gutterTotal = numGutters * minGutter; // Make gutters small enough to fit but bigger than natural gap between inline-blocks (normally 4px) - if(gutterTotal > availableWidth) { + if (gutterTotal > availableWidth) { gutterTotal = numGutters * 5; } //fb('Gutter total = ' + gutterTotal); @@ -120,7 +129,7 @@ function cookieBanner() { availableWidth -= gutterTotal; // Take fixed gutters away from available space //fb('Total img width = ' + totalWidth); - if(totalWidth > availableWidth) { + if (totalWidth > availableWidth) { var scale = availableWidth / totalWidth; //fb('Scale factor: ' + Math.round(scale * 100) + '%'); diff --git a/less/common.less b/less/common.less index 4ee1b31..e276417 100644 --- a/less/common.less +++ b/less/common.less @@ -11,12 +11,20 @@ html { } body { + opacity: 0; + transition: opacity 250ms; font-family: 'Open Sans', sans-serif; font-weight: 300; font-size: 16px; min-width: 960px; // stops centred background images from moving beyond where they should } +.wf-active { + body { + opacity: 1; + } +} + a { text-decoration: none; color: #1d81c2; @@ -178,7 +186,7 @@ footer { font-size: 12px !important; } -.cubeit-content{ +.cubeit-content { max-width: 960px; } diff --git a/less/simeox.less b/less/simeox.less index c69ee57..040461d 100644 --- a/less/simeox.less +++ b/less/simeox.less @@ -127,18 +127,44 @@ } .content { + + ul { + &.videos, &.documents { + list-style: none; + li { + padding-left: 0; + line-height: 1; + background-image: none; + display: inline-block; + position: relative; + margin-right: 19px; + + h4 { + color: #3c3c3b; + font-size: 16px; + font-weight: 300; + line-height: 24px; + margin-top: 15px; + height: 48px; + overflow: hidden; + } + } + } + } + + ul.documents{ + width: 960px; + li{ + width: 101px; + } + } + ul.videos { - list-style: none; width: 552px; li { - padding-left: 0; margin-bottom: 26px; - line-height: 1; - background-image: none; - display: inline-block; width: 165px; - margin-right: 19px; - position: relative; + &:before { content: "a"; @@ -156,8 +182,8 @@ pointer-events: none; } - &:hover{ - &:before{ + &:hover { + &:before { color: #525251; } } @@ -177,14 +203,6 @@ cursor: pointer; pointer-events: none; } - - h4 { - color: #3c3c3b; - font-size: 16px; - font-weight: 300; - line-height: 24px; - margin-top: 15px; - } } } } \ No newline at end of file -- 2.39.5