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,216 @@
1
+ <style>
2
+ @media screen and (max-width: 1023px) {
3
+ #shopify-block-{{block.id}} {
4
+ width: calc(100% - 40px);
5
+ box-sizing: border-box;
6
+ }
7
+ #shopify-block-{{block.id}} .image-video-box {
8
+ border-radius: 10px;
9
+ }
10
+ }
11
+ @media screen and (min-width: 1024px) {
12
+ #shopify-block-{{block.id}} {
13
+ width: 83.3594vw;
14
+ {% comment %} height: 46.875vw; {% endcomment %}
15
+ }
16
+ #shopify-block-{{block.id}} .image-video-box {
17
+ border-radius: 16px;
18
+ }
19
+
20
+ }
21
+ @media screen and (min-width: 1280px) {
22
+ #shopify-block-{{block.id}} {
23
+ width: 1067px;
24
+ {% comment %} height: 600px; {% endcomment %}
25
+ }
26
+
27
+ }
28
+ #shopify-block-{{block.id}} .media-box {
29
+ {% if block.settings.has_link %}
30
+ cursor: pointer;
31
+ {% endif %}
32
+ }
33
+
34
+
35
+ #shopify-block-{{block.id}}.swiper-slide-active .active-box-content {
36
+ display: block !important;
37
+ }
38
+ </style>
39
+
40
+ {% assign media_class = 'zz-link-' | append: block.id %}
41
+
42
+ <div class='media-box banner-item {{ media_class }}'>
43
+ {% if block.settings.video_pc != blank %}
44
+ {% if block.settings.video_url_pc != blank %}
45
+ {% assign pc_video = block.settings.video_url_pc %}
46
+ {% else %}
47
+ {% assign pc_video = block.settings.video_pc %}
48
+ {% endif %}
49
+ {% render 'zz-video',
50
+ pc_video: pc_video,
51
+ pc_poster: block.settings.poster_pc,
52
+ mb_video: block.settings.video_mb,
53
+ mb_poster: block.settings.poster_mb,
54
+ lazy: true,
55
+ class: 'image-video-box tw-w-full tw-h-auto ',
56
+ autoplay: false,
57
+ muted: true
58
+ %}
59
+ {% else %}
60
+ {%
61
+ render 'zz-img',
62
+ pc_image: block.settings.poster_pc,
63
+ mb_image: block.settings.poster_mb,
64
+ image_alt: block.settings.heading | escape,
65
+ class_name: 'image-video-box',
66
+ %}
67
+ {% endif %}
68
+ </div>
69
+
70
+ <div class='slide-box {% if block.settings.has_title_and_content %} tw-pt-[20px] tw-h-[140px] lg:tw-pt-[48px] lg:tw-h-[178px] {% else %} tw-h-[25px] {% endif %} tw-box-border max-lg:tw-px-[15px] lg:tw-px-[10vw]'>
71
+ <div class='active-box-content tw-hidden'>
72
+ {% render 'zz-h5',
73
+ title: block.settings.heading,
74
+ title_color: block.settings.title_color,
75
+ class_name: 'tw-text-center'
76
+ %}
77
+ <div class='tw-mt-[8px] lg:tw-mt-[16px]'>
78
+ {% render 'zz-content-text',
79
+ text: block.settings.row_content,
80
+ mb_text: block.settings.row_content,
81
+ pc_font_size: 16,
82
+ mobile_font_size: 12,
83
+ text_color: block.settings.content_color,
84
+ class_name: 'tw-text-center'
85
+ %}
86
+ </div>
87
+ </div>
88
+ </div>
89
+
90
+ {% schema %}
91
+ {
92
+ "name": "Video Swiper Preview Item",
93
+ "class": "zz-video-swiper-preview-item",
94
+ "settings": [
95
+ {
96
+ "type": "text",
97
+ "id": "video_url_pc",
98
+ "label": "Video url PC",
99
+ "info": "使用cdn视频时,填写视频url。防止大屏幕视频模糊"
100
+ },
101
+ {
102
+ "type": "video",
103
+ "id": "video_pc",
104
+ "label": "Video"
105
+ },
106
+ {
107
+ "type": "image_picker",
108
+ "id": "poster_pc",
109
+ "label": "Poster"
110
+ },
111
+ {
112
+ "type": "video",
113
+ "id": "video_mb",
114
+ "label": "Video(Mobile)"
115
+ },
116
+ {
117
+ "type": "image_picker",
118
+ "id": "poster_mb",
119
+ "label": "Poster(Mobile)"
120
+ },
121
+ {
122
+ "type": "checkbox",
123
+ "id": "has_title_and_content",
124
+ "label": "是否有标题与内容",
125
+ "default": true
126
+ },
127
+ {
128
+ "type": "text",
129
+ "id": "heading",
130
+ "label": "标题",
131
+ "visible_if": "{{ block.settings.has_title_and_content == true }}"
132
+ },
133
+ {
134
+ "type": "color",
135
+ "id": "title_color",
136
+ "default": "#000000",
137
+ "label": "标题颜色",
138
+ "visible_if": "{{ block.settings.has_title_and_content == true }}"
139
+ },
140
+ {
141
+ "type": "richtext",
142
+ "id": "row_content",
143
+ "label": "description",
144
+ "visible_if": "{{ block.settings.has_title_and_content == true }}"
145
+ },
146
+ {
147
+ "type": "color",
148
+ "id": "content_color",
149
+ "default": "#B2B2B2",
150
+ "label": "内容颜色",
151
+ "visible_if": "{{ block.settings.has_title_and_content == true }}"
152
+ },
153
+ {
154
+ "type": "checkbox",
155
+ "id": "has_link",
156
+ "label": "是否有链接",
157
+ "default": false
158
+ },
159
+ {
160
+ "type": "select",
161
+ "id": "function_type",
162
+ "label": "功能类型",
163
+ "options": [
164
+ {
165
+ "value": "link",
166
+ "label": "链接"
167
+ },
168
+ {
169
+ "value": "link_map",
170
+ "label": "多国家映射"
171
+ }
172
+ ],
173
+ "default": "link",
174
+ "visible_if": "{{ block.settings.has_link == true }}"
175
+ },
176
+ {
177
+ "type": "url",
178
+ "id": "url",
179
+ "label": "链接",
180
+ "visible_if": "{{ block.settings.function_type == 'link' and block.settings.has_link == true }}"
181
+ },
182
+ {
183
+ "type": "textarea",
184
+ "id": "links",
185
+ "label": "Sites Link Map",
186
+ "info": "国家对应链接的表,国家即是国家选择器上显示的字段,国家和路由之间用冒号隔开( 冒号后要加空格)。国家之间换行,“default”为其他未写的默认的链接 EG: Canada: https://hoverair.com/ default: https://hoverair.com/ ",
187
+ "visible_if": "{{ block.settings.function_type == 'link_map' and block.settings.has_link == true }}"
188
+ }
189
+ ],
190
+ "presets": [
191
+ {
192
+ "name": "可预览轮播图-Item"
193
+ }
194
+ ]
195
+ }
196
+ {% endschema %}
197
+
198
+ {% if block.settings.has_link %}
199
+ <script>
200
+ document.addEventListener('DOMContentLoaded', (event) => {
201
+ const btn = document.getElementsByClassName('{{ media_class }}')
202
+ if(btn && btn[0]) {
203
+ {% if block.settings.function_type == 'link_map' %}
204
+ bindSiteJump(btn[0], {{ block.settings.links | json }})
205
+ {% else %}
206
+ // 监听点击事件
207
+ btn[0].addEventListener('click', (event) => {
208
+ event.preventDefault();
209
+ window.location.href = '{{ block.settings.url }}';
210
+ })
211
+ {% endif %}
212
+ }
213
+
214
+ })
215
+ </script>
216
+ {% endif %}