-
Notifications
You must be signed in to change notification settings - Fork 45
/
35-card-replacement-with-video.twig
224 lines (209 loc) · 6.01 KB
/
35-card-replacement-with-video.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
{% set video_uuid1 = 'video-1' %}
{% set video_uuid2 = 'video-2' %}
{% set video_uuid3 = 'video-3' %}
{% set video_uuid4 = 'video-4' %}
{% set image %}
{% include '@bolt-elements-image/image.twig' with {
attributes: {
src: '/images/placeholders/tout-4x3-climber.jpg',
alt: 'A Rock Climber',
loading: 'lazy',
width: 400,
height: 300,
}
} only %}
{% endset %}
{% set video_thumbnail_1 %}
{% set video %}
<video-js
data-account="1900410236"
data-player="O3FkeBiaDz"
data-embed="default"
data-video-id="3974147489001"
id="{{ video_uuid1 }}"
data-media-title
data-media-duration
controls
class="c-base-video"></video-js>
{% endset %}
{% include '@bolt-components-video-thumbnail/video-thumbnail.twig' with {
content: image,
video: {
content: video,
title: 'Video Thumbnail with action play',
duration: '4:26',
has_captions: true,
show_title: true
}
} only %}
{% endset %}
{% set video_thumbnail_2 %}
{% set video %}
<video-js
data-account="1900410236"
data-player="O3FkeBiaDz"
data-embed="default"
data-video-id="3974147489001"
id="{{ video_uuid2 }}"
data-media-title
data-media-duration
controls
class="c-base-video"></video-js>
{% endset %}
{% include '@bolt-components-video-thumbnail/video-thumbnail.twig' with {
content: image,
video: {
content: video,
title: 'Video Thumbnail without action play',
duration: '4:26',
has_captions: true,
show_title: true
}
} only %}
{% endset %}
{% set video_thumbnail_3 %}
{% set video %}
<video-js
data-account="1900410236"
data-player="O3FkeBiaDz"
data-embed="default"
data-video-id="3974147489001"
id="{{ video_uuid3 }}"
data-media-title
data-media-duration
controls
class="c-base-video"></video-js>
{% endset %}
{% include '@bolt-components-video-thumbnail/video-thumbnail.twig' with {
content: image,
video: {
content: video,
title: 'Video Thumbnail with whole card clickablity',
duration: '4:26',
has_captions: true,
show_title: true
}
} only %}
{% endset %}
{% set video_thumbnail_4 %}
{% set video %}
<video-js
data-account="1900410236"
data-player="O3FkeBiaDz"
data-embed="default"
data-video-id="3974147489001"
id="{{ video_uuid4 }}"
data-media-title
data-media-duration
controls
class="c-base-video"></video-js>
{% endset %}
{% include '@bolt-components-video-thumbnail/video-thumbnail.twig' with {
content: image,
video: {
content: video,
title: 'Video Thumbnail triggered by whole card clickablity',
duration: '4:26',
has_captions: true,
show_title: true
}
} only %}
{% endset %}
{% set card_1 %}
{% include '@bolt-components-card-replacement/card-replacement.twig' with {
tag: 'article',
media: {
video: video_thumbnail_1
},
body: {
headline: 'Video Thumbnail with action play',
paragraph: 'The Video Thumbnail with an inline video (video object passed into the video.content prop) is passed in to the card\'s media.video prop. The video play button and the card\'s action button will play/pause the video.',
},
actions: [
{
text: 'Play or Pause',
attributes: {
'data-video-target': video_uuid1,
class: 'js-base-video-toggle'
}
},
],
} only %}
{% endset %}
{% set card_2 %}
{% include '@bolt-components-card-replacement/card-replacement.twig' with {
tag: 'article',
media: {
video: video_thumbnail_2
},
body: {
headline: 'Video Thumbnail without action play',
paragraph: 'The Video Thumbnail with an inline video (video object passed into the video.content prop) is passed in to the card\'s media.video prop. The video\'s play button will play/pause the video.',
}
} only %}
{% endset %}
{% set card_3 %}
{% include '@bolt-components-card-replacement/card-replacement.twig' with {
tag: 'article',
link: {
url: 'https://google.com',
text: 'Go to google.com'
},
media: {
video: video_thumbnail_3
},
body: {
headline: 'Video Thumbnail with whole card clickablity',
paragraph: 'The Video Thumbnail with an inline video (video object passed into the video.content prop) is passed in to the card\'s media.video prop. The video and the card\'s action button will play/pause the video and the whole card clickability will go to a URL path.',
},
actions: [
{
text: 'Play or Pause',
attributes: {
'data-video-target': video_uuid3,
class: 'js-base-video-toggle'
}
},
],
} only %}
{% endset %}
{% set card_4 %}
{% include '@bolt-components-card-replacement/card-replacement.twig' with {
tag: 'article',
link: {
url: '#',
attributes: {
'aria-label': 'Play the Video Thumbnail in Card whole Card Clickablity Video',
'data-video-target': video_uuid4,
class: 'js-base-video-toggle'
}
},
media: {
video: video_thumbnail_4
},
body: {
headline: 'Video Thumbnail triggered by whole card clickablity',
paragraph: 'The Video Thumbnail with an inline video (video object passed into the video.content prop) is passed in to the card\'s media.video prop. The video will play/pause when the whole card is clicked',
}
} only %}
{% endset %}
{% set layout_items %}
{% include '@bolt-layouts-layout/layout-item.twig' with {
content: card_1
} only %}
{% include '@bolt-layouts-layout/layout-item.twig' with {
content: card_2
} only %}
{% include '@bolt-layouts-layout/layout-item.twig' with {
content: card_3
} only %}
{% include '@bolt-layouts-layout/layout-item.twig' with {
content: card_4
} only %}
{% endset %}
{% include '@bolt-layouts-layout/layout.twig' with {
content: layout_items,
template: [
'thirds@from-small',
],
} only %}