return $this->view->quoteForm('requestQuotePopup'); // Different ID for popup form so it doesn't conflict with contact page form
}
- public function video($ID) {
- $this->setPopupMaxWidth('1440');
- $this->setPopupWidth('90%');
- return $this->view->videoWeb($ID, '100%', 'auto', ['autoplay' => 1]);
- }
-
}
\ No newline at end of file
<?php\r
\r
+$this->headScript()->addFeatherlight();\r
$this->headScript()->addScriptAndStyle('410-features');\r
\r
-$videoLink = '/ajaxpopup/video/'. $this->video;\r
-\r
-$extraContent = $this->linkPopup($this->video_button_text, $videoLink, ['class' => 'features-video-button']);\r
-$extraContent .= $this->linkPopup('', $videoLink, ['class' => 'features-video', 'width' => '1200']);\r
+// Todo: replace with link to demo fluidbook and add fields to CMS\r
+//$extraContent = $this->linkPopup($this->video_button_text, $videoLink, ['class' => 'features-video-button']);\r
+$extraContent = $this->link('', '#', ['class' => 'features-video', 'data-featherlight' => '#introVideo', 'data-featherlight-after-open' => 'playVideo()']);\r
+$extraContent .= '<div class="lightbox" id="introVideo">';\r
+$extraContent .= $this->videoWeb($this->video);\r
+$extraContent .= '</div>'; // .lightbox\r
\r
$res = $this->introBlock($this->intro, $extraContent);\r
\r
containerWidth = Math.floor($('main').width() * 0.9 / cols) * cols;
$('.feature-blocks').width(containerWidth);
+}
+
+// Switch the video URL to autoplay so the video starts playing...
+// This function is called when the featherlight opens
+function playVideo() {
+ var video = $('.featherlight #introVideo iframe');
+
+ video[0].src = video[0].src.replace('autoplay=0','autoplay=1');
}
\ No newline at end of file
margin-top: 50px;
}
+// Featherlight modifications to make responsive iframes work
+.featherlight-iframe {
+ &:before {
+ display: none; // This element doesn't seem necessary and really messes up the display
+ }
+
+ .featherlight-content {
+ display: block; // Normally it is set to inline-block but then the iframe can't be scaled by percentage
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 50%;
+ transform: translateY(-50%);
+ overflow: visible; // So close icon can sit outside the box
+ padding: 0 !important;
+ margin: 0 5% !important;
+ border: none !important;
+ }
+
+ .featherlight-close-icon {
+ background-color: transparent;
+ color: #fff;
+ font-size: 20px;
+ top: -27px;
+ right: -4px;
+ }
+}
+
+// Lightbox for the video with intrinsic ratio
+.lightbox {
+ display: none;
+ position: relative;
+ padding-bottom: percentage(9/16); // 16:9 aspect ratio
+
+ iframe {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ }
+}
+
.features-video {
display: block;
position: absolute;