zz-shopify-components 0.0.27 → 0.0.28-beta.10
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.
- package/CHANGELOG.md +21 -21
- package/README.md +70 -56
- package/assets/ScrollTrigger.min.js +11 -11
- package/assets/gsap.min.js +11 -11
- package/assets/jquery.js +2 -2
- package/assets/lazy-video.js +2 -2
- package/assets/lazyload.min.js +1 -1
- package/assets/lozad.js +10 -10
- package/assets/site-jump.js +52 -52
- package/assets/site-jumpV2.js +35 -35
- package/assets/swiper-bundle.min.css +12 -12
- package/assets/swiper-bundle.min.js +13 -13
- package/assets/swiper.css +330 -330
- package/assets/zz-components.css +322 -322
- package/assets/zz-components.js +166 -166
- package/assets/zz-fade-in-content.js +169 -169
- package/assets/zz-http-request.js +73 -73
- package/assets/zz-world-video-comments-dialog.js +240 -240
- package/assets/zz-world-video-dialog.js +190 -190
- package/assets/zz-world-video-list.js +317 -317
- package/assets/zz-world-video.js +270 -270
- package/blocks/zz-accessories-item.liquid +188 -188
- package/blocks/zz-accessories-swiper.liquid +223 -223
- package/blocks/zz-button.liquid +216 -216
- package/blocks/zz-content-description-html.liquid +201 -201
- package/blocks/zz-content-description.liquid +209 -209
- package/blocks/zz-flex-layout-bg-block.liquid +524 -524
- package/blocks/zz-flex-layout-block.liquid +549 -549
- package/blocks/zz-flex-layout-widget.liquid +321 -321
- package/blocks/zz-full-screen-swiper.liquid +443 -443
- package/blocks/zz-icon.liquid +46 -46
- package/blocks/zz-mail.liquid +135 -135
- package/blocks/zz-mb-swiper-pc-flex.liquid +273 -273
- package/blocks/zz-price-tag-mini.liquid +106 -106
- package/blocks/zz-price-tag.liquid +41 -41
- package/blocks/zz-ratio-image.liquid +181 -181
- package/blocks/zz-ratio-video.liquid +115 -115
- package/blocks/zz-responsive-width-image.liquid +222 -222
- package/blocks/zz-responsive-width-video.liquid +166 -166
- package/blocks/zz-scroll-animate-bg-text.liquid +268 -268
- package/blocks/zz-scroll-cover.liquid +67 -67
- package/blocks/zz-tag.liquid +50 -50
- package/blocks/zz-text.liquid +227 -227
- package/blocks/zz-title.liquid +287 -287
- package/blocks/zz-video-button.liquid +84 -84
- package/blocks/zz-video-img-item.liquid +203 -203
- package/blocks/zz-video-img-list.liquid +166 -166
- package/blocks/zz-video-swiper-perview-item.liquid +221 -221
- package/blocks/zz-video-swiper-perview.liquid +585 -585
- package/blocks/zz-world-video.liquid +639 -639
- package/component.config.json +7 -7
- package/package.json +1 -1
- package/scripts/postinstall-v1.js +39 -39
- package/scripts/postinstall-v2.js +47 -47
- package/scripts/postinstall-v3.js +51 -51
- package/scripts/publish-npm.js +43 -43
- package/sections/zz-flex-layout-section.liquid +269 -269
- package/sections/zz-navigation-tab-v3.liquid +409 -409
- package/sections/zz-navigation-tab.liquid +411 -411
- package/sections/zz-shopping-card-list.liquid +399 -399
- package/sections/zz-video-collapse-swiper.liquid +522 -522
- package/sections/zz-video-tab-swiper.liquid +748 -748
- package/snippets/zz-button.liquid +70 -70
- package/snippets/zz-content-h3.liquid +15 -15
- package/snippets/zz-content-text.liquid +56 -56
- package/snippets/zz-h2.liquid +31 -31
- package/snippets/zz-h3.liquid +31 -31
- package/snippets/zz-h4.liquid +30 -30
- package/snippets/zz-h5.liquid +39 -39
- package/snippets/zz-h6.liquid +39 -39
- package/snippets/zz-icon-next.liquid +17 -17
- package/snippets/zz-icon-prev.liquid +17 -17
- package/snippets/zz-icon.liquid +74 -74
- package/snippets/zz-img-md.liquid +44 -44
- package/snippets/zz-img.liquid +44 -44
- package/snippets/zz-prev-next-blur-icon.liquid +36 -36
- package/snippets/zz-prev-next-btn.liquid +62 -62
- package/snippets/zz-price-tag.liquid +22 -22
- package/snippets/zz-spoke.liquid +142 -142
- package/snippets/zz-tag.liquid +22 -22
- package/snippets/zz-video-button.liquid +54 -54
- package/snippets/zz-video-md.liquid +117 -117
- package/snippets/zz-video.liquid +117 -117
|
@@ -1,273 +1,273 @@
|
|
|
1
|
-
{% schema %}
|
|
2
|
-
{
|
|
3
|
-
"name": "Mobile Swiper PC Flex",
|
|
4
|
-
"class": "flex-layout-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": "header",
|
|
14
|
-
"content": "💻 PC端布局设置"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"type": "number",
|
|
18
|
-
"id": "pc_gap",
|
|
19
|
-
"label": "区块间距 (Gap)",
|
|
20
|
-
"default": 40
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"type": "number",
|
|
24
|
-
"id": "pc_padding_top",
|
|
25
|
-
"label": "PC端顶部内边距 (px)",
|
|
26
|
-
"default": 40
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"type": "number",
|
|
30
|
-
"id": "pc_padding_bottom",
|
|
31
|
-
"label": "PC端底部内边距 (px)",
|
|
32
|
-
"default": 40
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"type": "number",
|
|
36
|
-
"id": "pc_xl_width",
|
|
37
|
-
"label": "XL屏幕内容区域宽度 (px)",
|
|
38
|
-
"default": 1220
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"type": "number",
|
|
42
|
-
"id": "pc_lg_width",
|
|
43
|
-
"label": "LG屏幕内容区域宽度 (vw)",
|
|
44
|
-
"default": 95
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"type": "select",
|
|
48
|
-
"id": "pc_justify",
|
|
49
|
-
"label": "PC主轴对齐 (Justify Content)",
|
|
50
|
-
"options": [
|
|
51
|
-
{ "value": "flex-start", "label": "起始对齐 (Flex Start)" },
|
|
52
|
-
{ "value": "center", "label": "居中对齐 (Center)" },
|
|
53
|
-
{ "value": "flex-end", "label": "末尾对齐 (Flex End)" },
|
|
54
|
-
{ "value": "space-between", "label": "两端对齐 (Space Between)" },
|
|
55
|
-
{ "value": "space-around", "label": "平均间距 (Space Around)" }
|
|
56
|
-
],
|
|
57
|
-
"default": "center"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"type": "select",
|
|
61
|
-
"id": "pc_align",
|
|
62
|
-
"label": "PC交叉轴对齐 (Align Items)",
|
|
63
|
-
"options": [
|
|
64
|
-
{ "value": "flex-start", "label": "起始对齐 (Flex Start)" },
|
|
65
|
-
{ "value": "center", "label": "居中对齐 (Center)" },
|
|
66
|
-
{ "value": "flex-end", "label": "末尾对齐 (Flex End)" }
|
|
67
|
-
],
|
|
68
|
-
"default": "center"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"type": "header",
|
|
72
|
-
"content": "📱 移动端 Swiper 设置"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"type": "number",
|
|
76
|
-
"id": "swiper_slide_padding_x",
|
|
77
|
-
"label": "轮播块与屏幕左右边距 (px)",
|
|
78
|
-
"default": 20
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"type": "number",
|
|
82
|
-
"id": "swiper_slide_height",
|
|
83
|
-
"label": "轮播块高度 (px)",
|
|
84
|
-
"default": 374
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"type": "select",
|
|
88
|
-
"id": "swiper_nav_style",
|
|
89
|
-
"label": "切换按钮样式",
|
|
90
|
-
"options": [
|
|
91
|
-
{ "value": "dark", "label": "深色" },
|
|
92
|
-
{ "value": "light", "label": "浅色" }
|
|
93
|
-
],
|
|
94
|
-
"default": "light"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"type": "number",
|
|
98
|
-
"id": "mobile_padding_top",
|
|
99
|
-
"label": "移动端顶部内边距 (px)",
|
|
100
|
-
"default": 32
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"type": "number",
|
|
104
|
-
"id": "mobile_padding_bottom",
|
|
105
|
-
"label": "移动端底部内边距 (px)",
|
|
106
|
-
"default": 32
|
|
107
|
-
}
|
|
108
|
-
],
|
|
109
|
-
"blocks": [
|
|
110
|
-
{
|
|
111
|
-
"type": "@theme"
|
|
112
|
-
}
|
|
113
|
-
],
|
|
114
|
-
"presets": [
|
|
115
|
-
{
|
|
116
|
-
"name": "Mobile Swiper PC Flex"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"name": "移动端轮播 & PC左右布局"
|
|
120
|
-
}
|
|
121
|
-
]
|
|
122
|
-
}
|
|
123
|
-
{% endschema %}
|
|
124
|
-
|
|
125
|
-
{% assign block_size = block.blocks.size %}
|
|
126
|
-
{% assign bullets_width_half = block_size
|
|
127
|
-
| minus: 1
|
|
128
|
-
| times: 14
|
|
129
|
-
| plus: 6
|
|
130
|
-
| divided_by: 2.0
|
|
131
|
-
| ceil
|
|
132
|
-
%}
|
|
133
|
-
{% assign btn_offset = bullets_width_half | plus: 14 | plus: 36 %}
|
|
134
|
-
|
|
135
|
-
<div class='swiper zz-mb-swiper-pc-flex'>
|
|
136
|
-
<div class='swiper-wrapper lg:tw-flex'>
|
|
137
|
-
{% content_for 'blocks' %}
|
|
138
|
-
</div>
|
|
139
|
-
<div class='swiper-button-prev {% if block_size <= 1 %} tw-hidden {% endif %} lg:tw-hidden'>
|
|
140
|
-
{% if block.settings.swiper_nav_style == 'light' %}
|
|
141
|
-
{% render 'icon-prev-light' %}
|
|
142
|
-
{% else %}
|
|
143
|
-
{% render 'icon-prev-dark' %}
|
|
144
|
-
{% endif %}
|
|
145
|
-
</div>
|
|
146
|
-
<div class='swiper-button-next {% if block_size <= 1 %} tw-hidden {% endif %} lg:tw-hidden'>
|
|
147
|
-
{% if block.settings.swiper_nav_style == 'light' %}
|
|
148
|
-
{% render 'icon-next-light' %}
|
|
149
|
-
{% else %}
|
|
150
|
-
{% render 'icon-next-dark' %}
|
|
151
|
-
{% endif %}
|
|
152
|
-
</div>
|
|
153
|
-
<div class='swiper-pagination {% if block_size <= 1 %} tw-hidden {% endif %} lg:tw-hidden'></div>
|
|
154
|
-
</div>
|
|
155
|
-
|
|
156
|
-
<script>
|
|
157
|
-
document.addEventListener('DOMContentLoaded', function () {
|
|
158
|
-
// 移动端添加轮播
|
|
159
|
-
if (window.innerWidth < 1024) {
|
|
160
|
-
(function() {
|
|
161
|
-
const bannerImageSwiper = new Swiper(
|
|
162
|
-
'#shopify-block-{{ block.id }} .zz-mb-swiper-pc-flex',
|
|
163
|
-
{
|
|
164
|
-
slidesPerView: 'auto',
|
|
165
|
-
centeredSlides: true,
|
|
166
|
-
spaceBetween: 8,
|
|
167
|
-
navigation: {
|
|
168
|
-
nextEl: '.swiper-button-next',
|
|
169
|
-
prevEl: '.swiper-button-prev',
|
|
170
|
-
},
|
|
171
|
-
pagination: {
|
|
172
|
-
el: '#shopify-block-{{ block.id }} .swiper-pagination',
|
|
173
|
-
clickable: true,
|
|
174
|
-
},
|
|
175
|
-
effect: 'slide',
|
|
176
|
-
}
|
|
177
|
-
);
|
|
178
|
-
})();
|
|
179
|
-
|
|
180
|
-
(function() {
|
|
181
|
-
// 获取 class zz-mb-swiper-pc-flex 的元素 且data-id 为 block.id 的元素
|
|
182
|
-
const zzMbSwiper = document.querySelector(`#shopify-block-{{ block.id }} .zz-mb-swiper-pc-flex`);
|
|
183
|
-
// 获取当前 swiper-wrapper 下面 所有 第一层 div
|
|
184
|
-
const swiperSlides = zzMbSwiper.querySelectorAll('.swiper-wrapper > div');
|
|
185
|
-
// 给每个 swiper-slide 添加 class swiper-slide
|
|
186
|
-
swiperSlides.forEach(slide => {
|
|
187
|
-
slide.classList.add('swiper-slide');
|
|
188
|
-
});
|
|
189
|
-
})();
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
</script>
|
|
193
|
-
|
|
194
|
-
<style>
|
|
195
|
-
#shopify-block-{{ block.id }} {
|
|
196
|
-
background-color: {{ block.settings.background_color }};
|
|
197
|
-
padding-top: {{ block.settings.mobile_padding_top }}px;
|
|
198
|
-
padding-bottom: {{ block.settings.mobile_padding_bottom }}px;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
@media (min-width: 1024px) {
|
|
202
|
-
#shopify-block-{{ block.id }} {
|
|
203
|
-
padding-top: {{ block.settings.pc_padding_top }}px;
|
|
204
|
-
padding-bottom: {{ block.settings.pc_padding_bottom }}px;
|
|
205
|
-
padding-left: 0px;
|
|
206
|
-
padding-right: 0px;
|
|
207
|
-
width: 100%;
|
|
208
|
-
}
|
|
209
|
-
#shopify-block-{{ block.id }} .swiper-wrapper {
|
|
210
|
-
display: flex;
|
|
211
|
-
gap: {{ block.settings.pc_gap }}px;
|
|
212
|
-
justify-content: {{ block.settings.pc_justify }};
|
|
213
|
-
align-items: {{ block.settings.pc_align }};
|
|
214
|
-
width: {{ block.settings.pc_lg_width }}vw;
|
|
215
|
-
margin: 0 auto;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
@media (min-width: 1280px) {
|
|
220
|
-
#shopify-block-{{ block.id }} .swiper-wrapper {
|
|
221
|
-
width: {{ block.settings.pc_xl_width }}px;
|
|
222
|
-
margin: 0 auto;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
@media screen and (max-width: 1023px) {
|
|
227
|
-
#shopify-block-{{ block.id }} .swiper-wrapper {
|
|
228
|
-
padding-bottom: 60px;
|
|
229
|
-
}
|
|
230
|
-
#shopify-block-{{ block.id }} .swiper-slide {
|
|
231
|
-
width: calc(100% - 40px);
|
|
232
|
-
height: {{ block.settings.swiper_slide_height }}px;
|
|
233
|
-
overflow: hidden;
|
|
234
|
-
}
|
|
235
|
-
#shopify-block-{{ block.id }} .swiper-button-next,
|
|
236
|
-
#shopify-block-{{ block.id }} .swiper-button-prev {
|
|
237
|
-
z-index: 99;
|
|
238
|
-
top: unset;
|
|
239
|
-
bottom: 0;
|
|
240
|
-
width: 36px;
|
|
241
|
-
height: 36px;
|
|
242
|
-
}
|
|
243
|
-
#shopify-block-{{ block.id }} .swiper-button-next:after,
|
|
244
|
-
#shopify-block-{{ block.id }} .swiper-button-prev:after {
|
|
245
|
-
display: none;
|
|
246
|
-
}
|
|
247
|
-
#shopify-block-{{ block.id }} .swiper-button-prev {
|
|
248
|
-
left: 50%;
|
|
249
|
-
transform: translate(-{{ btn_offset }}px, 0px);
|
|
250
|
-
}
|
|
251
|
-
#shopify-block-{{ block.id }} .swiper-button-next {
|
|
252
|
-
left: unset;
|
|
253
|
-
right: 50%;
|
|
254
|
-
transform: translate({{ btn_offset }}px, 0px);
|
|
255
|
-
}
|
|
256
|
-
#shopify-block-{{ block.id }} .swiper-pagination-bullets .swiper-pagination-bullet {
|
|
257
|
-
margin: 0 4px;
|
|
258
|
-
width: 6px;
|
|
259
|
-
height: 6px;
|
|
260
|
-
{% if block.settings.swiper_nav_style == 'light' %}
|
|
261
|
-
background: #000000;
|
|
262
|
-
opacity: 0.3;
|
|
263
|
-
{% else %}
|
|
264
|
-
background: #ffffff;
|
|
265
|
-
opacity: 0.5;
|
|
266
|
-
{% endif %}
|
|
267
|
-
}
|
|
268
|
-
#shopify-block-{{ block.id }} .swiper-pagination-bullets .swiper-pagination-bullet.swiper-pagination-bullet-active {
|
|
269
|
-
width: 6px;
|
|
270
|
-
opacity: 1;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
</style>
|
|
1
|
+
{% schema %}
|
|
2
|
+
{
|
|
3
|
+
"name": "Mobile Swiper PC Flex",
|
|
4
|
+
"class": "flex-layout-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": "header",
|
|
14
|
+
"content": "💻 PC端布局设置"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"type": "number",
|
|
18
|
+
"id": "pc_gap",
|
|
19
|
+
"label": "区块间距 (Gap)",
|
|
20
|
+
"default": 40
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"type": "number",
|
|
24
|
+
"id": "pc_padding_top",
|
|
25
|
+
"label": "PC端顶部内边距 (px)",
|
|
26
|
+
"default": 40
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"type": "number",
|
|
30
|
+
"id": "pc_padding_bottom",
|
|
31
|
+
"label": "PC端底部内边距 (px)",
|
|
32
|
+
"default": 40
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"type": "number",
|
|
36
|
+
"id": "pc_xl_width",
|
|
37
|
+
"label": "XL屏幕内容区域宽度 (px)",
|
|
38
|
+
"default": 1220
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "number",
|
|
42
|
+
"id": "pc_lg_width",
|
|
43
|
+
"label": "LG屏幕内容区域宽度 (vw)",
|
|
44
|
+
"default": 95
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"type": "select",
|
|
48
|
+
"id": "pc_justify",
|
|
49
|
+
"label": "PC主轴对齐 (Justify Content)",
|
|
50
|
+
"options": [
|
|
51
|
+
{ "value": "flex-start", "label": "起始对齐 (Flex Start)" },
|
|
52
|
+
{ "value": "center", "label": "居中对齐 (Center)" },
|
|
53
|
+
{ "value": "flex-end", "label": "末尾对齐 (Flex End)" },
|
|
54
|
+
{ "value": "space-between", "label": "两端对齐 (Space Between)" },
|
|
55
|
+
{ "value": "space-around", "label": "平均间距 (Space Around)" }
|
|
56
|
+
],
|
|
57
|
+
"default": "center"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"type": "select",
|
|
61
|
+
"id": "pc_align",
|
|
62
|
+
"label": "PC交叉轴对齐 (Align Items)",
|
|
63
|
+
"options": [
|
|
64
|
+
{ "value": "flex-start", "label": "起始对齐 (Flex Start)" },
|
|
65
|
+
{ "value": "center", "label": "居中对齐 (Center)" },
|
|
66
|
+
{ "value": "flex-end", "label": "末尾对齐 (Flex End)" }
|
|
67
|
+
],
|
|
68
|
+
"default": "center"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"type": "header",
|
|
72
|
+
"content": "📱 移动端 Swiper 设置"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"type": "number",
|
|
76
|
+
"id": "swiper_slide_padding_x",
|
|
77
|
+
"label": "轮播块与屏幕左右边距 (px)",
|
|
78
|
+
"default": 20
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"type": "number",
|
|
82
|
+
"id": "swiper_slide_height",
|
|
83
|
+
"label": "轮播块高度 (px)",
|
|
84
|
+
"default": 374
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"type": "select",
|
|
88
|
+
"id": "swiper_nav_style",
|
|
89
|
+
"label": "切换按钮样式",
|
|
90
|
+
"options": [
|
|
91
|
+
{ "value": "dark", "label": "深色" },
|
|
92
|
+
{ "value": "light", "label": "浅色" }
|
|
93
|
+
],
|
|
94
|
+
"default": "light"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"type": "number",
|
|
98
|
+
"id": "mobile_padding_top",
|
|
99
|
+
"label": "移动端顶部内边距 (px)",
|
|
100
|
+
"default": 32
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"type": "number",
|
|
104
|
+
"id": "mobile_padding_bottom",
|
|
105
|
+
"label": "移动端底部内边距 (px)",
|
|
106
|
+
"default": 32
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"blocks": [
|
|
110
|
+
{
|
|
111
|
+
"type": "@theme"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"presets": [
|
|
115
|
+
{
|
|
116
|
+
"name": "Mobile Swiper PC Flex"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "移动端轮播 & PC左右布局"
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
{% endschema %}
|
|
124
|
+
|
|
125
|
+
{% assign block_size = block.blocks.size %}
|
|
126
|
+
{% assign bullets_width_half = block_size
|
|
127
|
+
| minus: 1
|
|
128
|
+
| times: 14
|
|
129
|
+
| plus: 6
|
|
130
|
+
| divided_by: 2.0
|
|
131
|
+
| ceil
|
|
132
|
+
%}
|
|
133
|
+
{% assign btn_offset = bullets_width_half | plus: 14 | plus: 36 %}
|
|
134
|
+
|
|
135
|
+
<div class='swiper zz-mb-swiper-pc-flex'>
|
|
136
|
+
<div class='swiper-wrapper lg:tw-flex'>
|
|
137
|
+
{% content_for 'blocks' %}
|
|
138
|
+
</div>
|
|
139
|
+
<div class='swiper-button-prev {% if block_size <= 1 %} tw-hidden {% endif %} lg:tw-hidden'>
|
|
140
|
+
{% if block.settings.swiper_nav_style == 'light' %}
|
|
141
|
+
{% render 'icon-prev-light' %}
|
|
142
|
+
{% else %}
|
|
143
|
+
{% render 'icon-prev-dark' %}
|
|
144
|
+
{% endif %}
|
|
145
|
+
</div>
|
|
146
|
+
<div class='swiper-button-next {% if block_size <= 1 %} tw-hidden {% endif %} lg:tw-hidden'>
|
|
147
|
+
{% if block.settings.swiper_nav_style == 'light' %}
|
|
148
|
+
{% render 'icon-next-light' %}
|
|
149
|
+
{% else %}
|
|
150
|
+
{% render 'icon-next-dark' %}
|
|
151
|
+
{% endif %}
|
|
152
|
+
</div>
|
|
153
|
+
<div class='swiper-pagination {% if block_size <= 1 %} tw-hidden {% endif %} lg:tw-hidden'></div>
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
<script>
|
|
157
|
+
document.addEventListener('DOMContentLoaded', function () {
|
|
158
|
+
// 移动端添加轮播
|
|
159
|
+
if (window.innerWidth < 1024) {
|
|
160
|
+
(function() {
|
|
161
|
+
const bannerImageSwiper = new Swiper(
|
|
162
|
+
'#shopify-block-{{ block.id }} .zz-mb-swiper-pc-flex',
|
|
163
|
+
{
|
|
164
|
+
slidesPerView: 'auto',
|
|
165
|
+
centeredSlides: true,
|
|
166
|
+
spaceBetween: 8,
|
|
167
|
+
navigation: {
|
|
168
|
+
nextEl: '.swiper-button-next',
|
|
169
|
+
prevEl: '.swiper-button-prev',
|
|
170
|
+
},
|
|
171
|
+
pagination: {
|
|
172
|
+
el: '#shopify-block-{{ block.id }} .swiper-pagination',
|
|
173
|
+
clickable: true,
|
|
174
|
+
},
|
|
175
|
+
effect: 'slide',
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
})();
|
|
179
|
+
|
|
180
|
+
(function() {
|
|
181
|
+
// 获取 class zz-mb-swiper-pc-flex 的元素 且data-id 为 block.id 的元素
|
|
182
|
+
const zzMbSwiper = document.querySelector(`#shopify-block-{{ block.id }} .zz-mb-swiper-pc-flex`);
|
|
183
|
+
// 获取当前 swiper-wrapper 下面 所有 第一层 div
|
|
184
|
+
const swiperSlides = zzMbSwiper.querySelectorAll('.swiper-wrapper > div');
|
|
185
|
+
// 给每个 swiper-slide 添加 class swiper-slide
|
|
186
|
+
swiperSlides.forEach(slide => {
|
|
187
|
+
slide.classList.add('swiper-slide');
|
|
188
|
+
});
|
|
189
|
+
})();
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
</script>
|
|
193
|
+
|
|
194
|
+
<style>
|
|
195
|
+
#shopify-block-{{ block.id }} {
|
|
196
|
+
background-color: {{ block.settings.background_color }};
|
|
197
|
+
padding-top: {{ block.settings.mobile_padding_top }}px;
|
|
198
|
+
padding-bottom: {{ block.settings.mobile_padding_bottom }}px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
@media (min-width: 1024px) {
|
|
202
|
+
#shopify-block-{{ block.id }} {
|
|
203
|
+
padding-top: {{ block.settings.pc_padding_top }}px;
|
|
204
|
+
padding-bottom: {{ block.settings.pc_padding_bottom }}px;
|
|
205
|
+
padding-left: 0px;
|
|
206
|
+
padding-right: 0px;
|
|
207
|
+
width: 100%;
|
|
208
|
+
}
|
|
209
|
+
#shopify-block-{{ block.id }} .swiper-wrapper {
|
|
210
|
+
display: flex;
|
|
211
|
+
gap: {{ block.settings.pc_gap }}px;
|
|
212
|
+
justify-content: {{ block.settings.pc_justify }};
|
|
213
|
+
align-items: {{ block.settings.pc_align }};
|
|
214
|
+
width: {{ block.settings.pc_lg_width }}vw;
|
|
215
|
+
margin: 0 auto;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@media (min-width: 1280px) {
|
|
220
|
+
#shopify-block-{{ block.id }} .swiper-wrapper {
|
|
221
|
+
width: {{ block.settings.pc_xl_width }}px;
|
|
222
|
+
margin: 0 auto;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@media screen and (max-width: 1023px) {
|
|
227
|
+
#shopify-block-{{ block.id }} .swiper-wrapper {
|
|
228
|
+
padding-bottom: 60px;
|
|
229
|
+
}
|
|
230
|
+
#shopify-block-{{ block.id }} .swiper-slide {
|
|
231
|
+
width: calc(100% - 40px);
|
|
232
|
+
height: {{ block.settings.swiper_slide_height }}px;
|
|
233
|
+
overflow: hidden;
|
|
234
|
+
}
|
|
235
|
+
#shopify-block-{{ block.id }} .swiper-button-next,
|
|
236
|
+
#shopify-block-{{ block.id }} .swiper-button-prev {
|
|
237
|
+
z-index: 99;
|
|
238
|
+
top: unset;
|
|
239
|
+
bottom: 0;
|
|
240
|
+
width: 36px;
|
|
241
|
+
height: 36px;
|
|
242
|
+
}
|
|
243
|
+
#shopify-block-{{ block.id }} .swiper-button-next:after,
|
|
244
|
+
#shopify-block-{{ block.id }} .swiper-button-prev:after {
|
|
245
|
+
display: none;
|
|
246
|
+
}
|
|
247
|
+
#shopify-block-{{ block.id }} .swiper-button-prev {
|
|
248
|
+
left: 50%;
|
|
249
|
+
transform: translate(-{{ btn_offset }}px, 0px);
|
|
250
|
+
}
|
|
251
|
+
#shopify-block-{{ block.id }} .swiper-button-next {
|
|
252
|
+
left: unset;
|
|
253
|
+
right: 50%;
|
|
254
|
+
transform: translate({{ btn_offset }}px, 0px);
|
|
255
|
+
}
|
|
256
|
+
#shopify-block-{{ block.id }} .swiper-pagination-bullets .swiper-pagination-bullet {
|
|
257
|
+
margin: 0 4px;
|
|
258
|
+
width: 6px;
|
|
259
|
+
height: 6px;
|
|
260
|
+
{% if block.settings.swiper_nav_style == 'light' %}
|
|
261
|
+
background: #000000;
|
|
262
|
+
opacity: 0.3;
|
|
263
|
+
{% else %}
|
|
264
|
+
background: #ffffff;
|
|
265
|
+
opacity: 0.5;
|
|
266
|
+
{% endif %}
|
|
267
|
+
}
|
|
268
|
+
#shopify-block-{{ block.id }} .swiper-pagination-bullets .swiper-pagination-bullet.swiper-pagination-bullet-active {
|
|
269
|
+
width: 6px;
|
|
270
|
+
opacity: 1;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
</style>
|