zz-shopify-components 0.0.1-beta.1

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 (61) hide show
  1. package/README.md +12 -0
  2. package/assets/fade-in-content.js +169 -0
  3. package/assets/gsap.min.js +11 -0
  4. package/assets/http-request.js +73 -0
  5. package/assets/jquery.js +2 -0
  6. package/assets/lozad.js +10 -0
  7. package/assets/site-jump.js +52 -0
  8. package/assets/site-jumpV2.js +35 -0
  9. package/assets/swiper-bundle.min.css +13 -0
  10. package/assets/swiper-bundle.min.js +14 -0
  11. package/assets/swiper.css +331 -0
  12. package/assets/zz-components.css +323 -0
  13. package/assets/zz-components.js +166 -0
  14. package/blocks/zz-accessories-item.liquid +183 -0
  15. package/blocks/zz-accessories-swiper.liquid +223 -0
  16. package/blocks/zz-button.liquid +189 -0
  17. package/blocks/zz-content-description-html.liquid +199 -0
  18. package/blocks/zz-content-description.liquid +200 -0
  19. package/blocks/zz-flex-layout-bg-block.liquid +520 -0
  20. package/blocks/zz-flex-layout-block.liquid +545 -0
  21. package/blocks/zz-flex-layout-widget.liquid +318 -0
  22. package/blocks/zz-full-screen-swiper.liquid +444 -0
  23. package/blocks/zz-icon.liquid +46 -0
  24. package/blocks/zz-mail.liquid +135 -0
  25. package/blocks/zz-mb-swiper-pc-flex.liquid +270 -0
  26. package/blocks/zz-ratio-image.liquid +177 -0
  27. package/blocks/zz-ratio-video.liquid +112 -0
  28. package/blocks/zz-responsive-width-image.liquid +219 -0
  29. package/blocks/zz-responsive-width-video.liquid +163 -0
  30. package/blocks/zz-scroll-animate-bg-text.liquid +265 -0
  31. package/blocks/zz-scroll-cover.liquid +64 -0
  32. package/blocks/zz-tag.liquid +48 -0
  33. package/blocks/zz-text.liquid +225 -0
  34. package/blocks/zz-title.liquid +284 -0
  35. package/blocks/zz-video-button.liquid +81 -0
  36. package/blocks/zz-video-swiper-perview-item.liquid +216 -0
  37. package/blocks/zz-video-swiper-perview.liquid +582 -0
  38. package/component.config.json +4 -0
  39. package/package.json +23 -0
  40. package/scripts/postinstall-v2.js +47 -0
  41. package/scripts/postinstall.js +39 -0
  42. package/sections/zz-flex-layout-section.liquid +266 -0
  43. package/sections/zz-navigation-tab-v3.liquid +403 -0
  44. package/sections/zz-navigation-tab.liquid +410 -0
  45. package/sections/zz-video-collapse-swiper.liquid +522 -0
  46. package/sections/zz-video-tab-swiper.liquid +745 -0
  47. package/snippets/zz-button.liquid +70 -0
  48. package/snippets/zz-content-text.liquid +56 -0
  49. package/snippets/zz-h2.liquid +31 -0
  50. package/snippets/zz-h3.liquid +31 -0
  51. package/snippets/zz-h4.liquid +30 -0
  52. package/snippets/zz-h5.liquid +39 -0
  53. package/snippets/zz-h6.liquid +39 -0
  54. package/snippets/zz-icon.liquid +74 -0
  55. package/snippets/zz-img.liquid +44 -0
  56. package/snippets/zz-prev-next-btn.liquid +62 -0
  57. package/snippets/zz-spoke.liquid +142 -0
  58. package/snippets/zz-tag.liquid +22 -0
  59. package/snippets/zz-video-button.liquid +55 -0
  60. package/snippets/zz-video-md.liquid +117 -0
  61. package/snippets/zz-video.liquid +117 -0
@@ -0,0 +1,520 @@
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": "背景+内容",
307
+ "settings": {
308
+ "bg_type": "image",
309
+ "pc_background_image": "shopify://shop_images/preset_pc_full_bg_pic.png",
310
+ "mobile_background_image": "shopify://shop_images/preset_mobile_full_bg_pic.png",
311
+ "pc_direction": "column",
312
+ "pc_gap": 40,
313
+ "pc_justify": "center",
314
+ "pc_align": "flex-start",
315
+ "pc_full_width": false,
316
+ "mobile_direction": "column",
317
+ "mobile_gap": 20,
318
+ "mobile_justify": "flex-end",
319
+ "mobile_align": "center",
320
+ "mobile_padding_bottom": 100,
321
+ },
322
+ "blocks": [
323
+ {
324
+ "type": "zz-responsive-width-image",
325
+ "settings": {
326
+ "desktop_image": "shopify://shop_images/1_521b8e7f-8da9-4df0-9ee1-10a25ee62323.png",
327
+ "desktop_width_xl": 322,
328
+ "desktop_width_lg": 322,
329
+ "desktop_border_radius": 0,
330
+ "mobile_image": "shopify://shop_images/12_5bbff2ea-19fe-46e1-944b-f78a79ae2d4a.png",
331
+ "mb_width_type": "mb_use_padding",
332
+ "mobile_padding_x": 60,
333
+ "mobile_width": 60,
334
+ "mb_width_px": 100,
335
+ "mobile_border_radius": 0,
336
+ "alt": "image loading",
337
+ },
338
+ },
339
+ {
340
+ "type": "zz-title",
341
+ "settings": {
342
+ "pc_title": "<p>OFFICIAL FLYING CAMERA OF<br/>USA CYCLING TEAM</p>",
343
+ "mb_title": "<p>OFFICIAL FLYING CAMERA OF<br/>USA CYCLING TEAM</p>",
344
+ "tag": "h3",
345
+ "text_color": "#ffffff",
346
+ "pc_align": "left",
347
+ "mobile_align": "center",
348
+
349
+ },
350
+ },
351
+ {
352
+ "type": "zz-button",
353
+ "settings": {
354
+ "text": "Buy Now",
355
+ "function_type": "link_map",
356
+ "type": "primary",
357
+ "color": "white",
358
+ "size": "medium"
359
+ },
360
+ },
361
+
362
+ ]
363
+ }
364
+ ]
365
+ }
366
+ {% endschema %}
367
+
368
+ <style>
369
+ #shopify-block-{{ block.id }} {
370
+ width: 100%;
371
+ position: relative;
372
+ overflow-x: hidden;
373
+ background-color: {{ block.settings.background_color }};
374
+ }
375
+
376
+ #shopify-block-{{ block.id }} .flex-layout-video {
377
+ width: 100%;
378
+ height: auto;
379
+ }
380
+ #shopify-block-{{ block.id }} .bg-responsive-block-layout {
381
+ box-sizing: border-box;
382
+ position: absolute;
383
+ top: 0;
384
+ left: 0;
385
+ width: 100%;
386
+ height: 100%;
387
+ display: flex;
388
+ flex-direction: {{ block.settings.mobile_direction }};
389
+ justify-content: {{ block.settings.mobile_justify }};
390
+ align-items: {{ block.settings.mobile_align }};
391
+ gap: {{ block.settings.mobile_gap }}px;
392
+
393
+ padding-top: {{ block.settings.mobile_padding_top }}px;
394
+ padding-bottom: {{ block.settings.mobile_padding_bottom }}px;
395
+ padding-left: {{ block.settings.mobile_padding_x }}px;
396
+ padding-right: {{ block.settings.mobile_padding_x }}px;
397
+ {% if block.settings.has_link %}
398
+ cursor: pointer;
399
+ {% endif %}
400
+ }
401
+
402
+ @media (min-width: 1024px) {
403
+ #shopify-block-{{ block.id }} .bg-responsive-block-layout {
404
+ flex-direction: {{ block.settings.pc_direction }};
405
+ justify-content: {{ block.settings.pc_justify }};
406
+ align-items: {{ block.settings.pc_align }};
407
+ gap: {{ block.settings.pc_gap }}px;
408
+ padding-top: {{ block.settings.pc_padding_top }}px;
409
+ padding-bottom: {{ block.settings.pc_padding_bottom }}px;
410
+ padding-left: 0px;
411
+ padding-right: 0px;
412
+
413
+ {% if block.settings.pc_full_width %}
414
+ width: 100%;
415
+ {% else %}
416
+ width: {{ block.settings.pc_lg_width }}vw;
417
+ left: 50%;
418
+ transform: translateX(-50%);
419
+ {% endif %}
420
+ }
421
+ }
422
+
423
+ @media (min-width: 1280px) {
424
+ #shopify-block-{{ block.id }} .bg-responsive-block-layout {
425
+ {% if block.settings.pc_full_width %}
426
+ width: 100%;
427
+ {% else %}
428
+ width: {{ block.settings.pc_xl_width }}px;
429
+ left: 50%;
430
+ transform: translateX(-50%);
431
+ {% endif %}
432
+ }
433
+ }
434
+ {% if block.settings.full_screen_bg %}
435
+ #shopify-block-{{ block.id }} {
436
+ width: 100vw;
437
+ height: 100vh;
438
+ }
439
+ #shopify-block-{{ block.id }} .flex-layout-image {
440
+ width: 100vw;
441
+ height: 100vh;
442
+ }
443
+ #shopify-block-{{ block.id }} .flex-layout-video {
444
+ width: 100vw;
445
+ height: 100vh;
446
+ object-fit: cover;
447
+ object-position: center;
448
+ }
449
+ {% endif %}
450
+
451
+ </style>
452
+ {% if block.settings.bg_type == 'image' %}
453
+ {% if block.settings.pc_background_image != blank %}
454
+ {% render 'zz-img',
455
+ pc_image: block.settings.pc_background_image,
456
+ mb_image: block.settings.mobile_background_image,
457
+ pc_width: 2000,
458
+ mb_width: 1024,
459
+ class_name: 'flex-layout-image',
460
+ %}
461
+ {% endif %}
462
+ {% endif %}
463
+ {% if block.settings.bg_type == 'video' %}
464
+ {% if block.settings.video_loop %}
465
+ {% assign loop = true %}
466
+ {% else %}
467
+ {% assign loop = false %}
468
+ {% endif %}
469
+ {% if block.settings.full_screen_bg %}
470
+ {% assign lazy = false %}
471
+ {% else %}
472
+ {% assign lazy = true %}
473
+ {% endif %}
474
+
475
+ {% if block.settings.pc_background_video_url != blank %}
476
+ {% assign pc_video = block.settings.pc_background_video_url %}
477
+ {% else %}
478
+ {% assign pc_video = block.settings.pc_background_video %}
479
+ {% endif %}
480
+ {% render 'zz-video',
481
+ pc_video: pc_video,
482
+ pc_poster: block.settings.pc_background_video_poster,
483
+ mb_video: block.settings.mobile_background_video,
484
+ mb_poster: block.settings.mobile_background_video_poster,
485
+ lazy: lazy,
486
+ class: 'flex-layout-video',
487
+ autoplay: true,
488
+ loop: loop,
489
+ muted: true
490
+ %}
491
+ {% endif %}
492
+
493
+ {% assign layout_class = 'bg-layout' | append: block.id %}
494
+
495
+ <div class="bg-responsive-block-layout {{ layout_class }} {{ block.settings.self_animation }} {{ block.settings.child_animation }}">
496
+
497
+ {% content_for 'blocks' %}
498
+ </div>
499
+
500
+
501
+
502
+ {% if block.settings.has_link %}
503
+ <script>
504
+ document.addEventListener('DOMContentLoaded', (event) => {
505
+ const btn = document.getElementsByClassName('{{ layout_class }}')
506
+ if(btn && btn[0]) {
507
+ {% if block.settings.function_type == 'link_map' %}
508
+ bindSiteJump(btn[0], {{ block.settings.links | json }})
509
+ {% else %}
510
+ // 监听点击事件
511
+ btn[0].addEventListener('click', (event) => {
512
+ event.preventDefault();
513
+ window.location.href = '{{ block.settings.url }}';
514
+ })
515
+ {% endif %}
516
+ }
517
+
518
+ })
519
+ </script>
520
+ {% endif %}