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,48 @@
1
+
2
+ {% schema %}
3
+ {
4
+ "name": "ZZ Tag",
5
+ "class": "zz-tag",
6
+ "settings": [
7
+ {
8
+ "type": "text",
9
+ "id": "tag",
10
+ "label": "标签"
11
+ },
12
+ {
13
+ "type": "color",
14
+ "id": "tag_color",
15
+ "label": "标签文字颜色",
16
+ "default": "#000000"
17
+ },
18
+ {
19
+ "type": "color",
20
+ "id": "tag_bg_color",
21
+ "label": "标签背景颜色",
22
+ "default": "#FF7700"
23
+ },
24
+ {
25
+ "type": "color_background",
26
+ "id": "tag_bg_color_gradient",
27
+ "label": "标签背景颜色(渐变)",
28
+ "default": "linear-gradient(to right, #FF7700, #FFC081)"
29
+ }
30
+
31
+ ],
32
+ "presets": [
33
+ {
34
+ "name": "标签",
35
+ "settings": {
36
+ "tag": "HEM ™"
37
+ }
38
+ }
39
+ ],
40
+ }
41
+ {% endschema %}
42
+
43
+ {% render 'zz-tag',
44
+ tag_bg_color_gradient: block.settings.tag_bg_color_gradient,
45
+ tag_bg_color: block.settings.tag_bg_color,
46
+ tag_color: block.settings.tag_color,
47
+ tag: block.settings.tag
48
+ %}
@@ -0,0 +1,225 @@
1
+ {% schema %}
2
+ {
3
+ "name": "One Line Text",
4
+ "class": "zz-line-text",
5
+ "settings": [
6
+ {
7
+ "type": "text",
8
+ "id": "text_content",
9
+ "label": "Text Content",
10
+ "default": "Enter your content here"
11
+ },
12
+ {
13
+ "type": "color",
14
+ "id": "text_color",
15
+ "label": "Text Color",
16
+ "default": "#000000"
17
+ },
18
+ {
19
+ "type": "select",
20
+ "id": "font_weight",
21
+ "label": "Font Weight",
22
+ "options": [
23
+ {
24
+ "value": "400",
25
+ "label": "Regular"
26
+ },
27
+ {
28
+ "value": "500",
29
+ "label": "Medium"
30
+ },
31
+ {
32
+ "value": "600",
33
+ "label": "Semi Bold"
34
+ },
35
+ {
36
+ "value": "700",
37
+ "label": "Bold"
38
+ }
39
+ ],
40
+ "default": "400"
41
+ },
42
+
43
+ {
44
+ "type": "header",
45
+ "content": "PC Settings"
46
+ },
47
+ {
48
+ "type": "range",
49
+ "id": "pc_font_size",
50
+ "min": 12,
51
+ "max": 48,
52
+ "step": 1,
53
+ "unit": "px",
54
+ "label": "PC Font Size",
55
+ "default": 16
56
+ },
57
+
58
+ {
59
+ "type": "select",
60
+ "id": "pc_text_align",
61
+ "label": "PC Text Alignment",
62
+ "options": [
63
+ {
64
+ "value": "left",
65
+ "label": "Left"
66
+ },
67
+ {
68
+ "value": "center",
69
+ "label": "Center"
70
+ },
71
+ {
72
+ "value": "right",
73
+ "label": "Right"
74
+ }
75
+ ],
76
+ "default": "left"
77
+ },
78
+
79
+ {
80
+ "type": "header",
81
+ "content": "Mobile Settings"
82
+ },
83
+ {
84
+ "type": "range",
85
+ "id": "mobile_font_size",
86
+ "min": 8,
87
+ "max": 36,
88
+ "step": 1,
89
+ "unit": "px",
90
+ "label": "Mobile Font Size",
91
+ "default": 12
92
+ },
93
+ {
94
+ "type": "select",
95
+ "id": "mobile_text_align",
96
+ "label": "Mobile Text Alignment",
97
+ "options": [
98
+ {
99
+ "value": "left",
100
+ "label": "Left"
101
+ },
102
+ {
103
+ "value": "center",
104
+ "label": "Center"
105
+ },
106
+ {
107
+ "value": "right",
108
+ "label": "Right"
109
+ }
110
+ ],
111
+ "default": "left"
112
+ },
113
+
114
+ {
115
+ "type": "checkbox",
116
+ "id": "use_margin",
117
+ "label": "是否设置上下外边距",
118
+ "default": false
119
+ },
120
+ {
121
+ "type": "number",
122
+ "id": "mobile_margin_top",
123
+ "label": "移动上外边距 (Margin Top)",
124
+ "default": 0,
125
+ "visible_if": "{{ block.settings.use_margin == true }}"
126
+ },
127
+ {
128
+ "type": "number",
129
+ "id": "mobile_margin_bottom",
130
+ "label": "移动下外边距 (Margin Bottom)",
131
+ "default": 0,
132
+ "visible_if": "{{ block.settings.use_margin == true }}"
133
+ },
134
+ {
135
+ "type": "number",
136
+ "id": "pc_margin_top",
137
+ "label": "PC上外边距 (Margin Top)",
138
+ "default": 0,
139
+ "visible_if": "{{ block.settings.use_margin == true }}"
140
+ },
141
+ {
142
+ "type": "number",
143
+ "id": "pc_margin_bottom",
144
+ "label": "PC下外边距 (Margin Bottom)",
145
+ "default": 0,
146
+ "visible_if": "{{ block.settings.use_margin == true }}"
147
+ },
148
+ {
149
+ "type": "checkbox",
150
+ "id": "has_background",
151
+ "label": "是否作为背景标签",
152
+ "default": false
153
+ },
154
+ {
155
+ "type": "color_background",
156
+ "id": "background_color",
157
+ "label": "背景颜色",
158
+ "default": "rgba(0,0,0,0)",
159
+ "visible_if": "{{ block.settings.has_background == true }}"
160
+ },
161
+ {
162
+ "type": "number",
163
+ "id": "border_radius",
164
+ "label": "圆角",
165
+ "default": 10,
166
+ "info": "单位:px",
167
+ "visible_if": "{{ block.settings.has_background == true }}"
168
+ },
169
+ ],
170
+ "presets": [
171
+ {
172
+ "name": "一行文案",
173
+ "settings": {
174
+ "text_content": "一行文案",
175
+ "pc_font_size": 16,
176
+ "text_color": "#333333",
177
+ "pc_text_align": "left",
178
+ "mobile_font_size": 14,
179
+ "mobile_text_align": "left"
180
+ }
181
+ }
182
+ ]
183
+ }
184
+ {% endschema %}
185
+
186
+ {% render 'zz-content-text',
187
+ text: block.settings.text_content,
188
+ mb_text: block.settings.text_content,
189
+ text_color: block.settings.text_color,
190
+ pc_font_size: block.settings.pc_font_size,
191
+ mobile_font_size: block.settings.mobile_font_size,
192
+ pc_text_align: block.settings.pc_text_align,
193
+ mobile_text_align: block.settings.mobile_text_align,
194
+ font_weight: block.settings.font_weight,
195
+ class_name: block.settings.animation
196
+ %}
197
+
198
+ {% if block.settings.use_margin %}
199
+ <style>
200
+ #shopify-block-{{ block.id }} {
201
+ margin-top: {{ block.settings.mobile_margin_top }}px;
202
+ margin-bottom: {{ block.settings.mobile_margin_bottom }}px;
203
+ }
204
+ @media (min-width: 1024px) {
205
+ #shopify-block-{{ block.id }} {
206
+ margin-top: {{ block.settings.pc_margin_top }}px;
207
+ margin-bottom: {{ block.settings.pc_margin_bottom }}px;
208
+ }
209
+ }
210
+
211
+ </style>
212
+ {% endif %}
213
+
214
+ {% if block.settings.has_background %}
215
+ <style>
216
+ #shopify-block-{{ block.id }} {
217
+ background-color: {{ block.settings.background_color }};
218
+ border-radius: {{ block.settings.border_radius }}px;
219
+ display:flex;
220
+ align-items:center;
221
+ justify-content:center;
222
+ padding: 6px 16px;
223
+ }
224
+ </style>
225
+ {% endif %}
@@ -0,0 +1,284 @@
1
+ {% schema %}
2
+ {
3
+ "name": "Title",
4
+ "class": "zz-title",
5
+ "settings": [
6
+ {
7
+ "type": "richtext",
8
+ "id": "pc_title",
9
+ "label": "PC标题内容 (PC Title Content)",
10
+ "default": "<p>这里是标题</p>"
11
+ },
12
+ {
13
+ "type": "richtext",
14
+ "id": "mb_title",
15
+ "label": "移动标题内容 (Mobile Title Content)",
16
+
17
+ },
18
+ {
19
+ "type": "select",
20
+ "id": "tag",
21
+ "label": "标题等级 (Heading Tag)",
22
+ "options": [
23
+ { "value": "h2", "label": "二级标题 (H2)" },
24
+ { "value": "h3", "label": "三级标题 (H3)" },
25
+ { "value": "h4", "label": "四级标题 (H4)" },
26
+ { "value": "h5", "label": "五级标题 (H5)" },
27
+ { "value": "h6", "label": "六级标题 (H6)" },
28
+ ],
29
+ "default": "h2"
30
+ },
31
+ {
32
+ "type": "select",
33
+ "id": "pc_font_weight",
34
+ "label": "PC Font Weight",
35
+ "options": [
36
+ { "value": "default", "label": "默认" },
37
+ { "value": "custom", "label": "自定义" }
38
+ ],
39
+ "default": "default"
40
+ },
41
+ {
42
+ "type": "range",
43
+ "id": "pc_font_weight_custom",
44
+ "label": "PC Font Weight Custom",
45
+ "min": 100,
46
+ "max": 900,
47
+ "step": 100,
48
+ "default": 700,
49
+ "visible_if": "{{ block.settings.pc_font_weight == 'custom' }}"
50
+ },
51
+ {
52
+ "type": "checkbox",
53
+ "id": "italic",
54
+ "label": "是否斜体 (Italic)",
55
+ "default": false
56
+ },
57
+
58
+ {
59
+ "type": "color",
60
+ "id": "text_color",
61
+ "label": "文字颜色",
62
+ "default": "#000000"
63
+ },
64
+ {
65
+ "type": "text",
66
+ "id": "text_gradient",
67
+ "label": "文字渐变 (可选)"
68
+ },
69
+ {
70
+ "type": "header",
71
+ "content": "💻 PC 样式设置"
72
+ },
73
+
74
+ {
75
+ "type": "select",
76
+ "id": "pc_align",
77
+ "label": "PC对齐方式 (Text Align)",
78
+ "options": [
79
+ { "value": "left", "label": "左对齐 (Left)" },
80
+ { "value": "center", "label": "居中对齐 (Center)" },
81
+ { "value": "right", "label": "右对齐 (Right)" }
82
+ ],
83
+ "default": "left"
84
+ },
85
+ {
86
+ "type": "number",
87
+ "id": "pc_margin_top",
88
+ "label": "PC上外边距 (Margin Top)",
89
+ "default": 0
90
+ },
91
+ {
92
+ "type": "number",
93
+ "id": "pc_margin_bottom",
94
+ "label": "PC下外边距 (Margin Bottom)",
95
+ "default": 0
96
+ },
97
+ {
98
+ "type": "header",
99
+ "content": "📱 移动端样式设置"
100
+ },
101
+
102
+ {
103
+ "type": "select",
104
+ "id": "mobile_align",
105
+ "label": "移动对齐方式 (Text Align)",
106
+ "options": [
107
+ { "value": "left", "label": "左对齐 (Left)" },
108
+ { "value": "center", "label": "居中对齐 (Center)" },
109
+ { "value": "right", "label": "右对齐 (Right)" }
110
+ ],
111
+ "default": "left"
112
+ },
113
+ {
114
+ "type": "number",
115
+ "id": "mobile_margin_top",
116
+ "label": "移动上外边距 (Margin Top)",
117
+ "default": 0
118
+ },
119
+ {
120
+ "type": "number",
121
+ "id": "mobile_margin_bottom",
122
+ "label": "移动下外边距 (Margin Bottom)",
123
+ "default": 0
124
+ },
125
+ {
126
+ "type": "checkbox",
127
+ "id": "mb_special_settings",
128
+ "label": "移动端特殊设置",
129
+ "default": false
130
+ },
131
+ {
132
+ "type": "range",
133
+ "id": "mobile_font_size",
134
+ "min": 8,
135
+ "max": 36,
136
+ "step": 1,
137
+ "unit": "px",
138
+ "label": "移动端字体大小",
139
+ "info": "移动端需要特殊设置时使用,默认根据选择标题等级自动设置",
140
+ "default": 28,
141
+ "visible_if": "{{ block.settings.mb_special_settings == true }}"
142
+ },
143
+ {
144
+ "type": "select",
145
+ "id": "mobile_font_weight",
146
+ "label": "移动端字体粗细",
147
+ "options": [
148
+ { "value": "default", "label": "默认" },
149
+ { "value": "custom", "label": "自定义" }
150
+ ],
151
+ "default": "default"
152
+ },
153
+ {
154
+ "type": "range",
155
+ "id": "mobile_font_weight_custom",
156
+ "label": "移动端字体粗细自定义",
157
+ "min": 100,
158
+ "max": 900,
159
+ "step": 100,
160
+ "default": 700,
161
+ "visible_if": "{{ block.settings.mobile_font_weight == 'custom' }}"
162
+ },
163
+ {
164
+ "type": "select",
165
+ "id": "animation",
166
+ "label": "动画",
167
+ "options": [
168
+ { "value": "none-animation", "label": "无动画" },
169
+ { "value": "fade-in-content", "label": "从下往上显示" },
170
+ { "value": "fade-in-from-left-content", "label": "从左往右显示" },
171
+ { "value": "fade-in-from-right-content", "label": "从右往左显示" },
172
+ { "value": "slow-reveal-content", "label": "跟随页面滚动缓慢显示" }
173
+ ],
174
+ "default": "none-animation"
175
+ },
176
+ ],
177
+ "presets": [
178
+ {
179
+ "name": "标题 h2-h4"
180
+ }
181
+ ],
182
+ }
183
+ {% endschema %}
184
+
185
+
186
+ {% assign animation_class = block.settings.animation | append: ' title-block' %}
187
+
188
+ {% case block.settings.tag %}
189
+ {% when 'h2' %}
190
+ {% render 'zz-h2',
191
+ title: block.settings.pc_title,
192
+ title_mb: block.settings.mb_title | default: block.settings.pc_title,
193
+ title_color: block.settings.text_color,
194
+ title_color_gradient: block.settings.text_gradient,
195
+ italic: block.settings.italic,
196
+ class_name: animation_class,
197
+ font_weight: block.settings.pc_font_weight,
198
+ font_weight_custom: block.settings.pc_font_weight_custom,
199
+ font_weight_mb: block.settings.mobile_font_weight,
200
+ font_weight_mb_custom: block.settings.mobile_font_weight_custom
201
+ %}
202
+ {% when 'h3' %}
203
+ {% render 'zz-h3',
204
+ title: block.settings.pc_title,
205
+ title_mb: block.settings.mb_title | default: block.settings.pc_title,
206
+ title_color: block.settings.text_color,
207
+ title_color_gradient: block.settings.text_gradient,
208
+ italic: block.settings.italic,
209
+ class_name: animation_class,
210
+ font_weight: block.settings.pc_font_weight,
211
+ font_weight_custom: block.settings.pc_font_weight_custom,
212
+ font_weight_mb: block.settings.mobile_font_weight,
213
+ font_weight_mb_custom: block.settings.mobile_font_weight_custom
214
+
215
+ %}
216
+ {% when 'h4' %}
217
+ {% render 'zz-h4',
218
+ title: block.settings.pc_title,
219
+ title_mb: block.settings.mb_title | default: block.settings.pc_title,
220
+ title_color: block.settings.text_color,
221
+ title_color_gradient: block.settings.text_gradient,
222
+ italic: block.settings.italic,
223
+ class_name: animation_class,
224
+ font_weight: block.settings.pc_font_weight,
225
+ font_weight_custom: block.settings.pc_font_weight_custom,
226
+ font_weight_mb: block.settings.mobile_font_weight,
227
+ font_weight_mb_custom: block.settings.mobile_font_weight_custom
228
+ %}
229
+ {% when 'h5' %}
230
+ {% render 'zz-h5',
231
+ title: block.settings.pc_title,
232
+ title_mb: block.settings.mb_title | default: block.settings.pc_title,
233
+ title_color: block.settings.text_color,
234
+ title_color_gradient: block.settings.text_gradient,
235
+ italic: block.settings.italic,
236
+ class_name: animation_class,
237
+ font_weight: block.settings.pc_font_weight,
238
+ font_weight_custom: block.settings.pc_font_weight_custom,
239
+ font_weight_mb: block.settings.mobile_font_weight,
240
+ font_weight_mb_custom: block.settings.mobile_font_weight_custom
241
+ %}
242
+ {% when 'h6' %}
243
+ {% render 'zz-h6',
244
+ title: block.settings.pc_title,
245
+ title_mb: block.settings.mb_title | default: block.settings.pc_title,
246
+ title_color: block.settings.text_color,
247
+ title_color_gradient: block.settings.text_gradient,
248
+ italic: block.settings.italic,
249
+ class_name: animation_class,
250
+ font_weight: block.settings.pc_font_weight,
251
+ font_weight_custom: block.settings.pc_font_weight_custom,
252
+ font_weight_mb: block.settings.mobile_font_weight,
253
+ font_weight_mb_custom: block.settings.mobile_font_weight_custom
254
+ %}
255
+ {% endcase %}
256
+
257
+ <style>
258
+ #shopify-block-{{ block.id }} {
259
+ margin-top: {{ block.settings.mobile_margin_top }}px;
260
+ margin-bottom: {{ block.settings.mobile_margin_bottom }}px;
261
+ }
262
+ #shopify-block-{{ block.id }} .title-block {
263
+ text-align: {{ block.settings.mobile_align }};
264
+ }
265
+
266
+ @media (min-width: 1024px) {
267
+ #shopify-block-{{ block.id }} {
268
+ margin-top: {{ block.settings.pc_margin_top }}px;
269
+ margin-bottom: {{ block.settings.pc_margin_bottom }}px;
270
+ }
271
+ #shopify-block-{{ block.id }} .title-block {
272
+ text-align: {{ block.settings.pc_align }};
273
+ }
274
+ }
275
+
276
+ {% if block.settings.mb_special_settings %}
277
+ @media (max-width: 1023px) {
278
+ #shopify-block-{{ block.id }} .title-block {
279
+ font-size: {{ block.settings.mobile_font_size }}px;
280
+ }
281
+ }
282
+ {% endif %}
283
+
284
+ </style>
@@ -0,0 +1,81 @@
1
+
2
+ {% schema %}
3
+ {
4
+ "name": "Video Button",
5
+ "settings": [
6
+ {
7
+ "type": "text",
8
+ "id": "text",
9
+ "label": "按钮文字",
10
+ "default": "按钮"
11
+ },
12
+ {
13
+ "type": "video",
14
+ "id": "video_pc",
15
+ "label": "视频"
16
+ },
17
+ {
18
+ "type": "image_picker",
19
+ "id": "poster_pc",
20
+ "label": "视频 封面"
21
+ },
22
+ {
23
+ "type": "select",
24
+ "id": "color",
25
+ "label": "按钮颜色",
26
+ "options": [
27
+ {
28
+ "value": "black",
29
+ "label": "black"
30
+ },
31
+ {
32
+ "value": "white",
33
+ "label": "white"
34
+ },
35
+ {
36
+ "value": "orange",
37
+ "label": "orange"
38
+ }
39
+ ],
40
+ "default": "white",
41
+ },
42
+ {
43
+ "type": "select",
44
+ "id": "size",
45
+ "label": "按钮大小",
46
+ "options": [
47
+ {
48
+ "value": "large",
49
+ "label": "large"
50
+ },
51
+ {
52
+ "value": "medium",
53
+ "label": "medium"
54
+ },
55
+ {
56
+ "value": "small",
57
+ "label": "small"
58
+ }
59
+ ],
60
+ "default": "medium"
61
+ }
62
+ ],
63
+ "presets": [
64
+ {
65
+ "name": "视频按钮",
66
+ "settings": {
67
+ "text": "watch video",
68
+ }
69
+ }
70
+ ]
71
+ }
72
+ {% endschema %}
73
+
74
+ {% render 'zz-video-button',
75
+ video: block.settings.video_pc,
76
+ poster: block.settings.poster_pc,
77
+ color: block.settings.color,
78
+ text: block.settings.text,
79
+ size: block.settings.size
80
+ %}
81
+