zz-shopify-components 0.0.27 → 0.0.28-beta.10

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.
Files changed (83) hide show
  1. package/CHANGELOG.md +21 -21
  2. package/README.md +70 -56
  3. package/assets/ScrollTrigger.min.js +11 -11
  4. package/assets/gsap.min.js +11 -11
  5. package/assets/jquery.js +2 -2
  6. package/assets/lazy-video.js +2 -2
  7. package/assets/lazyload.min.js +1 -1
  8. package/assets/lozad.js +10 -10
  9. package/assets/site-jump.js +52 -52
  10. package/assets/site-jumpV2.js +35 -35
  11. package/assets/swiper-bundle.min.css +12 -12
  12. package/assets/swiper-bundle.min.js +13 -13
  13. package/assets/swiper.css +330 -330
  14. package/assets/zz-components.css +322 -322
  15. package/assets/zz-components.js +166 -166
  16. package/assets/zz-fade-in-content.js +169 -169
  17. package/assets/zz-http-request.js +73 -73
  18. package/assets/zz-world-video-comments-dialog.js +240 -240
  19. package/assets/zz-world-video-dialog.js +190 -190
  20. package/assets/zz-world-video-list.js +317 -317
  21. package/assets/zz-world-video.js +270 -270
  22. package/blocks/zz-accessories-item.liquid +188 -188
  23. package/blocks/zz-accessories-swiper.liquid +223 -223
  24. package/blocks/zz-button.liquid +216 -216
  25. package/blocks/zz-content-description-html.liquid +201 -201
  26. package/blocks/zz-content-description.liquid +209 -209
  27. package/blocks/zz-flex-layout-bg-block.liquid +524 -524
  28. package/blocks/zz-flex-layout-block.liquid +549 -549
  29. package/blocks/zz-flex-layout-widget.liquid +321 -321
  30. package/blocks/zz-full-screen-swiper.liquid +443 -443
  31. package/blocks/zz-icon.liquid +46 -46
  32. package/blocks/zz-mail.liquid +135 -135
  33. package/blocks/zz-mb-swiper-pc-flex.liquid +273 -273
  34. package/blocks/zz-price-tag-mini.liquid +106 -106
  35. package/blocks/zz-price-tag.liquid +41 -41
  36. package/blocks/zz-ratio-image.liquid +181 -181
  37. package/blocks/zz-ratio-video.liquid +115 -115
  38. package/blocks/zz-responsive-width-image.liquid +222 -222
  39. package/blocks/zz-responsive-width-video.liquid +166 -166
  40. package/blocks/zz-scroll-animate-bg-text.liquid +268 -268
  41. package/blocks/zz-scroll-cover.liquid +67 -67
  42. package/blocks/zz-tag.liquid +50 -50
  43. package/blocks/zz-text.liquid +227 -227
  44. package/blocks/zz-title.liquid +287 -287
  45. package/blocks/zz-video-button.liquid +84 -84
  46. package/blocks/zz-video-img-item.liquid +203 -203
  47. package/blocks/zz-video-img-list.liquid +166 -166
  48. package/blocks/zz-video-swiper-perview-item.liquid +221 -221
  49. package/blocks/zz-video-swiper-perview.liquid +585 -585
  50. package/blocks/zz-world-video.liquid +639 -639
  51. package/component.config.json +7 -7
  52. package/package.json +1 -1
  53. package/scripts/postinstall-v1.js +39 -39
  54. package/scripts/postinstall-v2.js +47 -47
  55. package/scripts/postinstall-v3.js +51 -51
  56. package/scripts/publish-npm.js +43 -43
  57. package/sections/zz-flex-layout-section.liquid +269 -269
  58. package/sections/zz-navigation-tab-v3.liquid +409 -409
  59. package/sections/zz-navigation-tab.liquid +411 -411
  60. package/sections/zz-shopping-card-list.liquid +399 -399
  61. package/sections/zz-video-collapse-swiper.liquid +522 -522
  62. package/sections/zz-video-tab-swiper.liquid +748 -748
  63. package/snippets/zz-button.liquid +70 -70
  64. package/snippets/zz-content-h3.liquid +15 -15
  65. package/snippets/zz-content-text.liquid +56 -56
  66. package/snippets/zz-h2.liquid +31 -31
  67. package/snippets/zz-h3.liquid +31 -31
  68. package/snippets/zz-h4.liquid +30 -30
  69. package/snippets/zz-h5.liquid +39 -39
  70. package/snippets/zz-h6.liquid +39 -39
  71. package/snippets/zz-icon-next.liquid +17 -17
  72. package/snippets/zz-icon-prev.liquid +17 -17
  73. package/snippets/zz-icon.liquid +74 -74
  74. package/snippets/zz-img-md.liquid +44 -44
  75. package/snippets/zz-img.liquid +44 -44
  76. package/snippets/zz-prev-next-blur-icon.liquid +36 -36
  77. package/snippets/zz-prev-next-btn.liquid +62 -62
  78. package/snippets/zz-price-tag.liquid +22 -22
  79. package/snippets/zz-spoke.liquid +142 -142
  80. package/snippets/zz-tag.liquid +22 -22
  81. package/snippets/zz-video-button.liquid +54 -54
  82. package/snippets/zz-video-md.liquid +117 -117
  83. package/snippets/zz-video.liquid +117 -117
@@ -1,525 +1,525 @@
1
- {% schema %}
2
- {
3
- "name": "Flex Layout BG Block",
4
- "class": "flex-layout-bg-block",
5
- "settings": [
6
- {
7
- "type": "color_background",
8
- "id": "background_color",
9
- "label": "背景颜色",
10
- "default": "rgba(0,0,0,0)"
11
- },
12
- {
13
- "type": "select",
14
- "id": "bg_type",
15
- "label": "背景类型",
16
- "options": [
17
- { "value": "image", "label": "图片" },
18
- { "value": "video", "label": "视频" }
19
- ],
20
- "default": "image"
21
- },
22
- {
23
- "type": "checkbox",
24
- "id": "full_screen_bg",
25
- "label": "背景是否全屏展示",
26
- "default": false,
27
- "info": "首屏时候看需求选择开启设置,宽高都是100%"
28
- },
29
- {
30
- "type": "image_picker",
31
- "id": "pc_background_image",
32
- "label": "PC端背景图片",
33
- "visible_if": "{{ block.settings.bg_type == 'image' }}"
34
- },
35
- {
36
- "type": "image_picker",
37
- "id": "mobile_background_image",
38
- "label": "移动端背景图片",
39
- "visible_if": "{{ block.settings.bg_type == 'image' }}"
40
- },
41
- {
42
- "type": "video",
43
- "id": "pc_background_video",
44
- "label": "PC端视频",
45
- "visible_if": "{{ block.settings.bg_type == 'video' }}"
46
- },
47
- {
48
- "type": "text",
49
- "id": "pc_background_video_url",
50
- "label": "PC端视频 链接",
51
- "info": "使用cdn视频时,填写视频url。防止大屏幕视频模糊",
52
- "visible_if": "{{ block.settings.bg_type == 'video' }}"
53
- },
54
- {
55
- "type": "image_picker",
56
- "id": "pc_background_video_poster",
57
- "label": "PC端视频 封面",
58
- "visible_if": "{{ block.settings.bg_type == 'video' }}"
59
- },
60
- {
61
- "type": "video",
62
- "id": "mobile_background_video",
63
- "label": "移动端视频",
64
- "visible_if": "{{ block.settings.bg_type == 'video' }}"
65
- },
66
- {
67
- "type": "image_picker",
68
- "id": "mobile_background_video_poster",
69
- "label": "移动端视频封面",
70
- "visible_if": "{{ block.settings.bg_type == 'video' }}"
71
- },
72
- {
73
- "type": "checkbox",
74
- "id": "video_loop",
75
- "label": "视频是否循环",
76
- "default": false,
77
- "visible_if": "{{ block.settings.bg_type == 'video' }}",
78
- "info": "在swiper中使用时,自动轮播,需要设置为false"
79
- },
80
- {
81
- "type": "header",
82
- "content": "💻 PC端布局设置"
83
- },
84
-
85
- {
86
- "type": "select",
87
- "id": "pc_direction",
88
- "label": "PC方向 (Direction)",
89
- "options": [
90
- { "value": "row", "label": "横向 (Horizontal)" },
91
- { "value": "column", "label": "纵向 (Vertical)" },
92
- { "value": "row-reverse", "label": "横向反向 (Horizontal Reverse)" },
93
- { "value": "column-reverse", "label": "纵向反向 (Vertical Reverse)" }
94
- ],
95
- "default": "row"
96
- },
97
- {
98
- "type": "number",
99
- "id": "pc_gap",
100
- "label": "区块间距 (Gap)",
101
- "default": 40
102
- },
103
-
104
- {
105
- "type": "select",
106
- "id": "pc_justify",
107
- "label": "PC主轴对齐 (Justify Content)",
108
- "options": [
109
- { "value": "flex-start", "label": "起始对齐 (Flex Start)" },
110
- { "value": "center", "label": "居中对齐 (Center)" },
111
- { "value": "flex-end", "label": "末尾对齐 (Flex End)" },
112
- { "value": "space-between", "label": "两端对齐 (Space Between)" },
113
- { "value": "space-around", "label": "平均间距 (Space Around)" }
114
- ],
115
- "default": "flex-start"
116
- },
117
- {
118
- "type": "select",
119
- "id": "pc_align",
120
- "label": "PC交叉轴对齐 (Align Items)",
121
- "options": [
122
- { "value": "flex-start", "label": "起始对齐 (Flex Start)" },
123
- { "value": "center", "label": "居中对齐 (Center)" },
124
- { "value": "flex-end", "label": "末尾对齐 (Flex End)" }
125
- ],
126
- "default": "center"
127
- },
128
- {
129
- "type": "number",
130
- "id": "pc_padding_top",
131
- "label": "PC端顶部内边距 (px)",
132
- "default": 0
133
- },
134
- {
135
- "type": "number",
136
- "id": "pc_padding_bottom",
137
- "label": "PC端底部内边距 (px)",
138
- "default": 0
139
- },
140
- {
141
- "type": "checkbox",
142
- "id": "pc_full_width",
143
- "label": "内容区域是否全屏展示",
144
- "default": true
145
- },
146
- {
147
- "type": "number",
148
- "id": "pc_xl_width",
149
- "label": "XL屏幕内容区域宽度 (px)",
150
- "default": 1200,
151
- "info": "非全屏展示时有效",
152
- "visible_if": "{{ block.settings.pc_full_width == false }}"
153
- },
154
- {
155
- "type": "number",
156
- "id": "pc_lg_width",
157
- "label": "LG屏幕内容区域宽度 (vw)",
158
- "default": 90,
159
- "info": "非全屏展示时有效",
160
- "visible_if": "{{ block.settings.pc_full_width == false }}"
161
- },
162
- {
163
- "type": "header",
164
- "content": "📱 移动端布局设置"
165
- },
166
-
167
- {
168
- "type": "select",
169
- "id": "mobile_direction",
170
- "label": "移动方向 (Direction)",
171
- "options": [
172
- { "value": "row", "label": "横向 (Horizontal)" },
173
- { "value": "column", "label": "纵向 (Vertical)" },
174
- { "value": "row-reverse", "label": "横向反向 (Horizontal Reverse)" },
175
- { "value": "column-reverse", "label": "纵向反向 (Vertical Reverse)" }
176
- ],
177
- "default": "column"
178
- },
179
- {
180
- "type": "number",
181
- "id": "mobile_gap",
182
- "label": "移动区块间距 (Gap)",
183
- "default": 20
184
- },
185
- {
186
- "type": "select",
187
- "id": "mobile_justify",
188
- "label": "移动主轴对齐 (Justify Content)",
189
- "options": [
190
- { "value": "flex-start", "label": "起始对齐 (Flex Start)" },
191
- { "value": "center", "label": "居中对齐 (Center)" },
192
- { "value": "flex-end", "label": "末尾对齐 (Flex End)" },
193
- { "value": "space-between", "label": "两端对齐 (Space Between)" },
194
- { "value": "space-around", "label": "平均间距 (Space Around)" }
195
- ],
196
- "default": "flex-start"
197
- },
198
- {
199
- "type": "select",
200
- "id": "mobile_align",
201
- "label": "移动交叉轴对齐 (Align Items)",
202
- "options": [
203
- { "value": "flex-start", "label": "起始对齐 (Flex Start)" },
204
- { "value": "center", "label": "居中对齐 (Center)" },
205
- { "value": "flex-end", "label": "末尾对齐 (Flex End)" }
206
- ],
207
- "default": "center"
208
- },
209
- {
210
- "type": "number",
211
- "id": "mobile_padding_x",
212
- "label": "移动端左右内边距",
213
- "default": 0,
214
- "info": "单位:px"
215
- },
216
- {
217
- "type": "number",
218
- "id": "mobile_padding_top",
219
- "label": "移动端顶部内边距 (px)",
220
- "default": 0
221
- },
222
- {
223
- "type": "number",
224
- "id": "mobile_padding_bottom",
225
- "label": "移动端底部内边距 (px)",
226
- "default": 0
227
- },
228
- {
229
- "type": "header",
230
- "content": "动画设置"
231
- },
232
- {
233
- "type": "select",
234
- "id": "child_animation",
235
- "label": "子元素动画",
236
- "options": [
237
- { "value": "none-animation", "label": "无动画" },
238
- { "value": "fade-in-box", "label": "按序从下往上显示" },
239
- { "value": "fade-in-from-left", "label": "按序从左进入显示" },
240
- { "value": "fade-in-from-right", "label": "按序从右进入显示" },
241
- { "value": "slow-reveal", "label": "跟随页面滚动缓慢显示" }
242
- ],
243
- "default": "none-animation"
244
- },
245
- {
246
- "type": "select",
247
- "id": "self_animation",
248
- "label": "自身动画",
249
- "options": [
250
- { "value": "none-animation", "label": "无动画" },
251
- { "value": "fade-in-content", "label": "从下往上显示" },
252
- { "value": "fade-in-from-left-content", "label": "从左往右显示" },
253
- { "value": "fade-in-from-right-content", "label": "从右往左显示" },
254
- { "value": "slow-reveal-content", "label": "跟随页面滚动缓慢显示" }
255
- ],
256
- "default": "none-animation"
257
- },
258
- {
259
- "type": "checkbox",
260
- "id": "has_link",
261
- "label": "是否有链接",
262
- "default": false
263
- },
264
- {
265
- "type": "select",
266
- "id": "function_type",
267
- "label": "功能类型",
268
- "options": [
269
- {
270
- "value": "link",
271
- "label": "链接"
272
- },
273
- {
274
- "value": "link_map",
275
- "label": "多国家映射"
276
- },
277
- ],
278
- "default": "link",
279
- "visible_if": "{{ block.settings.has_link == true }}"
280
- },
281
- {
282
- "type": "url",
283
- "id": "url",
284
- "label": "链接",
285
- "visible_if": "{{ block.settings.function_type == 'link' and block.settings.has_link == true }}"
286
- },
287
- {
288
- "type": "textarea",
289
- "id": "links",
290
- "label": "Sites Link Map",
291
- "info": "国家对应链接的表,国家即是国家选择器上显示的字段,国家和路由之间用冒号隔开( 冒号后要加空格)。国家之间换行,“default”为其他未写的默认的链接 EG: Canada: https://hoverair.com/ default: https://hoverair.com/ ",
292
- "visible_if": "{{ block.settings.function_type == 'link_map' and block.settings.has_link == true }}"
293
- },
294
-
295
- ],
296
- "blocks": [
297
- {
298
- "type": "@theme",
299
- }
300
- ],
301
- "presets": [
302
- {
303
- "name": "带背景的弹性布局",
304
- },
305
- {
306
- "name": "Flex Layout BG Block"
307
- },
308
- {
309
- "name": "背景+内容",
310
- "settings": {
311
- "bg_type": "image",
312
- "pc_background_image": "shopify://shop_images/preset_pc_full_bg_pic.png",
313
- "mobile_background_image": "shopify://shop_images/preset_mobile_full_bg_pic.png",
314
- "pc_direction": "column",
315
- "pc_gap": 40,
316
- "pc_justify": "center",
317
- "pc_align": "flex-start",
318
- "pc_full_width": false,
319
- "mobile_direction": "column",
320
- "mobile_gap": 20,
321
- "mobile_justify": "flex-end",
322
- "mobile_align": "center",
323
- "mobile_padding_bottom": 100,
324
- },
325
- "blocks": [
326
- {
327
- "type": "zz-responsive-width-image",
328
- "settings": {
329
- "desktop_image": "shopify://shop_images/1_521b8e7f-8da9-4df0-9ee1-10a25ee62323.png",
330
- "desktop_width_xl": 322,
331
- "desktop_width_lg": 322,
332
- "desktop_border_radius": 0,
333
- "mobile_image": "shopify://shop_images/12_5bbff2ea-19fe-46e1-944b-f78a79ae2d4a.png",
334
- "mb_width_type": "mb_use_padding",
335
- "mobile_padding_x": 60,
336
- "mobile_width": 60,
337
- "mb_width_px": 100,
338
- "mobile_border_radius": 0,
339
- "alt": "image loading",
340
- },
341
- },
342
- {
343
- "type": "zz-title",
344
- "settings": {
345
- "pc_title": "<p>OFFICIAL FLYING CAMERA OF<br/>USA CYCLING TEAM</p>",
346
- "mb_title": "<p>OFFICIAL FLYING CAMERA OF<br/>USA CYCLING TEAM</p>",
347
- "tag": "h3",
348
- "text_color": "#ffffff",
349
- "pc_align": "left",
350
- "mobile_align": "center",
351
-
352
- },
353
- },
354
- {
355
- "type": "zz-button",
356
- "settings": {
357
- "text": "Buy Now",
358
- "function_type": "link_map",
359
- "type": "primary",
360
- "color": "white",
361
- "size": "medium"
362
- },
363
- },
364
-
365
- ]
366
- }
367
- ]
368
- }
369
- {% endschema %}
370
-
371
- <style>
372
- #shopify-block-{{ block.id }} {
373
- width: 100%;
374
- position: relative;
375
- overflow-x: hidden;
376
- background-color: {{ block.settings.background_color }};
377
- }
378
-
379
- #shopify-block-{{ block.id }} .flex-layout-video {
380
- width: 100%;
381
- height: auto;
382
- }
383
- #shopify-block-{{ block.id }} .bg-responsive-block-layout {
384
- box-sizing: border-box;
385
- position: absolute;
386
- top: 0;
387
- left: 0;
388
- width: 100%;
389
- height: 100%;
390
- display: flex;
391
- flex-direction: {{ block.settings.mobile_direction }};
392
- justify-content: {{ block.settings.mobile_justify }};
393
- align-items: {{ block.settings.mobile_align }};
394
- gap: {{ block.settings.mobile_gap }}px;
395
-
396
- padding-top: {{ block.settings.mobile_padding_top }}px;
397
- padding-bottom: {{ block.settings.mobile_padding_bottom }}px;
398
- padding-left: {{ block.settings.mobile_padding_x }}px;
399
- padding-right: {{ block.settings.mobile_padding_x }}px;
400
- {% if block.settings.has_link %}
401
- cursor: pointer;
402
- {% endif %}
403
- }
404
-
405
- @media (min-width: 1024px) {
406
- #shopify-block-{{ block.id }} .bg-responsive-block-layout {
407
- flex-direction: {{ block.settings.pc_direction }};
408
- justify-content: {{ block.settings.pc_justify }};
409
- align-items: {{ block.settings.pc_align }};
410
- gap: {{ block.settings.pc_gap }}px;
411
- padding-top: {{ block.settings.pc_padding_top }}px;
412
- padding-bottom: {{ block.settings.pc_padding_bottom }}px;
413
- padding-left: 0px;
414
- padding-right: 0px;
415
-
416
- {% if block.settings.pc_full_width %}
417
- width: 100%;
418
- {% else %}
419
- width: {{ block.settings.pc_lg_width }}vw;
420
- left: 50%;
421
- transform: translateX(-50%);
422
- {% endif %}
423
- }
424
- }
425
-
426
- @media (min-width: 1280px) {
427
- #shopify-block-{{ block.id }} .bg-responsive-block-layout {
428
- {% if block.settings.pc_full_width %}
429
- width: 100%;
430
- {% else %}
431
- width: {{ block.settings.pc_xl_width }}px;
432
- left: 50%;
433
- transform: translateX(-50%);
434
- {% endif %}
435
- }
436
- }
437
- {% if block.settings.full_screen_bg %}
438
- #shopify-block-{{ block.id }} {
439
- width: 100%;
440
- height: 100%;
441
- }
442
- #shopify-block-{{ block.id }} .flex-layout-image {
443
- width: 100%;
444
- height: 100vh;
445
- }
446
- #shopify-block-{{ block.id }} .flex-layout-video {
447
- width: 100%;
448
- height: 100vh;
449
- object-fit: cover;
450
- object-position: center;
451
- }
452
- {% endif %}
453
-
454
- </style>
455
- {% if block.settings.bg_type == 'image' %}
456
- {% if block.settings.pc_background_image != blank %}
457
- {% render 'zz-img',
458
- pc_image: block.settings.pc_background_image,
459
- mb_image: block.settings.mobile_background_image,
460
- pc_width: 2000,
461
- mb_width: 1024,
462
- class_name: 'flex-layout-image',
463
- %}
464
- {% endif %}
465
- {% endif %}
466
- {% if block.settings.bg_type == 'video' %}
467
- {% if block.settings.video_loop %}
468
- {% assign loop = true %}
469
- {% else %}
470
- {% assign loop = false %}
471
- {% endif %}
472
- {% if block.settings.full_screen_bg %}
473
- {% assign lazy = false %}
474
- {% else %}
475
- {% assign lazy = true %}
476
- {% endif %}
477
-
478
- {% if block.settings.pc_background_video_url != blank %}
479
- {% assign pc_video = block.settings.pc_background_video_url %}
480
- {% else %}
481
- {% assign pc_video = block.settings.pc_background_video %}
482
- {% endif %}
483
- {% render 'zz-video',
484
- pc_video: pc_video,
485
- pc_poster: block.settings.pc_background_video_poster,
486
- mb_video: block.settings.mobile_background_video,
487
- mb_poster: block.settings.mobile_background_video_poster,
488
- lazy: lazy,
489
- class: 'flex-layout-video',
490
- autoplay: true,
491
- loop: loop,
492
- muted: true
493
- %}
494
- {% endif %}
495
-
496
- {% assign layout_class = 'bg-layout' | append: block.id %}
497
-
498
- <div class="bg-responsive-block-layout {{ layout_class }} {{ block.settings.self_animation }} {{ block.settings.child_animation }}">
499
-
500
- {% content_for 'blocks' %}
501
- </div>
502
-
503
-
504
-
505
- {% if block.settings.has_link %}
506
- <script>
507
- document.addEventListener('DOMContentLoaded', (event) => {
508
- const btn = document.getElementsByClassName('{{ layout_class }}')
509
- if(btn && btn[0]) {
510
- {% if block.settings.function_type == 'link_map' %}
511
- if(window.bindSiteJump) {
512
- bindSiteJump(btn[0], {{ block.settings.links | json }})
513
- }
514
- {% else %}
515
- // 监听点击事件
516
- btn[0].addEventListener('click', (event) => {
517
- event.preventDefault();
518
- window.location.href = '{{ block.settings.url }}';
519
- })
520
- {% endif %}
521
- }
522
-
523
- })
524
- </script>
1
+ {% schema %}
2
+ {
3
+ "name": "Flex Layout BG Block",
4
+ "class": "flex-layout-bg-block",
5
+ "settings": [
6
+ {
7
+ "type": "color_background",
8
+ "id": "background_color",
9
+ "label": "背景颜色",
10
+ "default": "rgba(0,0,0,0)"
11
+ },
12
+ {
13
+ "type": "select",
14
+ "id": "bg_type",
15
+ "label": "背景类型",
16
+ "options": [
17
+ { "value": "image", "label": "图片" },
18
+ { "value": "video", "label": "视频" }
19
+ ],
20
+ "default": "image"
21
+ },
22
+ {
23
+ "type": "checkbox",
24
+ "id": "full_screen_bg",
25
+ "label": "背景是否全屏展示",
26
+ "default": false,
27
+ "info": "首屏时候看需求选择开启设置,宽高都是100%"
28
+ },
29
+ {
30
+ "type": "image_picker",
31
+ "id": "pc_background_image",
32
+ "label": "PC端背景图片",
33
+ "visible_if": "{{ block.settings.bg_type == 'image' }}"
34
+ },
35
+ {
36
+ "type": "image_picker",
37
+ "id": "mobile_background_image",
38
+ "label": "移动端背景图片",
39
+ "visible_if": "{{ block.settings.bg_type == 'image' }}"
40
+ },
41
+ {
42
+ "type": "video",
43
+ "id": "pc_background_video",
44
+ "label": "PC端视频",
45
+ "visible_if": "{{ block.settings.bg_type == 'video' }}"
46
+ },
47
+ {
48
+ "type": "text",
49
+ "id": "pc_background_video_url",
50
+ "label": "PC端视频 链接",
51
+ "info": "使用cdn视频时,填写视频url。防止大屏幕视频模糊",
52
+ "visible_if": "{{ block.settings.bg_type == 'video' }}"
53
+ },
54
+ {
55
+ "type": "image_picker",
56
+ "id": "pc_background_video_poster",
57
+ "label": "PC端视频 封面",
58
+ "visible_if": "{{ block.settings.bg_type == 'video' }}"
59
+ },
60
+ {
61
+ "type": "video",
62
+ "id": "mobile_background_video",
63
+ "label": "移动端视频",
64
+ "visible_if": "{{ block.settings.bg_type == 'video' }}"
65
+ },
66
+ {
67
+ "type": "image_picker",
68
+ "id": "mobile_background_video_poster",
69
+ "label": "移动端视频封面",
70
+ "visible_if": "{{ block.settings.bg_type == 'video' }}"
71
+ },
72
+ {
73
+ "type": "checkbox",
74
+ "id": "video_loop",
75
+ "label": "视频是否循环",
76
+ "default": false,
77
+ "visible_if": "{{ block.settings.bg_type == 'video' }}",
78
+ "info": "在swiper中使用时,自动轮播,需要设置为false"
79
+ },
80
+ {
81
+ "type": "header",
82
+ "content": "💻 PC端布局设置"
83
+ },
84
+
85
+ {
86
+ "type": "select",
87
+ "id": "pc_direction",
88
+ "label": "PC方向 (Direction)",
89
+ "options": [
90
+ { "value": "row", "label": "横向 (Horizontal)" },
91
+ { "value": "column", "label": "纵向 (Vertical)" },
92
+ { "value": "row-reverse", "label": "横向反向 (Horizontal Reverse)" },
93
+ { "value": "column-reverse", "label": "纵向反向 (Vertical Reverse)" }
94
+ ],
95
+ "default": "row"
96
+ },
97
+ {
98
+ "type": "number",
99
+ "id": "pc_gap",
100
+ "label": "区块间距 (Gap)",
101
+ "default": 40
102
+ },
103
+
104
+ {
105
+ "type": "select",
106
+ "id": "pc_justify",
107
+ "label": "PC主轴对齐 (Justify Content)",
108
+ "options": [
109
+ { "value": "flex-start", "label": "起始对齐 (Flex Start)" },
110
+ { "value": "center", "label": "居中对齐 (Center)" },
111
+ { "value": "flex-end", "label": "末尾对齐 (Flex End)" },
112
+ { "value": "space-between", "label": "两端对齐 (Space Between)" },
113
+ { "value": "space-around", "label": "平均间距 (Space Around)" }
114
+ ],
115
+ "default": "flex-start"
116
+ },
117
+ {
118
+ "type": "select",
119
+ "id": "pc_align",
120
+ "label": "PC交叉轴对齐 (Align Items)",
121
+ "options": [
122
+ { "value": "flex-start", "label": "起始对齐 (Flex Start)" },
123
+ { "value": "center", "label": "居中对齐 (Center)" },
124
+ { "value": "flex-end", "label": "末尾对齐 (Flex End)" }
125
+ ],
126
+ "default": "center"
127
+ },
128
+ {
129
+ "type": "number",
130
+ "id": "pc_padding_top",
131
+ "label": "PC端顶部内边距 (px)",
132
+ "default": 0
133
+ },
134
+ {
135
+ "type": "number",
136
+ "id": "pc_padding_bottom",
137
+ "label": "PC端底部内边距 (px)",
138
+ "default": 0
139
+ },
140
+ {
141
+ "type": "checkbox",
142
+ "id": "pc_full_width",
143
+ "label": "内容区域是否全屏展示",
144
+ "default": true
145
+ },
146
+ {
147
+ "type": "number",
148
+ "id": "pc_xl_width",
149
+ "label": "XL屏幕内容区域宽度 (px)",
150
+ "default": 1200,
151
+ "info": "非全屏展示时有效",
152
+ "visible_if": "{{ block.settings.pc_full_width == false }}"
153
+ },
154
+ {
155
+ "type": "number",
156
+ "id": "pc_lg_width",
157
+ "label": "LG屏幕内容区域宽度 (vw)",
158
+ "default": 90,
159
+ "info": "非全屏展示时有效",
160
+ "visible_if": "{{ block.settings.pc_full_width == false }}"
161
+ },
162
+ {
163
+ "type": "header",
164
+ "content": "📱 移动端布局设置"
165
+ },
166
+
167
+ {
168
+ "type": "select",
169
+ "id": "mobile_direction",
170
+ "label": "移动方向 (Direction)",
171
+ "options": [
172
+ { "value": "row", "label": "横向 (Horizontal)" },
173
+ { "value": "column", "label": "纵向 (Vertical)" },
174
+ { "value": "row-reverse", "label": "横向反向 (Horizontal Reverse)" },
175
+ { "value": "column-reverse", "label": "纵向反向 (Vertical Reverse)" }
176
+ ],
177
+ "default": "column"
178
+ },
179
+ {
180
+ "type": "number",
181
+ "id": "mobile_gap",
182
+ "label": "移动区块间距 (Gap)",
183
+ "default": 20
184
+ },
185
+ {
186
+ "type": "select",
187
+ "id": "mobile_justify",
188
+ "label": "移动主轴对齐 (Justify Content)",
189
+ "options": [
190
+ { "value": "flex-start", "label": "起始对齐 (Flex Start)" },
191
+ { "value": "center", "label": "居中对齐 (Center)" },
192
+ { "value": "flex-end", "label": "末尾对齐 (Flex End)" },
193
+ { "value": "space-between", "label": "两端对齐 (Space Between)" },
194
+ { "value": "space-around", "label": "平均间距 (Space Around)" }
195
+ ],
196
+ "default": "flex-start"
197
+ },
198
+ {
199
+ "type": "select",
200
+ "id": "mobile_align",
201
+ "label": "移动交叉轴对齐 (Align Items)",
202
+ "options": [
203
+ { "value": "flex-start", "label": "起始对齐 (Flex Start)" },
204
+ { "value": "center", "label": "居中对齐 (Center)" },
205
+ { "value": "flex-end", "label": "末尾对齐 (Flex End)" }
206
+ ],
207
+ "default": "center"
208
+ },
209
+ {
210
+ "type": "number",
211
+ "id": "mobile_padding_x",
212
+ "label": "移动端左右内边距",
213
+ "default": 0,
214
+ "info": "单位:px"
215
+ },
216
+ {
217
+ "type": "number",
218
+ "id": "mobile_padding_top",
219
+ "label": "移动端顶部内边距 (px)",
220
+ "default": 0
221
+ },
222
+ {
223
+ "type": "number",
224
+ "id": "mobile_padding_bottom",
225
+ "label": "移动端底部内边距 (px)",
226
+ "default": 0
227
+ },
228
+ {
229
+ "type": "header",
230
+ "content": "动画设置"
231
+ },
232
+ {
233
+ "type": "select",
234
+ "id": "child_animation",
235
+ "label": "子元素动画",
236
+ "options": [
237
+ { "value": "none-animation", "label": "无动画" },
238
+ { "value": "fade-in-box", "label": "按序从下往上显示" },
239
+ { "value": "fade-in-from-left", "label": "按序从左进入显示" },
240
+ { "value": "fade-in-from-right", "label": "按序从右进入显示" },
241
+ { "value": "slow-reveal", "label": "跟随页面滚动缓慢显示" }
242
+ ],
243
+ "default": "none-animation"
244
+ },
245
+ {
246
+ "type": "select",
247
+ "id": "self_animation",
248
+ "label": "自身动画",
249
+ "options": [
250
+ { "value": "none-animation", "label": "无动画" },
251
+ { "value": "fade-in-content", "label": "从下往上显示" },
252
+ { "value": "fade-in-from-left-content", "label": "从左往右显示" },
253
+ { "value": "fade-in-from-right-content", "label": "从右往左显示" },
254
+ { "value": "slow-reveal-content", "label": "跟随页面滚动缓慢显示" }
255
+ ],
256
+ "default": "none-animation"
257
+ },
258
+ {
259
+ "type": "checkbox",
260
+ "id": "has_link",
261
+ "label": "是否有链接",
262
+ "default": false
263
+ },
264
+ {
265
+ "type": "select",
266
+ "id": "function_type",
267
+ "label": "功能类型",
268
+ "options": [
269
+ {
270
+ "value": "link",
271
+ "label": "链接"
272
+ },
273
+ {
274
+ "value": "link_map",
275
+ "label": "多国家映射"
276
+ },
277
+ ],
278
+ "default": "link",
279
+ "visible_if": "{{ block.settings.has_link == true }}"
280
+ },
281
+ {
282
+ "type": "url",
283
+ "id": "url",
284
+ "label": "链接",
285
+ "visible_if": "{{ block.settings.function_type == 'link' and block.settings.has_link == true }}"
286
+ },
287
+ {
288
+ "type": "textarea",
289
+ "id": "links",
290
+ "label": "Sites Link Map",
291
+ "info": "国家对应链接的表,国家即是国家选择器上显示的字段,国家和路由之间用冒号隔开( 冒号后要加空格)。国家之间换行,“default”为其他未写的默认的链接 EG: Canada: https://hoverair.com/ default: https://hoverair.com/ ",
292
+ "visible_if": "{{ block.settings.function_type == 'link_map' and block.settings.has_link == true }}"
293
+ },
294
+
295
+ ],
296
+ "blocks": [
297
+ {
298
+ "type": "@theme",
299
+ }
300
+ ],
301
+ "presets": [
302
+ {
303
+ "name": "带背景的弹性布局",
304
+ },
305
+ {
306
+ "name": "Flex Layout BG Block"
307
+ },
308
+ {
309
+ "name": "背景+内容",
310
+ "settings": {
311
+ "bg_type": "image",
312
+ "pc_background_image": "shopify://shop_images/preset_pc_full_bg_pic.png",
313
+ "mobile_background_image": "shopify://shop_images/preset_mobile_full_bg_pic.png",
314
+ "pc_direction": "column",
315
+ "pc_gap": 40,
316
+ "pc_justify": "center",
317
+ "pc_align": "flex-start",
318
+ "pc_full_width": false,
319
+ "mobile_direction": "column",
320
+ "mobile_gap": 20,
321
+ "mobile_justify": "flex-end",
322
+ "mobile_align": "center",
323
+ "mobile_padding_bottom": 100,
324
+ },
325
+ "blocks": [
326
+ {
327
+ "type": "zz-responsive-width-image",
328
+ "settings": {
329
+ "desktop_image": "shopify://shop_images/1_521b8e7f-8da9-4df0-9ee1-10a25ee62323.png",
330
+ "desktop_width_xl": 322,
331
+ "desktop_width_lg": 322,
332
+ "desktop_border_radius": 0,
333
+ "mobile_image": "shopify://shop_images/12_5bbff2ea-19fe-46e1-944b-f78a79ae2d4a.png",
334
+ "mb_width_type": "mb_use_padding",
335
+ "mobile_padding_x": 60,
336
+ "mobile_width": 60,
337
+ "mb_width_px": 100,
338
+ "mobile_border_radius": 0,
339
+ "alt": "image loading",
340
+ },
341
+ },
342
+ {
343
+ "type": "zz-title",
344
+ "settings": {
345
+ "pc_title": "<p>OFFICIAL FLYING CAMERA OF<br/>USA CYCLING TEAM</p>",
346
+ "mb_title": "<p>OFFICIAL FLYING CAMERA OF<br/>USA CYCLING TEAM</p>",
347
+ "tag": "h3",
348
+ "text_color": "#ffffff",
349
+ "pc_align": "left",
350
+ "mobile_align": "center",
351
+
352
+ },
353
+ },
354
+ {
355
+ "type": "zz-button",
356
+ "settings": {
357
+ "text": "Buy Now",
358
+ "function_type": "link_map",
359
+ "type": "primary",
360
+ "color": "white",
361
+ "size": "medium"
362
+ },
363
+ },
364
+
365
+ ]
366
+ }
367
+ ]
368
+ }
369
+ {% endschema %}
370
+
371
+ <style>
372
+ #shopify-block-{{ block.id }} {
373
+ width: 100%;
374
+ position: relative;
375
+ overflow-x: hidden;
376
+ background-color: {{ block.settings.background_color }};
377
+ }
378
+
379
+ #shopify-block-{{ block.id }} .flex-layout-video {
380
+ width: 100%;
381
+ height: auto;
382
+ }
383
+ #shopify-block-{{ block.id }} .bg-responsive-block-layout {
384
+ box-sizing: border-box;
385
+ position: absolute;
386
+ top: 0;
387
+ left: 0;
388
+ width: 100%;
389
+ height: 100%;
390
+ display: flex;
391
+ flex-direction: {{ block.settings.mobile_direction }};
392
+ justify-content: {{ block.settings.mobile_justify }};
393
+ align-items: {{ block.settings.mobile_align }};
394
+ gap: {{ block.settings.mobile_gap }}px;
395
+
396
+ padding-top: {{ block.settings.mobile_padding_top }}px;
397
+ padding-bottom: {{ block.settings.mobile_padding_bottom }}px;
398
+ padding-left: {{ block.settings.mobile_padding_x }}px;
399
+ padding-right: {{ block.settings.mobile_padding_x }}px;
400
+ {% if block.settings.has_link %}
401
+ cursor: pointer;
402
+ {% endif %}
403
+ }
404
+
405
+ @media (min-width: 1024px) {
406
+ #shopify-block-{{ block.id }} .bg-responsive-block-layout {
407
+ flex-direction: {{ block.settings.pc_direction }};
408
+ justify-content: {{ block.settings.pc_justify }};
409
+ align-items: {{ block.settings.pc_align }};
410
+ gap: {{ block.settings.pc_gap }}px;
411
+ padding-top: {{ block.settings.pc_padding_top }}px;
412
+ padding-bottom: {{ block.settings.pc_padding_bottom }}px;
413
+ padding-left: 0px;
414
+ padding-right: 0px;
415
+
416
+ {% if block.settings.pc_full_width %}
417
+ width: 100%;
418
+ {% else %}
419
+ width: {{ block.settings.pc_lg_width }}vw;
420
+ left: 50%;
421
+ transform: translateX(-50%);
422
+ {% endif %}
423
+ }
424
+ }
425
+
426
+ @media (min-width: 1280px) {
427
+ #shopify-block-{{ block.id }} .bg-responsive-block-layout {
428
+ {% if block.settings.pc_full_width %}
429
+ width: 100%;
430
+ {% else %}
431
+ width: {{ block.settings.pc_xl_width }}px;
432
+ left: 50%;
433
+ transform: translateX(-50%);
434
+ {% endif %}
435
+ }
436
+ }
437
+ {% if block.settings.full_screen_bg %}
438
+ #shopify-block-{{ block.id }} {
439
+ width: 100%;
440
+ height: 100%;
441
+ }
442
+ #shopify-block-{{ block.id }} .flex-layout-image {
443
+ width: 100%;
444
+ height: 100vh;
445
+ }
446
+ #shopify-block-{{ block.id }} .flex-layout-video {
447
+ width: 100%;
448
+ height: 100vh;
449
+ object-fit: cover;
450
+ object-position: center;
451
+ }
452
+ {% endif %}
453
+
454
+ </style>
455
+ {% if block.settings.bg_type == 'image' %}
456
+ {% if block.settings.pc_background_image != blank %}
457
+ {% render 'zz-img',
458
+ pc_image: block.settings.pc_background_image,
459
+ mb_image: block.settings.mobile_background_image,
460
+ pc_width: 2000,
461
+ mb_width: 1024,
462
+ class_name: 'flex-layout-image',
463
+ %}
464
+ {% endif %}
465
+ {% endif %}
466
+ {% if block.settings.bg_type == 'video' %}
467
+ {% if block.settings.video_loop %}
468
+ {% assign loop = true %}
469
+ {% else %}
470
+ {% assign loop = false %}
471
+ {% endif %}
472
+ {% if block.settings.full_screen_bg %}
473
+ {% assign lazy = false %}
474
+ {% else %}
475
+ {% assign lazy = true %}
476
+ {% endif %}
477
+
478
+ {% if block.settings.pc_background_video_url != blank %}
479
+ {% assign pc_video = block.settings.pc_background_video_url %}
480
+ {% else %}
481
+ {% assign pc_video = block.settings.pc_background_video %}
482
+ {% endif %}
483
+ {% render 'zz-video',
484
+ pc_video: pc_video,
485
+ pc_poster: block.settings.pc_background_video_poster,
486
+ mb_video: block.settings.mobile_background_video,
487
+ mb_poster: block.settings.mobile_background_video_poster,
488
+ lazy: lazy,
489
+ class: 'flex-layout-video',
490
+ autoplay: true,
491
+ loop: loop,
492
+ muted: true
493
+ %}
494
+ {% endif %}
495
+
496
+ {% assign layout_class = 'bg-layout' | append: block.id %}
497
+
498
+ <div class="bg-responsive-block-layout {{ layout_class }} {{ block.settings.self_animation }} {{ block.settings.child_animation }}">
499
+
500
+ {% content_for 'blocks' %}
501
+ </div>
502
+
503
+
504
+
505
+ {% if block.settings.has_link %}
506
+ <script>
507
+ document.addEventListener('DOMContentLoaded', (event) => {
508
+ const btn = document.getElementsByClassName('{{ layout_class }}')
509
+ if(btn && btn[0]) {
510
+ {% if block.settings.function_type == 'link_map' %}
511
+ if(window.bindSiteJump) {
512
+ bindSiteJump(btn[0], {{ block.settings.links | json }})
513
+ }
514
+ {% else %}
515
+ // 监听点击事件
516
+ btn[0].addEventListener('click', (event) => {
517
+ event.preventDefault();
518
+ window.location.href = '{{ block.settings.url }}';
519
+ })
520
+ {% endif %}
521
+ }
522
+
523
+ })
524
+ </script>
525
525
  {% endif %}