zz-shopify-components 0.0.21 → 0.0.22

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 (73) hide show
  1. package/CHANGELOG.md +21 -21
  2. package/README.md +56 -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/blocks/zz-accessories-item.liquid +188 -188
  18. package/blocks/zz-accessories-swiper.liquid +223 -223
  19. package/blocks/zz-button.liquid +216 -216
  20. package/blocks/zz-content-description-html.liquid +201 -201
  21. package/blocks/zz-content-description.liquid +209 -209
  22. package/blocks/zz-flex-layout-bg-block.liquid +524 -524
  23. package/blocks/zz-flex-layout-block.liquid +548 -548
  24. package/blocks/zz-flex-layout-widget.liquid +321 -321
  25. package/blocks/zz-full-screen-swiper.liquid +447 -447
  26. package/blocks/zz-icon.liquid +46 -46
  27. package/blocks/zz-mail.liquid +135 -135
  28. package/blocks/zz-mb-swiper-pc-flex.liquid +273 -273
  29. package/blocks/zz-price-tag-mini.liquid +100 -106
  30. package/blocks/zz-price-tag.liquid +41 -41
  31. package/blocks/zz-ratio-image.liquid +181 -181
  32. package/blocks/zz-ratio-video.liquid +115 -115
  33. package/blocks/zz-responsive-width-image.liquid +222 -222
  34. package/blocks/zz-responsive-width-video.liquid +166 -166
  35. package/blocks/zz-scroll-animate-bg-text.liquid +268 -268
  36. package/blocks/zz-scroll-cover.liquid +67 -67
  37. package/blocks/zz-tag.liquid +50 -50
  38. package/blocks/zz-text.liquid +227 -227
  39. package/blocks/zz-title.liquid +287 -287
  40. package/blocks/zz-video-button.liquid +84 -84
  41. package/blocks/zz-video-swiper-perview-item.liquid +221 -221
  42. package/blocks/zz-video-swiper-perview.liquid +585 -585
  43. package/component.config.json +7 -7
  44. package/package.json +1 -1
  45. package/scripts/postinstall-v1.js +39 -39
  46. package/scripts/postinstall-v2.js +47 -47
  47. package/scripts/postinstall-v3.js +51 -51
  48. package/scripts/publish-npm.js +43 -43
  49. package/sections/zz-flex-layout-section.liquid +269 -269
  50. package/sections/zz-navigation-tab-v3.liquid +407 -407
  51. package/sections/zz-navigation-tab.liquid +411 -411
  52. package/sections/zz-shopping-card-list.liquid +399 -399
  53. package/sections/zz-video-collapse-swiper.liquid +522 -522
  54. package/sections/zz-video-tab-swiper.liquid +748 -748
  55. package/snippets/zz-button.liquid +70 -70
  56. package/snippets/zz-content-h3.liquid +15 -15
  57. package/snippets/zz-content-text.liquid +56 -56
  58. package/snippets/zz-h2.liquid +31 -31
  59. package/snippets/zz-h3.liquid +31 -31
  60. package/snippets/zz-h4.liquid +30 -30
  61. package/snippets/zz-h5.liquid +39 -39
  62. package/snippets/zz-h6.liquid +39 -39
  63. package/snippets/zz-icon-next.liquid +17 -17
  64. package/snippets/zz-icon-prev.liquid +17 -17
  65. package/snippets/zz-icon.liquid +74 -74
  66. package/snippets/zz-img.liquid +44 -44
  67. package/snippets/zz-prev-next-btn.liquid +62 -62
  68. package/snippets/zz-price-tag.liquid +22 -22
  69. package/snippets/zz-spoke.liquid +142 -142
  70. package/snippets/zz-tag.liquid +22 -22
  71. package/snippets/zz-video-button.liquid +54 -54
  72. package/snippets/zz-video-md.liquid +117 -117
  73. package/snippets/zz-video.liquid +117 -117
@@ -1,142 +1,142 @@
1
- {% comment %}
2
- 背书
3
- bg_color: 背景色
4
- pc_image: pc 端图片/视频封面
5
- mb_image: 移动端图片/视频封面
6
- pc_video: pc 端视频
7
- mb_video: 移动端视频
8
- media_class: 图片/视频类名(设置高)
9
- pc_media_pos: pc 端视频位置 'top'|'bottom',默认 top
10
- mb_media_pos: 移动端视频位置 'top'|'bottom',默认 top
11
- class_name: 自定义类名(设置宽高)
12
-
13
- user_name: 用户名
14
- name_class: 名字类名(设置文字大小和颜色)
15
- user_account: 账号
16
- account_class: 账号类名
17
- user_avatar: 用户头像
18
- content: 内容
19
- content_class: 内容类名(设置文字大小和颜色)
20
-
21
- logo: 图标
22
- logo_class: 图标类名
23
- logo_alt: 图标 alt
24
- {% endcomment %}
25
-
26
- {% if pc_video != blank or pc_image != black %}
27
- {% assign only_content = false %}
28
- {% assign class_name = class_name
29
- | default: 'tw-w-[162px] tw-h-[271px] lg:tw-w-[351px] lg:tw-h-[550px]'
30
- %}
31
- {% if content != blank %}
32
- {% assign media_class = media_class
33
- | default: 'tw-h-[152px] lg:tw-h-[397px]'
34
- %}
35
- {% else %}
36
- {% assign media_class = media_class
37
- | default: 'tw-h-[221px] lg:tw-h-[468px]'
38
- %}
39
- {% endif %}
40
- {% else %}
41
- {% assign only_content = true %}
42
- {% assign class_name = class_name
43
- | default: 'tw-w-[162px] tw-h-[175px] lg:tw-w-[351px] lg:tw-h-[265px]'
44
- %}
45
- {% endif %}
46
-
47
- {% assign pc_media_pos = pc_media_pos | default: 'top' %}
48
- {% assign mb_media_pos = mb_media_pos | default: 'top' %}
49
- {% assign bg_color = bg_color | default: 'rgba(255,255,255,0.1)' %}
50
- {% assign name_class = name_class
51
- | default: 'max-lg:tw-text-[10px] lg:tw-text-[14px] tw-text-white'
52
- %}
53
- {% assign account_class = account_class | default: 'tw-opacity-50' %}
54
- {% assign content_class = content_class
55
- | default: 'max-lg:tw-text-[9px] lg:tw-text-[14px] tw-tracking-[0.01] tw-text-white'
56
- %}
57
- {% assign logo_class = logo_class | default: 'tw-w-[39px] lg:tw-w-[45px]' %}
58
-
59
- <div class='zz-spoke-block tw-relative tw-flex {% if pc_media_pos == 'top' %}lg:tw-flex-col {% else %}lg:tw-flex-col-reverse {% endif %} {% if mb_media_pos == 'top' %}max-lg:tw-flex-col {% else %}max-lg:tw-flex-col-reverse {% endif %} tw-rounded-[10px] lg:tw-rounded-[16px] tw-overflow-hidden tw-justify-between {{ class_name }}'>
60
- {% if only_content == false %}
61
- {% comment %} 视频/图片 {% endcomment %}
62
- <div
63
- class='zz-spoke-block-media tw-w-full {{media_class}}'
64
- >
65
- {% if pc_video != blank %}
66
- {% render 'zz-video',
67
- pc_video: pc_video,
68
- pc_poster: pc_image,
69
- mb_video: mb_video,
70
- mb_poster: mb_image,
71
- pc_posterWidth: 700,
72
- mb_poster_width: 480,
73
- class: 'click-video-play-pause tw-w-full tw-h-full tw-cursor-pointer tw-object-cover'
74
- %}
75
- {% else %}
76
- {% render 'zz-img',
77
- pc_image: pc_image,
78
- mb_image: mb_image,
79
- image_alt: image_alt,
80
- pc_width: 700,
81
- mb_width: 480
82
- %}
83
- {% endif %}
84
- {% comment %}
85
- {% if user_intro != blank %}
86
- <div class='tw-absolute tw-left-0 tw-right-0 tw-bottom-0 lg:tw-top-0'>
87
- <div class='max-lg:tw-text-[12px] lg:tw-text-[14px] tw-leading-[1.2] tw-font-bold tw-text-white'>
88
- {{ user_name | upcase }}
89
- </div>
90
- <div class='tw-mt-[4px] max-lg:tw-text-[10px] lg:tw-text-[14px] tw-font-medium tw-text-white/70 lg:tw-text-white/60'>
91
- {{ user_intro | upcase }}
92
- </div>
93
- </div>
94
- {% endif %}
95
- {% endcomment %}
96
- </div>
97
- {% endif %}
98
- <div class='zz-spoke-block-content tw-relative tw-p-[10px] tw-pr-[0px] lg:tw-pl-[24px] lg:tw-pr-[30px] lg:tw-py-[20px] tw-w-full tw-h-fit tw-rounded-[10px] lg:tw-rounded-[16px] tw-overflow-hidden {% if only_content %}tw-pb-[32px] lg:tw-pb-[40px] {% else %}tw-pb-[10px] lg:tw-pb-[20px]{% endif %}'>
99
- <div class='tw-flex tw-items-center'>
100
- <div class='tw-w-[20px] tw-min-w-[20px] tw-h-[20px] lg:tw-w-[36px] lg:tw-min-w-[36px] lg:tw-h-[36px]'>
101
- {% render 'zz-img',
102
- pc_image: user_avatar,
103
- mb_image: user_avatar,
104
- image_alt: user_name,
105
- pc_width: 72,
106
- mb_width: 60
107
- %}
108
- </div>
109
- <div class='tw-ml-[10px] tw-leading-[1.5] tw-font-bold {{ name_class }}'>
110
- {{ user_name }}
111
- <span class='tw-block tw-font-medium tw-leading-[1.5] {{ account_class }}'>
112
- {{- user_account -}}
113
- </span>
114
- </div>
115
- </div>
116
- {% if content != blank %}
117
- <div class='tw-mt-[8px] lg:tw-mt-[14px] tw-leading-[1.5] {{ content_class }}'>
118
- {{ content }}
119
- </div>
120
- {% endif %}
121
- </div>
122
- {% if logo != blank %}
123
- <div class='tw-absolute tw-left-[50%] -tw-translate-x-[50%] tw-bottom-[10px] {{ logo_class }}'>
124
- {% render 'zz-img',
125
- pc_image: logo,
126
- mb_image: logo,
127
- image_alt: logo_alt,
128
- pc_width: 120,
129
- mb_width: 120
130
- %}
131
- </div>
132
- {% endif %}
133
- </div>
134
-
135
- <style>
136
- .zz-spoke-block {
137
- background-color: {{ bg_color }};
138
- }
139
- .zz-spoke-block p {
140
- margin: 0;
141
- }
142
- </style>
1
+ {% comment %}
2
+ 背书
3
+ bg_color: 背景色
4
+ pc_image: pc 端图片/视频封面
5
+ mb_image: 移动端图片/视频封面
6
+ pc_video: pc 端视频
7
+ mb_video: 移动端视频
8
+ media_class: 图片/视频类名(设置高)
9
+ pc_media_pos: pc 端视频位置 'top'|'bottom',默认 top
10
+ mb_media_pos: 移动端视频位置 'top'|'bottom',默认 top
11
+ class_name: 自定义类名(设置宽高)
12
+
13
+ user_name: 用户名
14
+ name_class: 名字类名(设置文字大小和颜色)
15
+ user_account: 账号
16
+ account_class: 账号类名
17
+ user_avatar: 用户头像
18
+ content: 内容
19
+ content_class: 内容类名(设置文字大小和颜色)
20
+
21
+ logo: 图标
22
+ logo_class: 图标类名
23
+ logo_alt: 图标 alt
24
+ {% endcomment %}
25
+
26
+ {% if pc_video != blank or pc_image != black %}
27
+ {% assign only_content = false %}
28
+ {% assign class_name = class_name
29
+ | default: 'tw-w-[162px] tw-h-[271px] lg:tw-w-[351px] lg:tw-h-[550px]'
30
+ %}
31
+ {% if content != blank %}
32
+ {% assign media_class = media_class
33
+ | default: 'tw-h-[152px] lg:tw-h-[397px]'
34
+ %}
35
+ {% else %}
36
+ {% assign media_class = media_class
37
+ | default: 'tw-h-[221px] lg:tw-h-[468px]'
38
+ %}
39
+ {% endif %}
40
+ {% else %}
41
+ {% assign only_content = true %}
42
+ {% assign class_name = class_name
43
+ | default: 'tw-w-[162px] tw-h-[175px] lg:tw-w-[351px] lg:tw-h-[265px]'
44
+ %}
45
+ {% endif %}
46
+
47
+ {% assign pc_media_pos = pc_media_pos | default: 'top' %}
48
+ {% assign mb_media_pos = mb_media_pos | default: 'top' %}
49
+ {% assign bg_color = bg_color | default: 'rgba(255,255,255,0.1)' %}
50
+ {% assign name_class = name_class
51
+ | default: 'max-lg:tw-text-[10px] lg:tw-text-[14px] tw-text-white'
52
+ %}
53
+ {% assign account_class = account_class | default: 'tw-opacity-50' %}
54
+ {% assign content_class = content_class
55
+ | default: 'max-lg:tw-text-[9px] lg:tw-text-[14px] tw-tracking-[0.01] tw-text-white'
56
+ %}
57
+ {% assign logo_class = logo_class | default: 'tw-w-[39px] lg:tw-w-[45px]' %}
58
+
59
+ <div class='zz-spoke-block tw-relative tw-flex {% if pc_media_pos == 'top' %}lg:tw-flex-col {% else %}lg:tw-flex-col-reverse {% endif %} {% if mb_media_pos == 'top' %}max-lg:tw-flex-col {% else %}max-lg:tw-flex-col-reverse {% endif %} tw-rounded-[10px] lg:tw-rounded-[16px] tw-overflow-hidden tw-justify-between {{ class_name }}'>
60
+ {% if only_content == false %}
61
+ {% comment %} 视频/图片 {% endcomment %}
62
+ <div
63
+ class='zz-spoke-block-media tw-w-full {{media_class}}'
64
+ >
65
+ {% if pc_video != blank %}
66
+ {% render 'zz-video',
67
+ pc_video: pc_video,
68
+ pc_poster: pc_image,
69
+ mb_video: mb_video,
70
+ mb_poster: mb_image,
71
+ pc_posterWidth: 700,
72
+ mb_poster_width: 480,
73
+ class: 'click-video-play-pause tw-w-full tw-h-full tw-cursor-pointer tw-object-cover'
74
+ %}
75
+ {% else %}
76
+ {% render 'zz-img',
77
+ pc_image: pc_image,
78
+ mb_image: mb_image,
79
+ image_alt: image_alt,
80
+ pc_width: 700,
81
+ mb_width: 480
82
+ %}
83
+ {% endif %}
84
+ {% comment %}
85
+ {% if user_intro != blank %}
86
+ <div class='tw-absolute tw-left-0 tw-right-0 tw-bottom-0 lg:tw-top-0'>
87
+ <div class='max-lg:tw-text-[12px] lg:tw-text-[14px] tw-leading-[1.2] tw-font-bold tw-text-white'>
88
+ {{ user_name | upcase }}
89
+ </div>
90
+ <div class='tw-mt-[4px] max-lg:tw-text-[10px] lg:tw-text-[14px] tw-font-medium tw-text-white/70 lg:tw-text-white/60'>
91
+ {{ user_intro | upcase }}
92
+ </div>
93
+ </div>
94
+ {% endif %}
95
+ {% endcomment %}
96
+ </div>
97
+ {% endif %}
98
+ <div class='zz-spoke-block-content tw-relative tw-p-[10px] tw-pr-[0px] lg:tw-pl-[24px] lg:tw-pr-[30px] lg:tw-py-[20px] tw-w-full tw-h-fit tw-rounded-[10px] lg:tw-rounded-[16px] tw-overflow-hidden {% if only_content %}tw-pb-[32px] lg:tw-pb-[40px] {% else %}tw-pb-[10px] lg:tw-pb-[20px]{% endif %}'>
99
+ <div class='tw-flex tw-items-center'>
100
+ <div class='tw-w-[20px] tw-min-w-[20px] tw-h-[20px] lg:tw-w-[36px] lg:tw-min-w-[36px] lg:tw-h-[36px]'>
101
+ {% render 'zz-img',
102
+ pc_image: user_avatar,
103
+ mb_image: user_avatar,
104
+ image_alt: user_name,
105
+ pc_width: 72,
106
+ mb_width: 60
107
+ %}
108
+ </div>
109
+ <div class='tw-ml-[10px] tw-leading-[1.5] tw-font-bold {{ name_class }}'>
110
+ {{ user_name }}
111
+ <span class='tw-block tw-font-medium tw-leading-[1.5] {{ account_class }}'>
112
+ {{- user_account -}}
113
+ </span>
114
+ </div>
115
+ </div>
116
+ {% if content != blank %}
117
+ <div class='tw-mt-[8px] lg:tw-mt-[14px] tw-leading-[1.5] {{ content_class }}'>
118
+ {{ content }}
119
+ </div>
120
+ {% endif %}
121
+ </div>
122
+ {% if logo != blank %}
123
+ <div class='tw-absolute tw-left-[50%] -tw-translate-x-[50%] tw-bottom-[10px] {{ logo_class }}'>
124
+ {% render 'zz-img',
125
+ pc_image: logo,
126
+ mb_image: logo,
127
+ image_alt: logo_alt,
128
+ pc_width: 120,
129
+ mb_width: 120
130
+ %}
131
+ </div>
132
+ {% endif %}
133
+ </div>
134
+
135
+ <style>
136
+ .zz-spoke-block {
137
+ background-color: {{ bg_color }};
138
+ }
139
+ .zz-spoke-block p {
140
+ margin: 0;
141
+ }
142
+ </style>
@@ -1,22 +1,22 @@
1
- {% comment %}
2
- tag: 标签
3
- tag_bg_color_gradient: 标签背景颜色渐变
4
- tag_bg_color: 标签背景颜色
5
- tag_color: 标签颜色
6
- class_name: 增加类名
7
- {% endcomment %}
8
-
9
- {%- capture tag_bg_color -%}
10
- {%- if tag_bg_color_gradient != blank %}
11
- {{ tag_bg_color_gradient }}
12
- {%- else -%}
13
- {{ tag_bg_color }}
14
- {%- endif %}
15
- {%- endcapture %}
16
- {% assign tag_color = tag_color %}
17
- <div
18
- class='{{ class_name }} zz-tag tw-z-[1] tw-w-fit tw-relative tw-italic tw-font-bold max-lg:tw-h-[24px] tw-text-[16px] tw-leading-[24px] tw-px-[16px] lg:tw-h-[32px] lg:tw-text-[20px] lg:tw-px-[28px] lg:tw-leading-[32px]'
19
- style='color: {{ tag_color }}; --zz-tag-bg-color: {{ tag_bg_color }};'
20
- >
21
- {{ tag }}
22
- </div>
1
+ {% comment %}
2
+ tag: 标签
3
+ tag_bg_color_gradient: 标签背景颜色渐变
4
+ tag_bg_color: 标签背景颜色
5
+ tag_color: 标签颜色
6
+ class_name: 增加类名
7
+ {% endcomment %}
8
+
9
+ {%- capture tag_bg_color -%}
10
+ {%- if tag_bg_color_gradient != blank %}
11
+ {{ tag_bg_color_gradient }}
12
+ {%- else -%}
13
+ {{ tag_bg_color }}
14
+ {%- endif %}
15
+ {%- endcapture %}
16
+ {% assign tag_color = tag_color %}
17
+ <div
18
+ class='{{ class_name }} zz-tag tw-z-[1] tw-w-fit tw-relative tw-italic tw-font-bold max-lg:tw-h-[24px] tw-text-[16px] tw-leading-[24px] tw-px-[16px] lg:tw-h-[32px] lg:tw-text-[20px] lg:tw-px-[28px] lg:tw-leading-[32px]'
19
+ style='color: {{ tag_color }}; --zz-tag-bg-color: {{ tag_bg_color }};'
20
+ >
21
+ {{ tag }}
22
+ </div>
@@ -1,55 +1,55 @@
1
-
2
- {% comment %}
3
- video: 视频
4
- poster: 封面
5
- color:按钮颜色
6
- - black:黑色
7
- - white:白色
8
- - orange:橙色
9
-
10
- size:按钮尺寸
11
- - large:大号
12
- - medium:中号(默认)
13
- - small:小号
14
-
15
- 其他参数:
16
- - href:链接地址
17
- - icon:图标名称
18
- - text:按钮文字
19
- - class_name:自定义类名
20
- {% endcomment %}
21
-
22
- <zz-video-button>
23
-
24
- {% assign btn_class_name = class_name | append: ' togglePopup' %}
25
- {% render 'zz-button',
26
- type: 'default',
27
- color: color,
28
- text: text,
29
- size: size,
30
- backdrop_filter: true,
31
- class_name: btn_class_name,
32
- icon: '<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
33
- <path fill-rule="evenodd" clip-rule="evenodd" d="M13.635 6.42979C14.5112 6.91507 14.5112 8.08492 13.635 8.57021L6.84517 12.331C5.94149 12.8315 4.79058 12.232 4.79058 11.2608L4.79058 3.73925C4.79058 2.768 5.94148 2.16851 6.84517 2.66904L13.635 6.42979Z" fill="white"/>
34
- </svg>
35
- '
36
- %}
37
-
38
- <div
39
- class='togglePopup popup tw-flex !tw-hidden tw-bg-[rgba(0,0,0,0.9)] tw-items-center tw-justify-center tw-fixed tw-top-0 tw-left-0 tw-right-0 tw-bottom-0 tw-z-[999] tw-overflow-hidden'
40
- >
41
- <div class="tw-max-w-[960px]">
42
- {% render 'zz-video',
43
- pc_video: video,
44
- pc_poster: poster,
45
- lazy: false,
46
- class: ' tw-w-full tw-h-auto',
47
- autoplay: false,
48
- loop: true,
49
- %}
50
-
51
- </div>
52
-
53
- </div>
54
- </zz-video-button>
1
+
2
+ {% comment %}
3
+ video: 视频
4
+ poster: 封面
5
+ color:按钮颜色
6
+ - black:黑色
7
+ - white:白色
8
+ - orange:橙色
9
+
10
+ size:按钮尺寸
11
+ - large:大号
12
+ - medium:中号(默认)
13
+ - small:小号
14
+
15
+ 其他参数:
16
+ - href:链接地址
17
+ - icon:图标名称
18
+ - text:按钮文字
19
+ - class_name:自定义类名
20
+ {% endcomment %}
21
+
22
+ <zz-video-button>
23
+
24
+ {% assign btn_class_name = class_name | append: ' togglePopup' %}
25
+ {% render 'zz-button',
26
+ type: 'default',
27
+ color: color,
28
+ text: text,
29
+ size: size,
30
+ backdrop_filter: true,
31
+ class_name: btn_class_name,
32
+ icon: '<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
33
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M13.635 6.42979C14.5112 6.91507 14.5112 8.08492 13.635 8.57021L6.84517 12.331C5.94149 12.8315 4.79058 12.232 4.79058 11.2608L4.79058 3.73925C4.79058 2.768 5.94148 2.16851 6.84517 2.66904L13.635 6.42979Z" fill="white"/>
34
+ </svg>
35
+ '
36
+ %}
37
+
38
+ <div
39
+ class='togglePopup popup tw-flex !tw-hidden tw-bg-[rgba(0,0,0,0.9)] tw-items-center tw-justify-center tw-fixed tw-top-0 tw-left-0 tw-right-0 tw-bottom-0 tw-z-[999] tw-overflow-hidden'
40
+ >
41
+ <div class="tw-max-w-[960px]">
42
+ {% render 'zz-video',
43
+ pc_video: video,
44
+ pc_poster: poster,
45
+ lazy: false,
46
+ class: ' tw-w-full tw-h-auto',
47
+ autoplay: false,
48
+ loop: true,
49
+ %}
50
+
51
+ </div>
52
+
53
+ </div>
54
+ </zz-video-button>
55
55
 
@@ -1,117 +1,117 @@
1
- {% comment %}
2
- pc_video: 视频地址
3
- pc_poster: 视频封面
4
- mb_video: 视频地址
5
- mb_poster: 视频封面
6
- lazy: 是否懒加载
7
- pc_posterWidth: 视频封面宽度
8
- mb_poster_width: 视频封面宽度
9
- class: 视频类名
10
- autoplay: 是否自动播放
11
- loop: 是否循环播放
12
- muted: 是否静音
13
- separate_display: 区分显示pc还是mb, true时 没有配置PC与mb将不会显示。不会使用PC的配置来配置mb
14
- {% endcomment %}
15
-
16
- {% if separate_display == true %}
17
- {% assign separate_display = true %}
18
- {% else %}
19
- {% assign separate_display = false %}
20
- {% endif %}
21
-
22
- {% if pc_video and pc_poster %}
23
- {% assign pc_src = pc_video %}
24
- {% if pc_video.media_type == 'video' %}
25
- {% assign pc_src = pc_video.sources[1].url %}
26
- {% endif %}
27
-
28
- {% assign video_poster_width = pc_posterWidth | default: 1500 %}
29
- {% assign video_poster = pc_poster
30
- | image_url: width: video_poster_width
31
- %}
32
- <video
33
- {% if class %}
34
- class='{{class}} lozad zz-video {% if autoplay %} video-play-pause {% endif %} {% if mb_video != blank and separate_display == false %} max-md:tw-hidden {% endif %}'
35
- {% endif %}
36
- {% if autoplay %}
37
- autoplay
38
- {% endif %}
39
- {% if loop %}
40
- loop
41
- {% endif %}
42
- {% if muted %}
43
- muted
44
- {% endif %}
45
- {% if controls %}
46
- controls
47
- {% endif %}
48
- {% if lazy %}
49
- data-poster='{{video_poster | default: ''}}'
50
- {% else %}
51
- poster='{{video_poster | default: ''}}'
52
- {% endif %}
53
- webkit-playsinline
54
- playsinline
55
- x5-video-player-type='h5'
56
-
57
- >
58
- <source type='video/mp4'
59
- data-src='{{pc_src}}'
60
- {% if lazy %}
61
- data-src='{{pc_src}}'
62
- {% else %}
63
- src='{{ pc_src }}'
64
- {% endif %}
65
- >
66
-
67
- </video>
68
- {% endif %}
69
-
70
- {% if mb_video and mb_poster %}
71
- {% assign mb_src = mb_video %}
72
- {% if mb_video.media_type == 'video' %}
73
- {% assign mb_src = mb_video.sources[1].url %}
74
- {% endif %}
75
-
76
- {% assign mb_video_poster_width = mb_poster_width | default: 1500 %}
77
- {% assign mb_video_poster = mb_poster
78
- | image_url: width: mb_video_poster_width
79
- %}
80
- <video
81
- {% if class %}
82
- class='{{class}} lozad zz-video {% if autoplay %} video-play-pause {% endif %} md:tw-hidden'
83
- {% endif %}
84
- {% if autoplay %}
85
- autoplay
86
- {% endif %}
87
- {% if loop %}
88
- loop
89
- {% endif %}
90
- {% if muted %}
91
- muted
92
- {% endif %}
93
- {% if controls %}
94
- controls
95
- {% endif %}
96
- {% if lazy %}
97
- data-poster='{{mb_video_poster | default: ''}}'
98
- {% else %}
99
- poster='{{mb_video_poster | default: ''}}'
100
- {% endif %}
101
- webkit-playsinline
102
- playsinline
103
- x5-video-player-type='h5'
104
-
105
- >
106
- <source type='video/mp4'
107
- data-src='{{mb_src}}'
108
- {% if lazy %}
109
- data-src='{{mb_src}}'
110
- {% else %}
111
- src='{{ mb_src }}'
112
- {% endif %}
113
- >
114
-
115
- </video>
116
- {% endif %}
117
-
1
+ {% comment %}
2
+ pc_video: 视频地址
3
+ pc_poster: 视频封面
4
+ mb_video: 视频地址
5
+ mb_poster: 视频封面
6
+ lazy: 是否懒加载
7
+ pc_posterWidth: 视频封面宽度
8
+ mb_poster_width: 视频封面宽度
9
+ class: 视频类名
10
+ autoplay: 是否自动播放
11
+ loop: 是否循环播放
12
+ muted: 是否静音
13
+ separate_display: 区分显示pc还是mb, true时 没有配置PC与mb将不会显示。不会使用PC的配置来配置mb
14
+ {% endcomment %}
15
+
16
+ {% if separate_display == true %}
17
+ {% assign separate_display = true %}
18
+ {% else %}
19
+ {% assign separate_display = false %}
20
+ {% endif %}
21
+
22
+ {% if pc_video and pc_poster %}
23
+ {% assign pc_src = pc_video %}
24
+ {% if pc_video.media_type == 'video' %}
25
+ {% assign pc_src = pc_video.sources[1].url %}
26
+ {% endif %}
27
+
28
+ {% assign video_poster_width = pc_posterWidth | default: 1500 %}
29
+ {% assign video_poster = pc_poster
30
+ | image_url: width: video_poster_width
31
+ %}
32
+ <video
33
+ {% if class %}
34
+ class='{{class}} lozad zz-video {% if autoplay %} video-play-pause {% endif %} {% if mb_video != blank and separate_display == false %} max-md:tw-hidden {% endif %}'
35
+ {% endif %}
36
+ {% if autoplay %}
37
+ autoplay
38
+ {% endif %}
39
+ {% if loop %}
40
+ loop
41
+ {% endif %}
42
+ {% if muted %}
43
+ muted
44
+ {% endif %}
45
+ {% if controls %}
46
+ controls
47
+ {% endif %}
48
+ {% if lazy %}
49
+ data-poster='{{video_poster | default: ''}}'
50
+ {% else %}
51
+ poster='{{video_poster | default: ''}}'
52
+ {% endif %}
53
+ webkit-playsinline
54
+ playsinline
55
+ x5-video-player-type='h5'
56
+
57
+ >
58
+ <source type='video/mp4'
59
+ data-src='{{pc_src}}'
60
+ {% if lazy %}
61
+ data-src='{{pc_src}}'
62
+ {% else %}
63
+ src='{{ pc_src }}'
64
+ {% endif %}
65
+ >
66
+
67
+ </video>
68
+ {% endif %}
69
+
70
+ {% if mb_video and mb_poster %}
71
+ {% assign mb_src = mb_video %}
72
+ {% if mb_video.media_type == 'video' %}
73
+ {% assign mb_src = mb_video.sources[1].url %}
74
+ {% endif %}
75
+
76
+ {% assign mb_video_poster_width = mb_poster_width | default: 1500 %}
77
+ {% assign mb_video_poster = mb_poster
78
+ | image_url: width: mb_video_poster_width
79
+ %}
80
+ <video
81
+ {% if class %}
82
+ class='{{class}} lozad zz-video {% if autoplay %} video-play-pause {% endif %} md:tw-hidden'
83
+ {% endif %}
84
+ {% if autoplay %}
85
+ autoplay
86
+ {% endif %}
87
+ {% if loop %}
88
+ loop
89
+ {% endif %}
90
+ {% if muted %}
91
+ muted
92
+ {% endif %}
93
+ {% if controls %}
94
+ controls
95
+ {% endif %}
96
+ {% if lazy %}
97
+ data-poster='{{mb_video_poster | default: ''}}'
98
+ {% else %}
99
+ poster='{{mb_video_poster | default: ''}}'
100
+ {% endif %}
101
+ webkit-playsinline
102
+ playsinline
103
+ x5-video-player-type='h5'
104
+
105
+ >
106
+ <source type='video/mp4'
107
+ data-src='{{mb_src}}'
108
+ {% if lazy %}
109
+ data-src='{{mb_src}}'
110
+ {% else %}
111
+ src='{{ mb_src }}'
112
+ {% endif %}
113
+ >
114
+
115
+ </video>
116
+ {% endif %}
117
+