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,189 @@
1
+
2
+ {% schema %}
3
+ {
4
+ "name": "Button",
5
+ "settings": [
6
+ {
7
+ "type": "text",
8
+ "id": "text",
9
+ "label": "按钮文字",
10
+ "default": "按钮"
11
+ },
12
+ {
13
+ "type": "select",
14
+ "id": "function_type",
15
+ "label": "功能类型",
16
+ "options": [
17
+ {
18
+ "value": "link",
19
+ "label": "链接"
20
+ },
21
+ {
22
+ "value": "link_map",
23
+ "label": "多国家映射"
24
+ },
25
+ ],
26
+ "default": "link"
27
+ },
28
+ {
29
+ "type": "url",
30
+ "id": "url",
31
+ "label": "按钮链接",
32
+ "visible_if": "{{ block.settings.function_type == 'link' }}"
33
+ },
34
+ {
35
+ "type": "textarea",
36
+ "id": "links",
37
+ "label": "Sites Link Map",
38
+ "info": "国家对应链接的表,国家即是国家选择器上显示的字段,国家和路由之间用冒号隔开( 冒号后要加空格)。国家之间换行,“default”为其他未写的默认的链接 EG: Canada: https://hoverair.com/ default: https://hoverair.com/ ",
39
+ "visible_if": "{{ block.settings.function_type == 'link_map' }}"
40
+ },
41
+ {
42
+ "type": "select",
43
+ "id": "type",
44
+ "label": "按钮类型",
45
+ "options": [
46
+ {
47
+ "value": "primary",
48
+ "label": "primary"
49
+ },
50
+ {
51
+ "value": "default",
52
+ "label": "default"
53
+ },
54
+ {
55
+ "value": "round",
56
+ "label": "round"
57
+ },
58
+ {
59
+ "value": "link",
60
+ "label": "link"
61
+ },
62
+ {
63
+ "value": "primary-round",
64
+ "label": "primary-round"
65
+ },
66
+ ],
67
+ "default": "primary"
68
+ },
69
+ {
70
+ "type": "select",
71
+ "id": "color",
72
+ "label": "按钮颜色",
73
+ "options": [
74
+ {
75
+ "value": "black",
76
+ "label": "black"
77
+ },
78
+ {
79
+ "value": "white",
80
+ "label": "white"
81
+ },
82
+ {
83
+ "value": "orange",
84
+ "label": "orange"
85
+ }
86
+ ],
87
+ "default": "black",
88
+ },
89
+ {
90
+ "type": "select",
91
+ "id": "size",
92
+ "label": "按钮大小",
93
+ "options": [
94
+ {
95
+ "value": "large",
96
+ "label": "large"
97
+ },
98
+ {
99
+ "value": "medium",
100
+ "label": "medium"
101
+ },
102
+ {
103
+ "value": "small",
104
+ "label": "small"
105
+ }
106
+ ],
107
+ "default": "medium"
108
+ },
109
+ {
110
+ "type": "select",
111
+ "id": "postfix_icon",
112
+ "label": "后缀图标",
113
+ "options": [
114
+ { "value": "none", "label": "不展示" },
115
+ { "value": "download", "label": "下载" },
116
+ { "value": "arrow-right", "label": "向右箭头" }
117
+ ],
118
+ "default": "none"
119
+ },
120
+ {
121
+ "type": "number",
122
+ "id": "icon_size",
123
+ "label": "图标大小(px)",
124
+ "default": 15
125
+ },
126
+ {
127
+ "type": "number",
128
+ "id": "icon_left_margin",
129
+ "label": "图标左边距(px)",
130
+ "default": 0
131
+ },
132
+ {
133
+ "type": "number",
134
+ "id": "icon_right_margin",
135
+ "label": "图标右边距(px)",
136
+ "default": 0
137
+ },
138
+ {
139
+ "type": "text",
140
+ "id": "click_event_class_name",
141
+ "label": "点击事件统计 classname",
142
+ }
143
+ ],
144
+ "presets": [
145
+ {
146
+ "name": "按钮"
147
+ }
148
+ ]
149
+ }
150
+ {% endschema %}
151
+
152
+
153
+ {% assign btn_class = 'zz-button' | append: block.id %}
154
+
155
+ {% render 'zz-button',
156
+ href: block.settings.url,
157
+ type: block.settings.type,
158
+ color: block.settings.color,
159
+ text: block.settings.text,
160
+ size: block.settings.size,
161
+ postfix_icon: block.settings.postfix_icon,
162
+ icon_size: block.settings.icon_size,
163
+ icon_left_margin: block.settings.icon_left_margin,
164
+ icon_right_margin: block.settings.icon_right_margin,
165
+ class_name: btn_class
166
+ %}
167
+
168
+
169
+
170
+
171
+ <script>
172
+ document.addEventListener('DOMContentLoaded', (event) => {
173
+ const btn = document.getElementsByClassName('{{ btn_class }}')
174
+ if(btn && btn[0]) {
175
+ btn[0].addEventListener('click', (event) => {
176
+ dataLayer.push({
177
+ event: "{{ block.settings.click_event_class_name }}",
178
+ timestamp: new Date().toISOString(),
179
+ });
180
+ });
181
+ {% if block.settings.function_type == 'link_map' %}
182
+ bindSiteJump(btn[0], {{ block.settings.links | json }})
183
+ {% endif %}
184
+ }
185
+
186
+ })
187
+ </script>
188
+
189
+
@@ -0,0 +1,199 @@
1
+ {% schema %}
2
+ {
3
+ "name": "Content Text Html",
4
+ "class": "zz-content-description-html",
5
+ "settings": [
6
+ {
7
+ "type": "color",
8
+ "id": "text_color",
9
+ "label": "Text Color",
10
+ "default": "#000000"
11
+ },
12
+ {
13
+ "type": "color",
14
+ "id": "highlight_color",
15
+ "label": "Highlight Color",
16
+ "default": "#000000"
17
+ },
18
+ {
19
+ "type": "color",
20
+ "id": "link_color",
21
+ "label": "Link Color",
22
+ "default": "#0066cc"
23
+ },
24
+ {
25
+ "type": "header",
26
+ "content": "PC Settings"
27
+ },
28
+ {
29
+ "type": "html",
30
+ "id": "pc_content",
31
+ "label": "PC Content",
32
+ "default": "<p>Enter your content here</p>"
33
+ },
34
+ {
35
+ "type": "range",
36
+ "id": "pc_font_size",
37
+ "min": 12,
38
+ "max": 48,
39
+ "step": 1,
40
+ "unit": "px",
41
+ "label": "PC Font Size",
42
+ "default": 16
43
+ },
44
+
45
+ {
46
+ "type": "select",
47
+ "id": "pc_text_align",
48
+ "label": "PC Text Alignment",
49
+ "options": [
50
+ {
51
+ "value": "left",
52
+ "label": "Left"
53
+ },
54
+ {
55
+ "value": "center",
56
+ "label": "Center"
57
+ },
58
+ {
59
+ "value": "right",
60
+ "label": "Right"
61
+ }
62
+ ],
63
+ "default": "left"
64
+ },
65
+ {
66
+ "type": "header",
67
+ "content": "Mobile Settings"
68
+ },
69
+ {
70
+ "type": "html",
71
+ "id": "mobile_content",
72
+ "label": "Mobile Content",
73
+ "default": "<p>Enter your mobile content here</p>"
74
+ },
75
+ {
76
+ "type": "range",
77
+ "id": "mobile_font_size",
78
+ "min": 8,
79
+ "max": 36,
80
+ "step": 1,
81
+ "unit": "px",
82
+ "label": "Mobile Font Size",
83
+ "default": 12
84
+ },
85
+ {
86
+ "type": "select",
87
+ "id": "mobile_text_align",
88
+ "label": "Mobile Text Alignment",
89
+ "options": [
90
+ {
91
+ "value": "left",
92
+ "label": "Left"
93
+ },
94
+ {
95
+ "value": "center",
96
+ "label": "Center"
97
+ },
98
+ {
99
+ "value": "right",
100
+ "label": "Right"
101
+ }
102
+ ],
103
+ "default": "left"
104
+ },
105
+ {
106
+ "type": "select",
107
+ "id": "animation",
108
+ "label": "动画",
109
+ "options": [
110
+ { "value": "none-animation", "label": "无动画" },
111
+ { "value": "fade-in-content", "label": "从下往上显示" },
112
+ { "value": "fade-in-from-left-content", "label": "从左往右显示" },
113
+ { "value": "fade-in-from-right-content", "label": "从右往左显示" },
114
+ { "value": "slow-reveal-content", "label": "跟随页面滚动缓慢显示" }
115
+ ],
116
+ "default": "none-animation"
117
+ },
118
+ {
119
+ "type": "checkbox",
120
+ "id": "use_margin",
121
+ "label": "是否设置上下外边距",
122
+ "default": false
123
+ },
124
+ {
125
+ "type": "number",
126
+ "id": "mobile_margin_top",
127
+ "label": "移动上外边距 (Margin Top)",
128
+ "default": 0,
129
+ "visible_if": "{{ block.settings.use_margin == true }}"
130
+ },
131
+ {
132
+ "type": "number",
133
+ "id": "mobile_margin_bottom",
134
+ "label": "移动下外边距 (Margin Bottom)",
135
+ "default": 0,
136
+ "visible_if": "{{ block.settings.use_margin == true }}"
137
+ },
138
+ {
139
+ "type": "number",
140
+ "id": "pc_margin_top",
141
+ "label": "PC上外边距 (Margin Top)",
142
+ "default": 0,
143
+ "visible_if": "{{ block.settings.use_margin == true }}"
144
+ },
145
+ {
146
+ "type": "number",
147
+ "id": "pc_margin_bottom",
148
+ "label": "PC下外边距 (Margin Bottom)",
149
+ "default": 0,
150
+ "visible_if": "{{ block.settings.use_margin == true }}"
151
+ },
152
+ ],
153
+ "presets": [
154
+ {
155
+ "name": "内容描述 html",
156
+ "settings": {
157
+ "pc_content": "<p>This is a detailed product description <strong> highlights the key features. </strong></p>",
158
+ "pc_font_size": 16,
159
+ "text_color": "#333333",
160
+ "link_color": "#0066cc",
161
+ "pc_text_align": "left",
162
+ "mobile_content": "<p>This is a detailed product description <strong> highlights the key features. </strong></p>",
163
+ "mobile_font_size": 14,
164
+ "mobile_text_align": "left"
165
+ }
166
+ }
167
+ ]
168
+ }
169
+ {% endschema %}
170
+
171
+
172
+ {% render 'zz-content-text',
173
+ text: block.settings.pc_content,
174
+ mb_text: block.settings.mobile_content,
175
+ text_color: block.settings.text_color,
176
+ highlight_color: block.settings.highlight_color,
177
+ link_color: block.settings.link_color,
178
+ pc_font_size: block.settings.pc_font_size,
179
+ mobile_font_size: block.settings.mobile_font_size,
180
+ pc_text_align: block.settings.pc_text_align,
181
+ mobile_text_align: block.settings.mobile_text_align,
182
+ class_name: block.settings.animation
183
+ %}
184
+
185
+ {% if block.settings.use_margin %}
186
+ <style>
187
+ #shopify-block-{{ block.id }} {
188
+ margin-top: {{ block.settings.mobile_margin_top }}px;
189
+ margin-bottom: {{ block.settings.mobile_margin_bottom }}px;
190
+ }
191
+ @media (min-width: 1024px) {
192
+ #shopify-block-{{ block.id }} {
193
+ margin-top: {{ block.settings.pc_margin_top }}px;
194
+ margin-bottom: {{ block.settings.pc_margin_bottom }}px;
195
+ }
196
+ }
197
+
198
+ </style>
199
+ {% endif %}
@@ -0,0 +1,200 @@
1
+ {% schema %}
2
+ {
3
+ "name": "Content Text",
4
+ "class": "zz-content-description",
5
+ "settings": [
6
+ {
7
+ "type": "color",
8
+ "id": "text_color",
9
+ "label": "Text Color",
10
+ "default": "#000000"
11
+ },
12
+ {
13
+ "type": "header",
14
+ "content": "PC Settings"
15
+ },
16
+ {
17
+ "type": "richtext",
18
+ "id": "pc_content",
19
+ "label": "PC Content",
20
+ "default": "<p>Enter your content here</p>"
21
+ },
22
+
23
+ {
24
+ "type": "range",
25
+ "id": "pc_font_size",
26
+ "min": 12,
27
+ "max": 48,
28
+ "step": 1,
29
+ "unit": "px",
30
+ "label": "PC Font Size",
31
+ "default": 16
32
+ },
33
+ {
34
+ "type": "text",
35
+ "id": "pc_font_line_height",
36
+ "label": "PC Font Line Height",
37
+ "default": "1.5"
38
+ },
39
+ {
40
+ "type": "select",
41
+ "id": "pc_text_align",
42
+ "label": "PC Text Alignment",
43
+ "options": [
44
+ {
45
+ "value": "left",
46
+ "label": "Left"
47
+ },
48
+ {
49
+ "value": "center",
50
+ "label": "Center"
51
+ },
52
+ {
53
+ "value": "right",
54
+ "label": "Right"
55
+ }
56
+ ],
57
+ "default": "left"
58
+ },
59
+
60
+ {
61
+ "type": "header",
62
+ "content": "Mobile Settings"
63
+ },
64
+ {
65
+ "type": "richtext",
66
+ "id": "mobile_content",
67
+ "label": "Mobile Content",
68
+ "default": "<p>Enter your mobile content here</p>"
69
+ },
70
+ {
71
+ "type": "range",
72
+ "id": "mobile_font_size",
73
+ "min": 8,
74
+ "max": 36,
75
+ "step": 1,
76
+ "unit": "px",
77
+ "label": "Mobile Font Size",
78
+ "default": 12
79
+ },
80
+ {
81
+ "type": "text",
82
+ "id": "mobile_font_line_height",
83
+ "label": "Mobile Font Line Height",
84
+ "default": "1.5"
85
+ },
86
+ {
87
+ "type": "select",
88
+ "id": "mobile_text_align",
89
+ "label": "Mobile Text Alignment",
90
+ "options": [
91
+ {
92
+ "value": "left",
93
+ "label": "Left"
94
+ },
95
+ {
96
+ "value": "center",
97
+ "label": "Center"
98
+ },
99
+ {
100
+ "value": "right",
101
+ "label": "Right"
102
+ }
103
+ ],
104
+ "default": "left"
105
+ },
106
+
107
+ {
108
+ "type": "select",
109
+ "id": "animation",
110
+ "label": "动画",
111
+ "options": [
112
+ { "value": "none-animation", "label": "无动画" },
113
+ { "value": "fade-in-content", "label": "从下往上显示" },
114
+ { "value": "fade-in-from-left-content", "label": "从左往右显示" },
115
+ { "value": "fade-in-from-right-content", "label": "从右往左显示" },
116
+ { "value": "slow-reveal-content", "label": "跟随页面滚动缓慢显示" }
117
+ ],
118
+ "default": "none-animation"
119
+ },
120
+ {
121
+ "type": "checkbox",
122
+ "id": "use_margin",
123
+ "label": "是否设置上下外边距",
124
+ "default": false
125
+ },
126
+ {
127
+ "type": "number",
128
+ "id": "mobile_margin_top",
129
+ "label": "移动上外边距 (Margin Top)",
130
+ "default": 0,
131
+ "visible_if": "{{ block.settings.use_margin == true }}"
132
+ },
133
+ {
134
+ "type": "number",
135
+ "id": "mobile_margin_bottom",
136
+ "label": "移动下外边距 (Margin Bottom)",
137
+ "default": 0,
138
+ "visible_if": "{{ block.settings.use_margin == true }}"
139
+ },
140
+ {
141
+ "type": "number",
142
+ "id": "pc_margin_top",
143
+ "label": "PC上外边距 (Margin Top)",
144
+ "default": 0,
145
+ "visible_if": "{{ block.settings.use_margin == true }}"
146
+ },
147
+ {
148
+ "type": "number",
149
+ "id": "pc_margin_bottom",
150
+ "label": "PC下外边距 (Margin Bottom)",
151
+ "default": 0,
152
+ "visible_if": "{{ block.settings.use_margin == true }}"
153
+ },
154
+ ],
155
+ "presets": [
156
+ {
157
+ "name": "内容描述",
158
+ "settings": {
159
+ "pc_content": "<p>This is a detailed product description </p>",
160
+ "pc_font_size": 16,
161
+ "text_color": "#333333",
162
+ "pc_text_align": "left",
163
+ "mobile_content": "<p>This is a detailed product description</p>",
164
+ "mobile_font_size": 14,
165
+ "mobile_text_align": "left"
166
+ }
167
+ }
168
+ ]
169
+ }
170
+ {% endschema %}
171
+
172
+ {% render 'zz-content-text',
173
+ text: block.settings.pc_content,
174
+ mb_text: block.settings.mobile_content,
175
+ text_color: block.settings.text_color,
176
+ pc_font_size: block.settings.pc_font_size,
177
+ mobile_font_size: block.settings.mobile_font_size,
178
+ pc_text_align: block.settings.pc_text_align,
179
+ mobile_text_align: block.settings.mobile_text_align,
180
+ pc_font_line_height: block.settings.pc_font_line_height,
181
+ mobile_font_line_height: block.settings.mobile_font_line_height,
182
+ class_name: block.settings.animation
183
+ %}
184
+
185
+ {% if block.settings.use_margin %}
186
+ <style>
187
+ #shopify-block-{{ block.id }} {
188
+ margin-top: {{ block.settings.mobile_margin_top }}px;
189
+ margin-bottom: {{ block.settings.mobile_margin_bottom }}px;
190
+ }
191
+ @media (min-width: 1024px) {
192
+ #shopify-block-{{ block.id }} {
193
+ margin-top: {{ block.settings.pc_margin_top }}px;
194
+ margin-bottom: {{ block.settings.pc_margin_bottom }}px;
195
+ }
196
+ }
197
+
198
+ </style>
199
+ {% endif %}
200
+