@total_onion/onion-library 2.0.192 → 2.0.194
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/block-carousel-multi-layout-v3/carousel-multi-layout-v3.js +12 -3
- package/components/block-scrolling-banner-v3/scrolling-banner-v3.js +3 -0
- package/components/block-video-content-v3/video-content-v3.twig +91 -1
- package/components/component-video-component-v3/video-component-v3.twig +0 -1
- package/package.json +1 -1
|
@@ -63,9 +63,12 @@ export default function carouselmultilayoutv3Js(options = {}) {
|
|
|
63
63
|
Number(dataAttributes.centeractiveslideportrait) === 1;
|
|
64
64
|
const centerActiveSlideMobile =
|
|
65
65
|
Number(dataAttributes.centeractiveslidemobile) === 1;
|
|
66
|
-
const centerSlidesBounds =
|
|
67
|
-
|
|
68
|
-
const
|
|
66
|
+
const centerSlidesBounds =
|
|
67
|
+
Number(dataAttributes.centerslidesbounds) === 1;
|
|
68
|
+
const centerSlidesBoundsPortrait =
|
|
69
|
+
Number(dataAttributes.centerslidesboundsportrait) === 1;
|
|
70
|
+
const centerSlidesBoundsMobile =
|
|
71
|
+
Number(dataAttributes.centerslidesboundsmobile) === 1;
|
|
69
72
|
const centerInsufficientSlidesDesktop =
|
|
70
73
|
Number(dataAttributes.centerinsufficientslidesdesktop) === 1;
|
|
71
74
|
const centerInsufficientSlidesPortrait =
|
|
@@ -197,8 +200,14 @@ export default function carouselmultilayoutv3Js(options = {}) {
|
|
|
197
200
|
loop: totalSlides > 1 ? loopSlides : false
|
|
198
201
|
},
|
|
199
202
|
1440: {
|
|
203
|
+
centeredSlides: centerActiveSlide,
|
|
204
|
+
centerInsufficientSlides:
|
|
205
|
+
centerInsufficientSlidesDesktop,
|
|
206
|
+
centeredSlidesBounds: centerSlidesBounds,
|
|
200
207
|
slidesPerView: slidesDesktopFull,
|
|
201
208
|
spaceBetween: spaceBetweenSlidesDesktopFull,
|
|
209
|
+
slidesOffsetBefore: slidesOffsetDesktopBefore,
|
|
210
|
+
slidesOffsetAfter: slidesOffsetDesktopAfter,
|
|
202
211
|
loop: totalSlides > 1 ? loopSlides : false
|
|
203
212
|
}
|
|
204
213
|
},
|
|
@@ -62,6 +62,9 @@ function bannerInit(bannerElement, initializedBanners, block) {
|
|
|
62
62
|
|
|
63
63
|
const wrapperWidth = wrapper.clientWidth;
|
|
64
64
|
const innerContentWidth = inner.clientWidth;
|
|
65
|
+
if (innerContentWidth == 0) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
65
68
|
const multiplier = Number(Math.round(wrapperWidth / innerContentWidth));
|
|
66
69
|
|
|
67
70
|
for (let index = 0; index < multiplier; index++) {
|
|
@@ -13,5 +13,95 @@
|
|
|
13
13
|
}
|
|
14
14
|
</style>
|
|
15
15
|
<section {{block.anchor ? "id=" ~ block.anchor : ''}} class="{{blockClassName}} {{block.className}} {{classNameEntryPoint}} lazy-fade {{block.id}}" {{dataAttributeEntryPoint}} data-blockid="{{block.id}}" data-assetkey="{{blockClassName}}">
|
|
16
|
-
{
|
|
16
|
+
{% set videoEnabled = fields.enable_video %}
|
|
17
|
+
{% set renderDynamic = fields.child_pattern_settings.render_dynamic|default(0) %}
|
|
18
|
+
{% set videoPlayingZindexClass = fields.video_playing_high_z_index ? 'video-playing--high-z-index' : '' %}
|
|
19
|
+
{% if videoEnabled %}
|
|
20
|
+
{% set videoType = fields.video_type|ru %}
|
|
21
|
+
{% set youtubeEmbed = fields.youtube_embed|default(false) %}
|
|
22
|
+
{% if 'data-src="' in youtubeEmbed %}
|
|
23
|
+
{% set youtubeDesktopParts = youtubeEmbed|split('data-src="') %}
|
|
24
|
+
{% elseif 'src="' in youtubeEmbed %}
|
|
25
|
+
{% set youtubeDesktopParts = youtubeEmbed|split('src="') %}
|
|
26
|
+
{% endif %}
|
|
27
|
+
{% set youtubeDesktopUrl = youtubeDesktopParts[1]|split('"')[0] %}
|
|
28
|
+
{% set youtubeDesktopId = youtubeDesktopUrl|split('/embed/')|last|split('?')|first %}
|
|
29
|
+
{% set youtubeMobile = fields.youtube_mobile %}
|
|
30
|
+
{% if 'data-src="' in youtubeMobile %}
|
|
31
|
+
{% set youtubeMobileParts = youtubeMobile|split('data-src="') %}
|
|
32
|
+
{% elseif 'src="' in youtubeMobile %}
|
|
33
|
+
{% set youtubeMobileParts = youtubeMobile|split('src="') %}
|
|
34
|
+
{% endif %}
|
|
35
|
+
{% set youtubeMobileUrl = youtubeMobileParts[1]|split('"')[0] %}
|
|
36
|
+
{% set youtubeMobileId = youtubeMobileUrl|split('/embed/')|last|split('?')|first|default(youtubeDesktopId) %}
|
|
37
|
+
{% set vimeoEmbed = fields.vimeo_embed|default(false) %}
|
|
38
|
+
{% if 'data-src="' in vimeoEmbed %}
|
|
39
|
+
{% set vimeoDesktopParts = vimeoEmbed|split('data-src="') %}
|
|
40
|
+
{% elseif 'src="' in vimeoEmbed %}
|
|
41
|
+
{% set vimeoDesktopParts = vimeoEmbed|split('src="') %}
|
|
42
|
+
{% endif %}
|
|
43
|
+
{% set vimeoDesktopUrl = vimeoDesktopParts[1]|split('"')[0] %}
|
|
44
|
+
{% set vimeoDesktopId = vimeoDesktopUrl|split('/video/')|last|split('?')|first %}
|
|
45
|
+
{% set vimeoMobile = fields.vimeo_mobile %}
|
|
46
|
+
{% if 'data-src="' in vimeoMobile %}
|
|
47
|
+
{% set vimeoMobileParts = vimeoMobile|split('data-src="') %}
|
|
48
|
+
{% elseif 'src="' in vimeoMobile %}
|
|
49
|
+
{% set vimeoMobileParts = vimeoMobile|split('src="') %}
|
|
50
|
+
{% endif %}
|
|
51
|
+
{% set vimeoMobileUrl = vimeoMobileParts[1]|split('"')[0] %}
|
|
52
|
+
{% set vimeoMobileId = vimeoMobileUrl|split('/video/')|last|split('?')|first|default(vimeoDesktopId) %}
|
|
53
|
+
{% set videoDesktop = fields.video_desktop|default(false) %}
|
|
54
|
+
{% set videoMobile = fields.video_mobile|default(false) %}
|
|
55
|
+
{% set autoplayVideo = fields.autoplay %}
|
|
56
|
+
{% set autoplayVideoMobile = fields.mobile_autoplay %}
|
|
57
|
+
{% if autoplayVideo == false %}
|
|
58
|
+
{% set autoplayVideo = 0 %}
|
|
59
|
+
{% set autoplayVideoMobile = 0 %}
|
|
60
|
+
{% endif %}
|
|
61
|
+
{% if autoplayVideoMobile == false and autoplayVideoMobile is not null %}
|
|
62
|
+
{% set autoplayVideoMobile = 0 %}
|
|
63
|
+
{% endif %}
|
|
64
|
+
{% if autoplayVideo == true and autoplayVideoMobile is null %}
|
|
65
|
+
{% set autoplayVideoMobile = 1 %}
|
|
66
|
+
{% endif %}
|
|
67
|
+
{% set fullscreen = fields.fullscreen %}
|
|
68
|
+
{% set loopVideo = fields.loop %}
|
|
69
|
+
{% set controls = fields.controls ? 1 : 0 %}
|
|
70
|
+
{% set modal = fields.modal %}
|
|
71
|
+
{% set playsInModal = fields.modal %}
|
|
72
|
+
{% set muted = fields.muted %}
|
|
73
|
+
{% set lockVideoAspectToImage = fields.lock_video_aspect_to_image ? 'lock-video-aspect-to-image' : '' %}
|
|
74
|
+
{% set setVideoToCover = fields.set_video_to_cover ? 'set-video-to-cover' : '' %}
|
|
75
|
+
{% set captionsEnabled = fields.enable_captions|default(false) %}
|
|
76
|
+
{% set captions = fields.captions %}
|
|
77
|
+
{% set videoId = block.videoIdPrefix ~ fields.video_trigger_id %}
|
|
78
|
+
{% set captionsFile = fields.captions.0.captions_file %}
|
|
79
|
+
{% set noAudioCaptions = fields.enable_no_audio_captions %}
|
|
80
|
+
|
|
81
|
+
<div data-videoid="{{videoId}}" data-videocontainerid="{{fields.video_trigger_id}}" data-desktopvideo="{{gt_video_mainsrc(videoDesktop['url'])}}" data-youtubedesktop="{{youtubeDesktopId}}" data-youtubemobile="{{youtubeMobileId}}" data-vimeo-desktop-url="{{vimeoDesktopUrl}}" data-vimeo-mobile-url="{{vimeoMobileUrl}}" data-vimeodesktopid="{{vimeoDesktopId}}" data-vimeomobileid="{{vimeoMobileId}}" data-mobilevideo="{{gt_video_mainsrc(videoMobile['url'])}}" class="{{blockClassName}}__video-container cblvc-video-container {{lockVideoAspectToImage}} {{videoPlayingZindexClass}} {{setVideoToCover}}" data-videotype="{{videoType}}" data-loop="{{loopVideo}}" data-modal="{{modal}}" data-controls="{{controls}}" data-autoplay="{{autoplayVideo}}" data-autoplay-mobile="{{autoplayVideoMobile}}" data-fullscreen="{{fullscreen}}" data-muted="{{muted}}" data-videoenabled="{{videoEnabled}}" data-pattern-dynamic="1">
|
|
82
|
+
<div class="{{blockClassName}}__video-inner-container cblvc-video-container__video-inner-container" data-pattern-type>
|
|
83
|
+
{% if videoType == 'upload' %}
|
|
84
|
+
<video class="{{blockClassName}}__video-player cblvc-video-container__video-player" {{muted ? 'muted' : ''}} playsinline width='{{videoDesktop.width}}' height='{{videoDesktop.height}}'>
|
|
85
|
+
<source src="" type="video/mp4">
|
|
86
|
+
{% if captionsEnabled == true and noAudioCaptions %}
|
|
87
|
+
<track src={{ asset('no-audio.vtt') }} srclang="en" label="english" kind="captions"/>
|
|
88
|
+
|
|
89
|
+
{% elseif captionsEnabled == true and not noAudioCaptions and captions is not empty %}
|
|
90
|
+
{% for caption in captions %}
|
|
91
|
+
<track src="{{ caption.captions_file.url }}" srclang="{{ caption.language_code }}" label="{{ caption.caption_label }}" kind="captions"/>
|
|
92
|
+
{% endfor %}
|
|
93
|
+
{% endif %}
|
|
94
|
+
|
|
95
|
+
</video>
|
|
96
|
+
{% endif %}
|
|
97
|
+
{% if videoType == 'youtube' %}
|
|
98
|
+
<div id="yt-{{videoId}}"></div>
|
|
99
|
+
{% endif %}
|
|
100
|
+
{% if videoType == 'vimeo' %}
|
|
101
|
+
<div id="vimeo-{{videoId}}-{{vimeoDesktopId}}" style="width: 100%"></div>
|
|
102
|
+
{% endif %}
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
{% endif %}
|
|
106
|
+
|
|
17
107
|
</section>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
{# Do not edit this file outside of the component library as your changes will be lost with future updates. #}
|
|
2
1
|
{% set videoEnabled = fields.enable_video %}
|
|
3
2
|
{% set renderDynamic = fields.child_pattern_settings.render_dynamic|default(0) %}
|
|
4
3
|
{% set videoPlayingZindexClass = fields.video_playing_high_z_index ? 'video-playing--high-z-index' : '' %}
|