Implement facade for video embeds
This commit is contained in:
@@ -7,6 +7,10 @@ require('picturefill')
|
||||
import smoothscroll from 'smoothscroll-polyfill'
|
||||
smoothscroll.polyfill()
|
||||
|
||||
// Video lazy loading
|
||||
import lazyframe from 'lazyframe'
|
||||
lazyframe('.lazyframe')
|
||||
|
||||
// Add pacode to external links
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const configElement = document.getElementById('appconfig')
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
@import "components/teaser";
|
||||
@import "components/tiles";
|
||||
@import "components/tooltips";
|
||||
@import "~lazyframe/src/scss/lazyframe";
|
||||
}
|
||||
|
||||
@layer utilities {
|
||||
|
||||
+6
-5
@@ -1,14 +1,15 @@
|
||||
<html data-namespace-typo3-fluid="true" lang="en"
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:ep="http://typo3.org/ns/EP/EpTheme/ViewHelpers">
|
||||
xmlns:ep="http://typo3.org/ns/EP/EpTheme/ViewHelpers"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">
|
||||
|
||||
<f:layout name="Default"/>
|
||||
|
||||
<f:section name="Main">
|
||||
<div class="relative w-full aspect-w-16 aspect-h-9">
|
||||
<iframe class="absolute top-0 left-0 w-full h-full" width="560" height="315" allowfullscreen
|
||||
src="{ep:uri.video(value: data.header_link, layout: data.layout)}"></iframe>
|
||||
<div class="lazyframe"
|
||||
data-vendor="{f:if(condition: '{data.layout} == 0', then: 'youtube_nocookie', else: 'vimeo')}"
|
||||
data-ratio="16:9"
|
||||
data-src="{ep:uri.video(value: data.header_link, layout: data.layout)}">
|
||||
</div>
|
||||
</f:section>
|
||||
|
||||
|
||||
@@ -200,9 +200,10 @@
|
||||
<f:render section="Calendar" arguments="{_all}"/>
|
||||
<f:render partial="Facts" arguments="{facts: product.facts}"/>
|
||||
<f:if condition="{product.video}">
|
||||
<div class="relative aspect-w-16 aspect-h-9 mb-4">
|
||||
<iframe class="absolute top-0 left-0 w-full h-full" width="560" height="315" allowfullscreen
|
||||
src="{ep:uri.video(value: product.video)}"></iframe>
|
||||
<div class="lazyframe mb-4"
|
||||
data-vendor="vimeo"
|
||||
data-ratio="16:9"
|
||||
data-src="{ep:uri.video(value: product.video)}">
|
||||
</div>
|
||||
</f:if>
|
||||
<div class="bg-gray-50 p-4 mb-4">
|
||||
|
||||
Reference in New Issue
Block a user