appscms-tools-theme 4.2.1 → 4.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/_layouts/home.html CHANGED
@@ -2,299 +2,281 @@
2
2
  = page.folderName %} {% assign homeData= site.data[folder][lang][file] %}
3
3
  <!DOCTYPE html>
4
4
  <html lang="{{page.lang}}">
5
- {% include head/index.html %}
5
+ {% include head/index.html %}
6
6
 
7
- <body>
8
- {% include header/index.html %} {%- if homeData.nofileupload -%}
9
- <div
10
- id="safeui-alert"
11
- class="alert alert-{{homeData.variant | default: 'info'}} fade show text-center"
12
- role="alert"
13
- >
14
- <div class="container">
15
- {%- if homeData.alertmsg -%} {{homeData.alertmsg}} {%- else -%} We do
16
- not upload any files to server, hence your data is 100% secure. {%-
17
- endif -%}
18
- </div>
7
+ <body>
8
+ {% include header/index.html %} {%- if homeData.nofileupload -%}
9
+ <div id="safeui-alert" class="alert alert-{{homeData.variant | default: 'info'}} fade show text-center" role="alert">
10
+ <div class="container">
11
+ {%- if homeData.alertmsg -%} {{homeData.alertmsg}} {%- else -%} We do
12
+ not upload any files to server, hence your data is 100% secure. {%-
13
+ endif -%}
19
14
  </div>
20
- {%- endif -%} {%- if homeData.h1 or homeData.h2 -%}
21
- <div class="flex-container mb-1">
22
- <div class="flex-class py-5">
23
- <div class="d-flex justify-content-center align-items-center">
24
- <span class="fHhdVc">
25
- <div class="div-cont feature-img mr-2">
26
- {%- if homeData.img -%}
27
- <img
28
- loading="lazy"
29
- style="width:{{homeData.imgwidth}};height:{{homeData.imgheight}};"
30
- src="{{homeData.img}}"
31
- alt="{{homeData.imgalt}}"
32
- {%-
33
- if
34
- site.crossorigin
35
- -%}
36
- crossorigin
37
- {%-
38
- endif
39
- -%}
40
- />
41
- {%- endif -%}
42
- </div>
43
- </span>
44
- <h1 class="home-top-h1">
45
- {%- for word in homeData.h1 -%} {%- if forloop.first == true -%}
46
- {{word | capitalize }} {%- else -%} {{word}} {%- endif -%} {%-
47
- endfor -%}
48
- </h1>
49
- </div>
50
- <h2 class="home-top-h2">
51
- {%- for word in homeData.h2 -%} {%- if forloop.first == true -%}
52
- {{word | capitalize }} {%- else -%} {{word}} {%- endif -%} {%- endfor
53
- -%}
54
- </h2>
15
+ </div>
16
+ {%- endif -%} {%- if homeData.h1 or homeData.h2 -%}
17
+ <div class="flex-container mb-1">
18
+ <div class="flex-class py-5">
19
+ <div class="d-flex justify-content-center align-items-center">
20
+ <span class="fHhdVc">
21
+ <div class="div-cont feature-img mr-2">
22
+ {%- if homeData.img -%}
23
+ <img loading="lazy" style="width:{{homeData.imgwidth}};height:{{homeData.imgheight}};"
24
+ src="{{homeData.img}}" alt="{{homeData.imgalt}}" {%- if site.crossorigin -%} crossorigin {%- endif -%} />
25
+ {%- endif -%}
26
+ </div>
27
+ </span>
28
+ <h1 class="home-top-h1">
29
+ {%- for word in homeData.h1 -%} {%- if forloop.first == true -%}
30
+ {{word | capitalize }} {%- else -%} {{word}} {%- endif -%} {%-
31
+ endfor -%}
32
+ </h1>
55
33
  </div>
34
+ <h2 class="home-top-h2">
35
+ {%- for word in homeData.h2 -%} {%- if forloop.first == true -%}
36
+ {{word | capitalize }} {%- else -%} {{word}} {%- endif -%} {%- endfor
37
+ -%}
38
+ </h2>
56
39
  </div>
57
- {%- endif -%} {%- if homeData.features -%} {%- if site.monumetricId and
58
- page.url != '/' and page.lang == "en" -%}
59
- <div class="container">
60
- <div class="row">
61
- <div class="col-md-9 mx-auto">
62
- {%- endif -%}
63
- <div class="flex-container">
64
- <div class="flex-class">
65
- <ul class="home-features">
66
- {% for product in homeData.features %}
67
- <li
68
- style="background:{{product.color}}"
69
- class="home-feature-box"
70
- >
71
- <div class="home-inner-box">
72
- <div
73
- class="div-cont feature-img"
74
- height="36px"
75
- width="36px"
76
- >
77
- <img
78
- loading="lazy"
79
- src="{{product.icon}}"
80
- height="36px"
81
- width="36px"
82
- alt="star icon"
83
- {%-
84
- if
85
- site.crossorigin
86
- -%}
87
- crossorigin
88
- {%-
89
- endif
90
- -%}
91
- />
92
- </div>
40
+ </div>
41
+ {%- endif -%} {%- if homeData.features -%} {%- if site.monumetricId and
42
+ page.url != '/' and page.lang == "en" -%}
43
+ <div class="container">
44
+ <div class="row">
45
+ <div class="col-md-9 mx-auto">
46
+ {%- endif -%}
47
+ <div class="flex-container">
48
+ <div class="flex-class">
49
+ <ul class="home-features">
50
+ {% for product in homeData.features %}
51
+ <li style="background:{{product.color}}" class="home-feature-box">
52
+ <div class="home-inner-box">
53
+ <div class="div-cont feature-img" height="36px" width="36px">
54
+ <img loading="lazy" src="{{product.icon}}" height="36px" width="36px" alt="star icon" {%- if
55
+ site.crossorigin -%} crossorigin {%- endif -%} />
93
56
  </div>
94
- <div class="home-feature-desc">{{product.description}}</div>
95
- <a class="home-feature-name" href="{{product.url}}"
96
- >{{product.name}}</a
97
- >
98
- </li>
99
- {% endfor %}
100
- </ul>
101
- </div>
57
+ </div>
58
+ <div class="home-feature-desc">{{product.description}}</div>
59
+ <a class="home-feature-name" href="{{product.url}}">{{product.name}}</a>
60
+ </li>
61
+ {% endfor %}
62
+ </ul>
102
63
  </div>
103
- {%- if site.monumetricId and page.url != '/' and page.lang == "en" -%}
104
64
  </div>
65
+ {%- if site.monumetricId and page.url != '/' and page.lang == "en" -%}
105
66
  </div>
106
67
  </div>
107
- {%- endif -%} {%- endif -%}
108
- <div class="home-content-box" id="theme-content-box">{{content}}</div>
109
- {%- if homeData.TEXTUAL_CONTENT -%}
110
- <div class="container mt-4 mb-4">
111
- <div class="row px-0">
112
- {%- if site.monumetricId and page.url != '/' and page.lang == "en" -%}
113
- <div class="col-md-9 mx-auto">
114
- <div class="row">
115
- {%- endif -%} {% assign totalHeaderCount = 0 %} {% for data in
116
- homeData.TEXTUAL_CONTENT %} {% assign words = data.header | split: "
117
- " %} {% assign word_count = words | size %} {% assign
118
- totalHeaderCount = totalHeaderCount | plus: word_count %} {% endfor
119
- %} {% for data in homeData.TEXTUAL_CONTENT %}
120
- <div
121
- class="{%- if site.monumetricId and page.url != '/' and page.lang == 'en' -%} col-md-6 my-4 {%- else -%} col-md-4 my-4 {%- endif -%}"
122
- >
123
- <div>
124
- <img
125
- class="feature-card-img"
126
- height="48px"
127
- width="48px"
128
- loading="lazy"
129
- src="{{data.logoUrl}}"
130
- alt="{{data.header}}"
131
- {%-
132
- if
133
- site.crossorigin
134
- -%}
135
- crossorigin
136
- {%-
137
- endif
138
- -%}
139
- />
68
+ </div>
69
+ {%- endif -%} {%- endif -%}
70
+ <div class="home-content-box" id="theme-content-box">{{content}}</div>
71
+ {%- if homeData.TEXTUAL_CONTENT -%}
72
+ <div class="container mt-4 mb-4">
73
+ <div class="row px-0">
74
+ {%- if site.monumetricId and page.url != '/' and page.lang == "en" -%}
75
+ <div class="col-md-9 mx-auto">
76
+ <div class="row">
77
+ {%- endif -%} {% assign totalHeaderCount = 0 %} {% for data in
78
+ homeData.TEXTUAL_CONTENT %} {% assign words = data.header | split: "
79
+ " %} {% assign word_count = words | size %} {% assign
80
+ totalHeaderCount = totalHeaderCount | plus: word_count %} {% endfor
81
+ %} {% for data in homeData.TEXTUAL_CONTENT %}
82
+ <div
83
+ class="{%- if site.monumetricId and page.url != '/' and page.lang == 'en' -%} col-md-6 my-4 {%- else -%} col-md-4 my-4 {%- endif -%}">
84
+ <div>
85
+ <img class="feature-card-img" height="48px" width="48px" loading="lazy" src="{{data.logoUrl}}"
86
+ alt="{{data.header}}" {%- if site.crossorigin -%} crossorigin {%- endif -%} />
140
87
 
141
- {%- if totalHeaderCount > site.count_of_words_in_headings -%}
142
- <h2 class="feature-card-title">
143
- {{data.header | replace: "$variable", page.value}}
144
- </h2>
145
- {%- else -%}
146
- <div class="feature-card-title">
147
- {{data.header | replace: "$variable", page.value}}
148
- </div>
149
- {%- endif -%}
150
- <div class="feature-card-desc">
151
- {{data.content | replace: "$variable", page.value}}
152
- </div>
88
+ {%- if totalHeaderCount > site.count_of_words_in_headings -%}
89
+ <h2 class="feature-card-title">
90
+ {{data.header | replace: "$variable", page.value}}
91
+ </h2>
92
+ {%- else -%}
93
+ <div class="feature-card-title">
94
+ {{data.header | replace: "$variable", page.value}}
95
+ </div>
96
+ {%- endif -%}
97
+ <div class="feature-card-desc">
98
+ {{data.content | replace: "$variable", page.value}}
153
99
  </div>
154
100
  </div>
155
- {% endfor %} {%- if site.monumetricId and page.url != '/' and
156
- page.lang == "en" -%}
157
101
  </div>
102
+ {% endfor %} {%- if site.monumetricId and page.url != '/' and
103
+ page.lang == "en" -%}
158
104
  </div>
159
- {%- endif -%}
160
105
  </div>
106
+ {%- endif -%}
161
107
  </div>
162
- {%- endif -%} {%- if homeData.HOW_TO_CONTENT -%}
163
- <section class="how-to-section">
164
- <div class="container">
165
- <div class="row">
166
- {%- if site.monumetricId and page.url != '/' and page.lang == "en" -%}
167
- <div class="col-md-9 mx-auto">
168
- <div class="row">
169
- {%- endif -%}
170
- <div class="col-md-6 order-0">
171
- {%- if homeData.HOW_TO_CONTENT.YoutubeVideoUrl.size > 0 -%}
172
- <div class="how-to-video-wrapper">
173
- {% assign video_url = homeData.HOW_TO_CONTENT.YoutubeVideoUrl %}
174
- {% assign video_id = "" %}
175
- {% if video_url contains "youtu.be/" %}
176
- {% assign parts = video_url | split: "/" %}
177
- {% assign video_id = parts[3] %}
178
- {% elsif video_url contains "youtube.com/watch" %}
179
- {% assign params = video_url | split: "?" | last | split: "&" %}
180
- {% for param in params %}
181
- {% if param contains "v=" %}
182
- {% assign video_id = param | split: "=" | last %}
183
- {% endif %}
184
- {% endfor %}
185
- {% endif %}
186
- {%- if site.monumetricId -%}
187
- <iframe class="youtubeVideoPlayer mb-5" width="400" height="315"
188
- src="https://www.youtube.com/embed/{{video_id}}?autoplay=1&mute=1" allowfullscreen>
189
- </iframe>
190
- {%- else -%}
191
- <iframe class="youtubeVideoPlayer mb-5" width="500" height="315"
192
- src="https://www.youtube.com/embed/{{video_id}}?autoplay=1&mute=1" allowfullscreen>
193
- </iframe>
194
- {%- endif -%}
108
+ </div>
109
+ {%- endif -%} {%- if homeData.HOW_TO_CONTENT -%}
110
+ <section class="how-to-section">
111
+ <div class="container">
112
+ <div class="row">
113
+ {%- if site.monumetricId and page.url != '/' and page.lang == "en" -%}
114
+ <div class="col-md-9 mx-auto">
115
+ <div class="row">
116
+ {%- endif -%}
117
+ <div class="col-md-6 order-0">
118
+ {%- if homeData.HOW_TO_CONTENT.YoutubeVideoUrl.size > 0 -%}
119
+ <div class="how-to-video-wrapper">
120
+ {% assign video_url = homeData.HOW_TO_CONTENT.YoutubeVideoUrl %}
121
+ {% assign video_id = "" %}
122
+ {% if video_url contains "youtu.be/" %}
123
+ {% assign parts = video_url | split: "/" %}
124
+ {% assign video_id = parts[3] %}
125
+ {% elsif video_url contains "youtube.com/watch" %}
126
+ {% assign params = video_url | split: "?" | last | split: "&" %}
127
+ {% for param in params %}
128
+ {% if param contains "v=" %}
129
+ {% assign video_id = param | split: "=" | last %}
130
+ {% endif %}
131
+ {% endfor %}
132
+ {% endif %}
133
+
134
+ {%- if site.monumetricId -%}
135
+ <div class="how-to-video h-100 w-100" data-videoid="{{video_id}}">
136
+ <img class="youtubeVideoPlayer" width="100%" height="100%" id="thumbnail-img" alt="thumbnail-img" />
137
+ <div class="youtube-play-btn-wrapper">
138
+ <button class="play-btn btn btn-primary" onClick="loadVideo()">►</button>
139
+ </div>
195
140
  </div>
196
141
  {%- else -%}
197
- <div class="how-to-img-wrapper">
198
- <img class="how-to-leftimg" height="180px" width="300px"
199
- src="{{homeData.HOW_TO_CONTENT.logoImageUrl}}" loading="lazy"
200
- alt="{{homeData.HOW_TO_CONTENT.logoImageAlt | default: 'how to image' }}" {%- if site.crossorigin
201
- -%} crossorigin {%- endif -%} />
142
+ <div class="how-to-video h-100 w-100" data-videoid="{{video_id}}">
143
+ <img class="youtubeVideoPlayer" width="100%" height="100%" id="thumbnail-img" alt="thumbnail-img" />
144
+ <div class="youtube-play-btn-wrapper">
145
+ <button class="play-btn btn btn-primary" onClick="loadVideo()">►</button>
146
+ </div>
202
147
  </div>
203
148
  {%- endif -%}
204
149
  </div>
205
- <div class="col-md-6 order-1">
206
- <div class="how-to-right">
207
- <h3 class="how-to-title text-left">
208
- {{homeData.HOW_TO_CONTENT.heading | replace: "$variable",
209
- page.value}}
210
- </h3>
211
- <ol class="how-to-list">
212
- {% for data in homeData.HOW_TO_CONTENT.steps %}
213
-
214
- <li id="step{{forloop.index}}" class="how-to-list-item">
215
- <span>{{forloop.index}}.</span>{{data | replace:
216
- "$variable", page.value}}
217
- </li>
218
- {% endfor %}
219
- </ol>
220
- </div>
150
+ {%- else -%}
151
+ <div class="how-to-img-wrapper">
152
+ <img class="how-to-leftimg" height="180px" width="300px" src="{{homeData.HOW_TO_CONTENT.logoImageUrl}}"
153
+ loading="lazy" alt="{{homeData.HOW_TO_CONTENT.logoImageAlt | default: 'how to image' }}" {%- if
154
+ site.crossorigin -%} crossorigin {%- endif -%} />
221
155
  </div>
222
- {%- if site.monumetricId and page.url != '/' and page.lang == 'en'
223
- -%}
156
+ {%- endif -%}
224
157
  </div>
158
+ <div class="col-md-6 order-1">
159
+ <div class="how-to-right">
160
+ <h3 class="how-to-title text-left">
161
+ {{homeData.HOW_TO_CONTENT.heading | replace: "$variable",
162
+ page.value}}
163
+ </h3>
164
+ <ol class="how-to-list">
165
+ {% for data in homeData.HOW_TO_CONTENT.steps %}
166
+
167
+ <li id="step{{forloop.index}}" class="how-to-list-item">
168
+ <span>{{forloop.index}}.</span>{{data | replace:
169
+ "$variable", page.value}}
170
+ </li>
171
+ {% endfor %}
172
+ </ol>
173
+ </div>
174
+ </div>
175
+ {%- if site.monumetricId and page.url != '/' and page.lang == 'en'
176
+ -%}
225
177
  </div>
226
- {%- endif -%}
227
178
  </div>
179
+ {%- endif -%}
228
180
  </div>
229
- </section>
230
- {%- endif -%} {%- assign showFaqs = true -%} {%- for item in site.noFaqsList
231
- -%} {%- if item == page.lang -%} {%- assign showFaqs = false -%} {%- break
232
- -%} {%- else -%} {%- assign showFaqs = true -%} {%- endif -%} {%- endfor -%}
233
- {%- if showFaqs == true -%} {%- if homeData.FAQ -%}
234
- <section class="faq-section">
235
- <div class="container">
236
- <div class="row">
237
- <div class="col-md-8 mx-auto">
238
- <div class="faq">
239
- {%- if homeData.FAQ.size>0 -%}
240
- <h3 class="feature-h1 text-center mb-4">
241
- {{homeData.faqheading | default: 'Frequently Asked Questions'}}
242
- </h3>
243
- {%- endif -%}
244
- <ul class="list-unstyled">
245
- {% for data in homeData.FAQ %}
246
- <li>
247
- <h3 class="faq-question" itemprop="name">
248
- {{data.question | replace: "$variable", page.value}}<em
249
- style="transform: rotate(-135deg)"
250
- >
251
- <i></i
252
- ></em>
253
- </h3>
254
- <div style="display: block">
255
- <p class="faq-answer" itemprop="text">
256
- {{data.answer | replace: "$variable", page.value}}
257
- </p>
258
- </div>
259
- </li>
260
- {% endfor %}
261
- </ul>
262
- </div>
181
+ </div>
182
+ </section>
183
+ {%- endif -%} {%- assign showFaqs = true -%} {%- for item in site.noFaqsList
184
+ -%} {%- if item == page.lang -%} {%- assign showFaqs = false -%} {%- break
185
+ -%} {%- else -%} {%- assign showFaqs = true -%} {%- endif -%} {%- endfor -%}
186
+ {%- if showFaqs == true -%} {%- if homeData.FAQ -%}
187
+ <section class="faq-section">
188
+ <div class="container">
189
+ <div class="row">
190
+ <div class="col-md-8 mx-auto">
191
+ <div class="faq">
192
+ {%- if homeData.FAQ.size>0 -%}
193
+ <h3 class="feature-h1 text-center mb-4">
194
+ {{homeData.faqheading | default: 'Frequently Asked Questions'}}
195
+ </h3>
196
+ {%- endif -%}
197
+ <ul class="list-unstyled">
198
+ {% for data in homeData.FAQ %}
199
+ <li>
200
+ <h3 class="faq-question" itemprop="name">
201
+ {{data.question | replace: "$variable", page.value}}<em style="transform: rotate(-135deg)">
202
+ <i></i></em>
203
+ </h3>
204
+ <div style="display: block">
205
+ <p class="faq-answer" itemprop="text">
206
+ {{data.answer | replace: "$variable", page.value}}
207
+ </p>
208
+ </div>
209
+ </li>
210
+ {% endfor %}
211
+ </ul>
263
212
  </div>
264
213
  </div>
265
214
  </div>
266
- </section>
267
- {%- endif -%} {%- endif -%} {%- include share/socialshare.html -%} {%-
268
- include Rating/rating.html -%}
269
- {%- if homeData.infographics.size > 0 -%}
270
- {%- include infographics/infographics.html -%}
271
- {%- endif -%}
272
-
273
- {%- if homeData.USPS -%} {%- include
274
- /Usp/usp.html -%} {%- endif -%} {%- if homeData.display_formats -%}
275
- <div class="container file-detail-table">
276
- {%- include fileformat/fileformatdetail.html -%}
277
215
  </div>
278
- {%- endif -%} {%- if homeData.compare_formats -%}
279
- <div class="container compare-table">
280
- {%- include fileformat/comparisonfiles.html -%}
281
- </div>
282
- {%- endif -%} {%- assign langen = "en" -%} {%- if
283
- site.data[folder][langen][file].categories -%} {%- assign categories =
284
- site.data[folder][langen][file].categories -%} {%- else -%} {%- assign
285
- categories = page.categories -%} {%- endif -%} {%- if
286
- site.data[folder][langen][file].tags -%} {%- assign tags =
287
- site.data[folder][langen][file].tags -%} {%- else -%} {%- assign tags =
288
- page.tags -%} {%- endif -%} {%- if homeData.posts.size > 0 -%} {%- include
289
- customblog/pageRelatedPosts.html -%} {%- else -%} {%- if categories.size > 0
290
- or tags.size > 0 -%} {%- include section/related_categories_post.html -%}
291
- {%- else -%} {%- include section/recent_posts.html -%} {%- endif -%} {%-
292
- endif -%} {%- if site.customblogdata -%} {%- if categories.size > 0 or
293
- tags.size > 0 -%} {%- include customblog/relatedposts.html -%} {%- else -%}
294
- {%- include customblog/recentposts.html -%} {%- endif -%} {%- endif -%} {%-
295
- if homeData.author.size > 0 -%} {%- include
296
- featurePageAuthors/featurePageAuthors.html -%} {%- endif -%} {%- include
297
- footer/index.html -%} {%- if site.customCode -%} {%- include customCode.html
298
- -%} {%- endif -%} {%- include script.html -%}
299
- </body>
300
- </html>
216
+ </section>
217
+ {%- endif -%} {%- endif -%} {%- include share/socialshare.html -%} {%-
218
+ include Rating/rating.html -%}
219
+ {%- if homeData.infographics.size > 0 -%}
220
+ {%- include infographics/infographics.html -%}
221
+ {%- endif -%}
222
+
223
+ {%- if homeData.USPS -%} {%- include
224
+ /Usp/usp.html -%} {%- endif -%} {%- if homeData.display_formats -%}
225
+ <div class="container file-detail-table">
226
+ {%- include fileformat/fileformatdetail.html -%}
227
+ </div>
228
+ {%- endif -%} {%- if homeData.compare_formats -%}
229
+ <div class="container compare-table">
230
+ {%- include fileformat/comparisonfiles.html -%}
231
+ </div>
232
+ {%- endif -%} {%- assign langen = "en" -%} {%- if
233
+ site.data[folder][langen][file].categories -%} {%- assign categories =
234
+ site.data[folder][langen][file].categories -%} {%- else -%} {%- assign
235
+ categories = page.categories -%} {%- endif -%} {%- if
236
+ site.data[folder][langen][file].tags -%} {%- assign tags =
237
+ site.data[folder][langen][file].tags -%} {%- else -%} {%- assign tags =
238
+ page.tags -%} {%- endif -%} {%- if homeData.posts.size > 0 -%} {%- include
239
+ customblog/pageRelatedPosts.html -%} {%- else -%} {%- if categories.size > 0
240
+ or tags.size > 0 -%} {%- include section/related_categories_post.html -%}
241
+ {%- else -%} {%- include section/recent_posts.html -%} {%- endif -%} {%-
242
+ endif -%} {%- if site.customblogdata -%} {%- if categories.size > 0 or
243
+ tags.size > 0 -%} {%- include customblog/relatedposts.html -%} {%- else -%}
244
+ {%- include customblog/recentposts.html -%} {%- endif -%} {%- endif -%} {%-
245
+ if homeData.author.size > 0 -%} {%- include
246
+ featurePageAuthors/featurePageAuthors.html -%} {%- endif -%} {%- include
247
+ footer/index.html -%} {%- if site.customCode -%} {%- include customCode.html
248
+ -%} {%- endif -%} {%- include script.html -%}
249
+ </body>
250
+
251
+ {%- if homeData.HOW_TO_CONTENT.YoutubeVideoUrl.size > 0 -%}
252
+ <script>
253
+ let videoContainer = document.querySelector('.how-to-video');
254
+ let thumbnail = document.getElementById('thumbnail-img');
255
+ let videoId = videoContainer.getAttribute("data-videoid")
256
+ let thumbnailUrl = 'https://img.youtube.com/vi/' + videoId + '/maxresdefault.jpg';
257
+ console.log(videoId)
258
+
259
+ // Function to load video
260
+ function loadVideo() {
261
+ videoContainer.innerHTML = '<iframe loading="lazy" class="youtubeVideoPlayer" width="100%" height="100%" src="https://www.youtube.com/embed/' + videoId + '?autoplay=1&mute=1" allowfullscreen></iframe>';
262
+ }
263
+ // Function to handle lazy loading of the thumbnail
264
+ function lazyLoadThumbnail(entries, observer) {
265
+ entries.forEach(entry => {
266
+ if (entry.isIntersecting) {
267
+ // Load thumbnail when it becomes visible
268
+ thumbnail.src = thumbnailUrl;
269
+ // Stop observing once loaded
270
+ observer.unobserve(entry.target);
271
+ }
272
+ });
273
+ }
274
+ // Set up the Intersection Observer
275
+ var observer = new IntersectionObserver(lazyLoadThumbnail, { threshold: 0.1 });
276
+ observer.observe(thumbnail);
277
+ // Optionally, you can add an event listener to trigger video loading on click or other interactions
278
+ thumbnail.addEventListener('click', loadVideo);
279
+ </script>
280
+ {%- endif -%}
281
+
282
+ </html>
data/assets/css/tools.css CHANGED
@@ -875,6 +875,27 @@ ul li {
875
875
  justify-content: center;
876
876
  }
877
877
 
878
+
879
+ .how-to-video .youtube-play-btn-wrapper {
880
+ position: absolute;
881
+ top: 0%;
882
+ left: -17px;
883
+ display: flex;
884
+ text-align: center;
885
+ width: 100%;
886
+ justify-content: center;
887
+ align-items: center;
888
+ height: 100%;
889
+ }
890
+
891
+ .youtube-play-btn-wrapper .play-btn {
892
+ font-size: 28px;
893
+ width: 68px;
894
+ background-color: red;
895
+ border: none;
896
+ border-radius: 15px;
897
+ }
898
+
878
899
  @media (max-width: 768px) {
879
900
  .how-to-video-wrapper .youtubeVideoPlayer {
880
901
  width: 100%;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appscms-tools-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - vivek-appscms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-10 00:00:00.000000000 Z
11
+ date: 2024-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll