zz-shopify-components 0.25.1-beta.2 → 0.25.1-beta.4

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.
@@ -16,6 +16,16 @@
16
16
  "label": "移动标题内容 (Mobile Title Content)",
17
17
  "default": "<p>这里是标题</p>"
18
18
  },
19
+ {
20
+ "type": "select",
21
+ "id": "comment_color",
22
+ "label": "评论颜色风格",
23
+ "options": [
24
+ { "value": "light", "label": "浅色" },
25
+ { "value": "dark", "label": "深色" },
26
+ ],
27
+ "default": "light"
28
+ },
19
29
  {
20
30
  "type": "richtext",
21
31
  "id": "pc_description",
@@ -203,26 +213,64 @@
203
213
  {% if block_size > 0 %}
204
214
  <div class="comment-content tw-absolute max-lg:tw-top-[-10px] max-lg:tw-right-[-20px] lg:tw-top-[20px] lg:tw-right-[-40px] tw-z-10">
205
215
  <div class="comment-btn lg:tw-w-[40px] lg:tw-h-[40px] max-lg:tw-w-[28px] max-lg:tw-h-[28px]">
206
- <svg class="max-lg:tw-hidden" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
207
- <path d="M20 0.5C30.7696 0.5 39.5 9.23045 39.5 20C39.5 30.7696 30.7696 39.5 20 39.5C9.23045 39.5 0.5 30.7696 0.5 20C0.5 9.23045 9.23045 0.5 20 0.5Z" stroke="white" stroke-opacity="0.15"/>
208
- <circle cx="13" cy="20" r="2" fill="white" fill-opacity="0.6"/>
209
- <circle cx="20" cy="20" r="2" fill="white" fill-opacity="0.6"/>
210
- <circle cx="27" cy="20" r="2" fill="white" fill-opacity="0.6"/>
211
- </svg>
212
- <svg class="lg:tw-hidden" width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
213
- <rect x="0.352941" y="0.352941" width="27.2941" height="27.2941" rx="13.6471" stroke="white" stroke-opacity="0.15" stroke-width="0.705882"/>
214
- <circle cx="9" cy="14" r="1.5" fill="white" fill-opacity="0.6"/>
215
- <circle cx="14" cy="14" r="1.5" fill="white" fill-opacity="0.6"/>
216
- <circle cx="19" cy="14" r="1.5" fill="white" fill-opacity="0.6"/>
217
- </svg>
216
+ {% if block.settings.comment_color == 'dark' %}
217
+ <svg class="max-lg:tw-hidden" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
218
+ <foreignObject x="-12" y="-12" width="64" height="64"><div xmlns="http://www.w3.org/1999/xhtml" style="backdrop-filter:blur(6px);clip-path:url(#bgblur_0_1304_6600_clip_path);height:100%;width:100%"></div></foreignObject><g data-figma-bg-blur-radius="12">
219
+ <path d="M0 20C0 8.95431 8.95431 0 20 0C31.0457 0 40 8.95431 40 20C40 31.0457 31.0457 40 20 40C8.95431 40 0 31.0457 0 20Z" fill="black" fill-opacity="0.03"/>
220
+ <path d="M20 0.5C30.7696 0.5 39.5 9.23045 39.5 20C39.5 30.7696 30.7696 39.5 20 39.5C9.23045 39.5 0.5 30.7696 0.5 20C0.5 9.23045 9.23045 0.5 20 0.5Z" stroke="black" stroke-opacity="0.06"/>
221
+ <circle cx="13" cy="20" r="2" fill="black" fill-opacity="0.6"/>
222
+ <circle cx="20" cy="20" r="2" fill="black" fill-opacity="0.6"/>
223
+ <circle cx="27" cy="20" r="2" fill="black" fill-opacity="0.6"/>
224
+ </g>
225
+ <defs>
226
+ <clipPath id="bgblur_0_1304_6600_clip_path" transform="translate(12 12)"><path d="M0 20C0 8.95431 8.95431 0 20 0C31.0457 0 40 8.95431 40 20C40 31.0457 31.0457 40 20 40C8.95431 40 0 31.0457 0 20Z"/>
227
+ </clipPath></defs>
228
+ </svg>
229
+
230
+ <svg class="lg:tw-hidden" width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
231
+ <foreignObject x="-12" y="-12" width="52" height="52"><div xmlns="http://www.w3.org/1999/xhtml" style="backdrop-filter:blur(6px);clip-path:url(#bgblur_0_1226_995_clip_path);height:100%;width:100%"></div></foreignObject><g data-figma-bg-blur-radius="12">
232
+ <path d="M0 14C0 6.26801 6.26801 0 14 0C21.732 0 28 6.26801 28 14C28 21.732 21.732 28 14 28C6.26801 28 0 21.732 0 14Z" fill="black" fill-opacity="0.03"/>
233
+ <path d="M14 0.5C21.4558 0.5 27.5 6.54416 27.5 14C27.5 21.4558 21.4558 27.5 14 27.5C6.54416 27.5 0.5 21.4558 0.5 14C0.5 6.54416 6.54416 0.5 14 0.5Z" stroke="black" stroke-opacity="0.06"/>
234
+ <circle cx="9" cy="14" r="1.5" fill="black" fill-opacity="0.6"/>
235
+ <circle cx="14" cy="14" r="1.5" fill="black" fill-opacity="0.6"/>
236
+ <circle cx="19" cy="14" r="1.5" fill="black" fill-opacity="0.6"/>
237
+ </g>
238
+ <defs>
239
+ <clipPath id="bgblur_0_1226_995_clip_path" transform="translate(12 12)"><path d="M0 14C0 6.26801 6.26801 0 14 0C21.732 0 28 6.26801 28 14C28 21.732 21.732 28 14 28C6.26801 28 0 21.732 0 14Z"/>
240
+ </clipPath></defs>
241
+ </svg>
242
+
243
+
244
+ {% else %}
245
+ <svg class="max-lg:tw-hidden" width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
246
+ <path d="M20 0.5C30.7696 0.5 39.5 9.23045 39.5 20C39.5 30.7696 30.7696 39.5 20 39.5C9.23045 39.5 0.5 30.7696 0.5 20C0.5 9.23045 9.23045 0.5 20 0.5Z" stroke="white" stroke-opacity="0.15"/>
247
+ <circle cx="13" cy="20" r="2" fill="white" fill-opacity="0.6"/>
248
+ <circle cx="20" cy="20" r="2" fill="white" fill-opacity="0.6"/>
249
+ <circle cx="27" cy="20" r="2" fill="white" fill-opacity="0.6"/>
250
+ </svg>
251
+ <svg class="lg:tw-hidden" width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
252
+ <rect x="0.352941" y="0.352941" width="27.2941" height="27.2941" rx="13.6471" stroke="white" stroke-opacity="0.15" stroke-width="0.705882"/>
253
+ <circle cx="9" cy="14" r="1.5" fill="white" fill-opacity="0.6"/>
254
+ <circle cx="14" cy="14" r="1.5" fill="white" fill-opacity="0.6"/>
255
+ <circle cx="19" cy="14" r="1.5" fill="white" fill-opacity="0.6"/>
256
+ </svg>
257
+ {% endif %}
258
+
218
259
 
219
260
  </div>
220
261
  <div class="comment-number-div tw-items-center tw-justify-center lg:tw-pl-[20px] lg:tw-pr-[12px] lg:tw-py-[9px] tw-font-medium
221
- tw-text-white lg:tw-text-[16px]">
262
+ lg:tw-text-[16px]">
222
263
  {{ block.settings.modal_title }}
223
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
224
- <path d="M11.0005 7.05025L15.9503 12L11.0005 16.9497" stroke="white" stroke-opacity="0.7" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
225
- </svg>
264
+ {% if block.settings.comment_color == 'dark' %}
265
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
266
+ <path d="M11.0005 7.05025L15.9503 12L11.0005 16.9497" stroke="black" stroke-opacity="0.5" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
267
+ </svg>
268
+ {% else %}
269
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
270
+ <path d="M11.0005 7.05025L15.9503 12L11.0005 16.9497" stroke="white" stroke-opacity="0.7" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
271
+ </svg>
272
+ {% endif %}
273
+
226
274
 
227
275
  </div>
228
276
  </div>
@@ -231,16 +279,24 @@
231
279
 
232
280
  </div>
233
281
 
234
- {% if block_size > 0 %}
282
+ {% if block_size > 0 %}
235
283
 
236
284
  <div class="comment-list-popup tw-p-[20px] tw-absolute tw-opacity-0 tw-rounded-[16px]">
237
285
  <div class="comment-list-popup-header tw-h-[24px] tw-flex tw-items-center tw-justify-between tw-pb-[16px]">
238
- <h4 class="tw-font-semibold tw-text-[12px] tw-text-white">{{ block.settings.modal_title }}</h4>
286
+ <h4 class="comment-list-popup-header-title tw-font-semibold tw-text-[12px]">{{ block.settings.modal_title }}</h4>
239
287
  <div class="close-modal-btn tw-ml-[20px] tw-cursor-pointer">
240
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
241
- <path d="M6.34766 6.34375L17.6614 17.6575" stroke="white" stroke-width="1.5" stroke-linecap="round"/>
242
- <path d="M6.34766 17.6562L17.6614 6.34254" stroke="white" stroke-width="1.5" stroke-linecap="round"/>
243
- </svg>
288
+ {% if block.settings.comment_color == 'dark' %}
289
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
290
+ <path d="M6.34766 6.34326L17.6614 17.657" stroke="black" stroke-width="1.5" stroke-linecap="round"/>
291
+ <path d="M6.34766 17.6567L17.6614 6.34303" stroke="black" stroke-width="1.5" stroke-linecap="round"/>
292
+ </svg>
293
+ {% else %}
294
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
295
+ <path d="M6.34766 6.34375L17.6614 17.6575" stroke="white" stroke-width="1.5" stroke-linecap="round"/>
296
+ <path d="M6.34766 17.6562L17.6614 6.34254" stroke="white" stroke-width="1.5" stroke-linecap="round"/>
297
+ </svg>
298
+ {% endif %}
299
+
244
300
  </div>
245
301
 
246
302
  </div>
@@ -250,10 +306,30 @@
250
306
  </div>
251
307
  {% endif %}
252
308
 
309
+
310
+
311
+
312
+
313
+
253
314
  <style>
254
315
  #shopify-block-{{ block.id }} {
255
316
  margin-top: {{ block.settings.mobile_margin_top }}px;
256
317
  margin-bottom: {{ block.settings.mobile_margin_bottom }}px;
318
+ {% if block.settings.comment_color == 'dark' %}
319
+ --zz-comment-text: #000000;
320
+ --zz-comment-list-bg-color: #FFFFFFCC;
321
+ --zz-comment-border-color: #0000000F;
322
+ --zz-comment-number-bg-color: #00000008;
323
+ --zz-comment-border-shadow: rgba(0, 0, 0, 0.2);
324
+ --zz-comment-border-shadow-end: rgba(0, 0, 0, 0);
325
+ {% else %}
326
+ --zz-comment-text: #FFFFFF;
327
+ --zz-comment-list-bg-color: #000000CC;
328
+ --zz-comment-border-color: #FFFFFF4D;
329
+ --zz-comment-number-bg-color: #0000004D;
330
+ --zz-comment-border-shadow: rgba(255, 255, 255, 0.4);
331
+ --zz-comment-border-shadow-end: rgba(255, 255, 255, 0);
332
+ {% endif %}
257
333
  }
258
334
  #shopify-block-{{ block.id }} .title-block {
259
335
  text-align: {{ block.settings.mobile_align }};
@@ -268,13 +344,19 @@
268
344
  #shopify-block-{{ block.id }} .comment-list-popup {
269
345
  display: none;
270
346
  width: 352px;
271
- background: #000000CC;
272
- border: 1px solid #FFFFFF4D;
347
+ background: var(--zz-comment-list-bg-color);
348
+ border: 1px solid var(--zz-comment-border-color);
273
349
  backdrop-filter: blur(20px);
274
350
  pointer-events: none;
275
351
  transform: translateY(6px);
276
352
  transition: opacity .18s ease, transform .18s ease;
277
353
  }
354
+ #shopify-block-{{ block.id }} .comment-list-popup-header, #shopify-block-{{ block.id }} .comment-list-popup-header-title {
355
+ color: var(--zz-comment-text);
356
+ }
357
+ #shopify-block-{{ block.id }} .comment-number-div {
358
+ color: var(--zz-comment-text);
359
+ }
278
360
  #shopify-block-{{ block.id }} .comment-list-popup.visible {
279
361
  display: block;
280
362
  opacity: 1;
@@ -292,8 +374,8 @@
292
374
  animation: pulse 1.5s infinite;
293
375
  }
294
376
  #shopify-block-{{ block.id }} .comment-number-div {
295
- background: #0000004D;
296
- border: 0.7px solid #FFFFFF4D;
377
+ background: var(--zz-comment-number-bg-color);
378
+ border: 0.7px solid var(--zz-comment-border-color);
297
379
  backdrop-filter: blur(12px);
298
380
  display: none;
299
381
  transition: opacity .25s ease;
@@ -327,7 +409,7 @@
327
409
  height: 100%;
328
410
  border-radius: 50%;
329
411
  transform: translate(-50%, -50%);
330
- box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
412
+ box-shadow: 0 0 0 0 var(--zz-comment-border-shadow);
331
413
  animation: pulse-wave 1.5s infinite;
332
414
  }
333
415
 
@@ -335,10 +417,10 @@
335
417
  /* 波浪扩散动画 */
336
418
  @keyframes pulse-wave {
337
419
  0% {
338
- box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
420
+ box-shadow: 0 0 0 0 var(--zz-comment-border-shadow);
339
421
  }
340
422
  100% {
341
- box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
423
+ box-shadow: 0 0 0 15px var(--zz-comment-border-shadow-end);
342
424
  }
343
425
  }
344
426
 
@@ -16,7 +16,7 @@
16
16
  overflow: hidden;
17
17
  position: relative;
18
18
  }
19
- #shopify-block-{{block.id}} .zz-video-swiper-preview {
19
+ #shopify-block-{{block.id}} .zz-video-swiper-preview-jp {
20
20
  width: 100%;
21
21
  box-sizing: border-box;
22
22
  overflow: hidden;
@@ -25,20 +25,15 @@
25
25
  letter-spacing: 0;
26
26
  }
27
27
 
28
- #shopify-block-{{block.id}} .swiper-button-next,
29
- #shopify-block-{{block.id}} .swiper-button-prev {
30
- top: 0;
31
- width: 48px;
32
- height: 48px;
33
- }
34
- #shopify-block-{{block.id}} .swiper-button-prev {
35
- left: unset;
36
- right: 50%;
37
- }
38
- #shopify-block-{{block.id}} .swiper-button-next {
39
- right: unset;
40
- left: 50%;
41
- }
28
+ {% if block.settings.fixed_height == true %}
29
+ #shopify-block-{{block.id}} .swiper-wrapper {
30
+ align-items: stretch;
31
+ }
32
+
33
+ {% endif %}
34
+
35
+
36
+
42
37
  #shopify-block-{{block.id}} .swiper-button-next:after,
43
38
  #shopify-block-{{block.id}} .swiper-button-prev:after {
44
39
  display: none;
@@ -47,7 +42,7 @@
47
42
  opacity: 0.5;
48
43
  }
49
44
 
50
- #shopify-block-{{block.id}} .zz-video-swiper-preview .swiper-pagination-bullets .swiper-pagination-bullet {
45
+ #shopify-block-{{block.id}} .zz-video-swiper-preview-jp .swiper-pagination-bullets .swiper-pagination-bullet {
51
46
  margin: 0 8px;
52
47
  width: 48px;
53
48
  height: 4px;
@@ -56,14 +51,14 @@
56
51
  opacity: 1;
57
52
  transition: 0.3s;
58
53
  }
59
- #shopify-block-{{block.id}} .zz-video-swiper-preview .swiper-pagination-bullets .swiper-pagination-bullet-active {
54
+ #shopify-block-{{block.id}} .zz-video-swiper-preview-jp .swiper-pagination-bullets .swiper-pagination-bullet-active {
60
55
  position: relative;
61
56
  width: 120px;
62
57
  {% if block.settings.if_autoplay == false %}
63
58
  background-color: {{ block.settings.pagination_color }};
64
59
  {% endif %}
65
60
  }
66
- #shopify-block-{{block.id}} .zz-video-swiper-preview .swiper-pagination-bullets .swiper-pagination-bullet-active .progress-line {
61
+ #shopify-block-{{block.id}} .zz-video-swiper-preview-jp .swiper-pagination-bullets .swiper-pagination-bullet-active .progress-line {
67
62
  display: block;
68
63
  position: absolute;
69
64
  width:0;
@@ -78,13 +73,13 @@
78
73
  }
79
74
 
80
75
  @media screen and (max-width: 1023px) {
81
- #shopify-block-{{block.id}} .zz-video-swiper-preview {
76
+ #shopify-block-{{block.id}} .zz-video-swiper-preview-jp {
82
77
  padding-bottom: 68px;
83
78
  padding-left: 20px;
84
79
  padding-right: 20px;
85
80
  }
86
81
 
87
- #shopify-block-{{block.id}} .zz-video-swiper-preview .swiper-slide .banner-item::after {
82
+ #shopify-block-{{block.id}} .zz-video-swiper-preview-jp .swiper-slide .banner-item::after {
88
83
  display: none;
89
84
  }
90
85
  #shopify-block-{{block.id}} .swiper-button-next,
@@ -104,49 +99,79 @@
104
99
  right: 50%;
105
100
  transform: translate({{ btn_offset }}px, 0px);
106
101
  }
107
- #shopify-block-{{block.id}} .zz-video-swiper-preview .swiper-pagination-bullets .swiper-pagination-bullet {
102
+ #shopify-block-{{block.id}} .zz-video-swiper-preview-jp .swiper-pagination-bullets .swiper-pagination-bullet {
108
103
  margin: 0 4px;
109
104
  width: 6px;
110
105
  height: 6px;
111
106
  background-color: {{ block.settings.mb_pagination_color | color_modify: 'alpha', 0.3 }};
112
107
  }
113
- #shopify-block-{{block.id}} .zz-video-swiper-preview .swiper-pagination-bullets .swiper-pagination-bullet.swiper-pagination-bullet-active {
108
+ #shopify-block-{{block.id}} .zz-video-swiper-preview-jp .swiper-pagination-bullets .swiper-pagination-bullet.swiper-pagination-bullet-active {
114
109
  width: 6px;
115
110
  background-color: {{ block.settings.mb_pagination_color }};
116
111
  }
117
112
  }
118
113
  @media screen and (min-width: 1024px) {
119
- #shopify-block-{{block.id}} .zz-video-swiper-preview {
114
+ #shopify-block-{{block.id}} .zz-video-swiper-preview-jp {
120
115
  padding-bottom: 68px;
116
+ {% if block.settings.if_center == false %}
117
+ padding-left: 10vw;
118
+ {% endif %}
119
+ }
120
+ #shopify-block-{{block.id}} .swiper-button-next.swiper-button-disabled, #shopify-block-{{block.id}} .swiper-button-prev.swiper-button-disabled {
121
+ display: none;
121
122
  }
122
- #shopify-block-{{block.id}} .zz-video-swiper-preview .swiper-pagination-bullets {
123
+ #shopify-block-{{block.id}} .zz-video-swiper-preview-jp .swiper-pagination-bullets {
123
124
  bottom: 21px;
124
125
  }
126
+ #shopify-block-{{block.id}} .swiper-button-next,
127
+ #shopify-block-{{block.id}} .swiper-button-prev {
128
+ top: 0;
129
+ width: 48px;
130
+ height: 48px;
131
+ }
132
+ {% if block.settings.prev_next_position == 'pos'%}
125
133
  #shopify-block-{{block.id}} .swiper-button-prev {
134
+ left: 50%;
126
135
  transform: translate(-500px, 220px);
127
136
  }
128
137
  #shopify-block-{{block.id}} .swiper-button-next {
129
138
  transform: translate(500px, 220px);
139
+ right: 50%;
130
140
  }
131
-
132
-
133
-
134
-
135
- }
136
- @media screen and (min-width: 1280px) {
137
-
141
+ {% else %}
138
142
  #shopify-block-{{block.id}} .swiper-button-prev {
139
- transform: translate(-594px, 260px);
143
+ left: 48px;
144
+ top: 50% !important;
145
+ transform: translate(-0px, -50%);
140
146
  }
141
147
  #shopify-block-{{block.id}} .swiper-button-next {
142
- transform: translate(594px, 260px);
148
+ top: 50% !important;
149
+ transform: translate(0px, -50%);
150
+ right: 48px;
143
151
  }
152
+
153
+ {% endif %}
154
+
155
+
156
+ }
157
+ @media screen and (min-width: 1280px) {
158
+ {% if block.settings.prev_next_position == 'pos'%}
159
+ #shopify-block-{{block.id}} .swiper-button-prev {
160
+ transform: translate(-594px, 260px);
161
+ }
162
+ #shopify-block-{{block.id}} .swiper-button-next {
163
+ transform: translate(594px, 260px);
164
+ }
165
+ {% endif %}
166
+ {% if block.settings.if_center == false %}
167
+ padding-left: calc((100vw - 1220px)/2);
168
+ {% endif %}
144
169
 
145
170
  }
146
171
  </style>
147
172
 
148
173
  <div
149
- class='zz-video-swiper-preview zz-video-swiper-preview-{{ block.id }}'
174
+ class='zz-video-swiper-preview-jp zz-video-swiper-preview-jp-{{ block.id }}'
150
175
  >
151
176
  <div class='swiper-wrapper'>
152
177
  {% content_for 'blocks' %}
@@ -204,7 +229,12 @@
204
229
 
205
230
  <script>
206
231
  document.addEventListener('DOMContentLoaded', function () {
207
- const swiperClassName = '.zz-video-swiper-preview-{{ block.id }}';
232
+ const swiperClassName = '.zz-video-swiper-preview-jp-{{ block.id }}';
233
+ const mbSpace = {{ block.settings.mb_space }};
234
+ const pcSpace = {{ block.settings.pc_space }};
235
+ const autoHeight = {{ block.settings.fixed_height }};
236
+ const centeredSlides = {{ block.settings.if_center }};
237
+ const initialSlide = {{ block.settings.pc_initial_slide }} - 1;
208
238
  let isDesktop = window.innerWidth > 1023;
209
239
  // 获取 class zz-accessories-swiper 的元素 且data-id 为 block.id 的元素
210
240
  const zzAccessoriesSwiper = document.querySelector(swiperClassName);
@@ -220,15 +250,16 @@
220
250
 
221
251
  const prevSwiper = new Swiper(swiperClassName, {
222
252
  slidesPerView: 'auto',
223
- initialSlide: isDesktop ? 1 : 0,
224
- centeredSlides: isDesktop ? true : false,
225
- spaceBetween: isDesktop ? 24 : 12,
253
+ autoHeight: autoHeight,
254
+ initialSlide: isDesktop ? initialSlide : 0,
255
+ centeredSlides: isDesktop ? centeredSlides : false,
256
+ spaceBetween: isDesktop ? pcSpace : mbSpace,
226
257
  navigation: {
227
- nextEl: '.swiper-button-next',
228
- prevEl: '.swiper-button-prev',
258
+ nextEl: zzAccessoriesSwiper.querySelector('.swiper-button-next'),
259
+ prevEl: zzAccessoriesSwiper.querySelector('.swiper-button-prev'),
229
260
  },
230
261
  pagination: {
231
- el: '.swiper-pagination',
262
+ el: zzAccessoriesSwiper.querySelector('.swiper-pagination'),
232
263
  clickable: true,
233
264
  renderBullet: function (index, className) {
234
265
  return `
@@ -288,33 +319,7 @@
288
319
  if (swiperWrapper) {
289
320
  observer.observe(swiperWrapper);
290
321
  }
291
-
292
- function getVisibleDisplayMedias(container) {
293
- const videos = container.querySelectorAll('video');
294
- const video = Array.from(videos).find((video) => {
295
- const style = window.getComputedStyle(video);
296
- return style.display !== 'none';
297
- });
298
- if (video) {
299
- return {
300
- video,
301
- type: 'video',
302
- };
303
- } else {
304
- const images = container.querySelectorAll('img');
305
- const image = Array.from(images).find((image) => {
306
- const style = window.getComputedStyle(image);
307
- return style.display !== 'none';
308
- });
309
- if (image) {
310
- return {
311
- image,
312
- type: 'image',
313
- };
314
- }
315
- }
316
- return null;
317
- }
322
+
318
323
  const endedHandler = function () {
319
324
 
320
325
  if (prevSwiper.isEnd) {
@@ -447,6 +452,30 @@
447
452
  "label": "是否自动轮播",
448
453
  "default": false
449
454
  },
455
+ {
456
+ "type": "number",
457
+ "id": "pc_space",
458
+ "label": "PC 端间距",
459
+ "default": 24
460
+ },
461
+ {
462
+ "type": "number",
463
+ "id": "mb_space",
464
+ "label": "Mobile 端间距",
465
+ "default": 12
466
+ },
467
+ {
468
+ "type": "number",
469
+ "id": "pc_initial_slide",
470
+ "label": "PC 端初始化显示第几个",
471
+ "default": 2
472
+ },
473
+ {
474
+ "type": "checkbox",
475
+ "id": "if_center",
476
+ "label": "是否居中显示",
477
+ "default": true,
478
+ },
450
479
  {
451
480
  "type": "select",
452
481
  "id": "prev_next_type",
@@ -457,25 +486,56 @@
457
486
  ],
458
487
  "default": "dark"
459
488
  },
489
+ {
490
+ "type": "select",
491
+ "id": "prev_next_position",
492
+ "label": "pc端 prev next 位置",
493
+ "options": [
494
+ { "value": "pos", "label": "固定位置" },
495
+ { "value": "left_right", "label": "左右排列" },
496
+ ],
497
+ "default": "pos"
498
+ },
499
+ {
500
+ "type": "checkbox",
501
+ "id": "if_mb_btn",
502
+ "label": "移动端展示切换按钮",
503
+ "default": true
504
+ },
460
505
  {
461
506
  "type": "image_picker",
462
507
  "id": "prev_icon",
463
- "label": "轮播上一张图标 Mobile"
508
+ "label": "轮播上一张图标 Mobile",
509
+ "visible_if": "{{ block.settings.if_mb_btn == true }}"
464
510
  },
465
511
  {
466
512
  "type": "image_picker",
467
513
  "id": "next_icon",
468
- "label": "轮播下一张图标 Mobile"
514
+ "label": "轮播下一张图标 Mobile",
515
+ "visible_if": "{{ block.settings.if_mb_btn == true }}"
469
516
  },
517
+ {
518
+ "type": "checkbox",
519
+ "id": "fixed_height",
520
+ "label": "强制高度一致",
521
+ "default": false
522
+ }
470
523
  ],
471
524
  "blocks": [
472
525
  {
473
526
  "type": "zz-video-swiper-jp-item"
527
+ },
528
+ {
529
+ "type": "zz-swiper-comment-item"
530
+ },
531
+ {
532
+ "type": "zz-swiper-blog-item"
474
533
  }
475
534
  ],
476
535
  "presets": [
477
536
  {
478
- "name": "Video Swiper JP Preview"
537
+ "name": "Video Swiper JP Preview",
538
+ "category": "Swiper Block"
479
539
  },
480
540
  ]
481
541
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zz-shopify-components",
3
- "version": "0.25.1-beta.2",
3
+ "version": "0.25.1-beta.4",
4
4
  "description": "Reusable Shopify components for theme projects",
5
5
  "keywords": [
6
6
  "shopify",
@@ -1,6 +1,7 @@
1
1
  {% schema %}
2
2
  {
3
3
  "name": "ZZ Flex Layout Section",
4
+ "class": "zz-flex-layout-section",
4
5
  "tag": "section",
5
6
  "settings": [
6
7
  {
@@ -91,7 +91,7 @@
91
91
  display:none;
92
92
  }
93
93
 
94
- #shopify-section-{{section.id}} .swiper-horizontal>.swiper-pagination-bullets, .swiper-pagination-bullets.swiper-pagination-horizontal{
94
+ #shopify-section-{{section.id}} .swiper-horizontal>.swiper-pagination-bullets, #shopify-section-{{section.id}} .swiper-pagination-bullets.swiper-pagination-horizontal{
95
95
  bottom:30px;
96
96
  }
97
97
 
@@ -647,25 +647,25 @@
647
647
  <div class='swiper-content-text lg:tw-w-[560px]'>
648
648
  {%- if banner.settings.desc_text_type == 'text' -%}
649
649
  <div
650
- class='lg:tw-hidden tw-p-0 tw-leading-[58px] tw-text-[48px] tw-font-bold tw-mb-[24px] max-lg:tw-my-[8px] max-lg:tw-text-[24px] max-lg:tw-leading-[1.2] max-lg:tw-text-center'
650
+ class='lg:tw-hidden tw-p-0 tw-font-bold tw-mb-[24px] max-lg:tw-my-[8px] max-lg:tw-text-[24px] max-lg:tw-leading-[1.2] max-lg:tw-text-center'
651
651
  style='color: {{ banner.settings.color | default: 'white' }};'
652
652
  >
653
653
  {{ banner.settings.title_mb }}
654
654
  </div>
655
655
  <div
656
- class='max-lg:tw-hidden tw-p-0 tw-leading-[58px] tw-text-[48px] tw-font-bold tw-mb-[24px] max-lg:tw-my-[8px] max-lg:tw-text-[24px] max-lg:tw-leading-[1.2] max-lg:tw-text-center'
656
+ class='max-lg:tw-hidden tw-p-0 tw-leading-[1.2] {% if section.settings.site == 'central' %}tw-text-[48px]{% else %}tw-text-[40px]{% endif %} tw-font-bold tw-mb-[24px] max-lg:tw-my-[8px] max-lg:tw-text-[24px] max-lg:tw-leading-[1.2] max-lg:tw-text-center'
657
657
  style='color: {{ banner.settings.color | default: 'white' }};'
658
658
  >
659
659
  {{ banner.settings.title }}
660
660
  </div>
661
661
  <div
662
- class='lg:tw-hidden tw-p-0 tw-m-0 tw-leading-[1.5] tw-text-[28px] tw-font-medium max-lg:tw-text-[14px] max-lg:tw-text-center'
662
+ class='lg:tw-hidden tw-p-0 tw-m-0 tw-leading-[1.5] tw-font-medium max-lg:tw-text-[14px] max-lg:tw-text-center'
663
663
  style='color: {{ banner.settings.color | default: 'white' }}'
664
664
  >
665
665
  {{ banner.settings.subtitle_mb }}
666
666
  </div>
667
667
  <div
668
- class='max-lg:tw-hidden tw-p-0 tw-m-0 tw-leading-[1.5] tw-text-[28px] tw-font-medium max-lg:tw-text-[14px] max-lg:tw-text-center'
668
+ class='max-lg:tw-hidden tw-p-0 tw-m-0 tw-leading-[1.5] {% if section.settings.site == 'central' %}tw-text-[28px]{% else %}tw-text-[20px]{% endif %} tw-font-medium max-lg:tw-text-[14px] max-lg:tw-text-center'
669
669
  style='color: {{ banner.settings.color | default: 'white' }}'
670
670
  >
671
671
  {{ banner.settings.subtitle }}
@@ -418,7 +418,6 @@
418
418
 
419
419
  <style>
420
420
  #shopify-section-{{section.id}} {
421
- position: relative;
422
421
  background: {{ section.settings.bg_color }};
423
422
  display: flex;
424
423
  flex-direction: column;
@@ -185,12 +185,6 @@
185
185
  "id": "row_content",
186
186
  "label": "description"
187
187
  },
188
- {
189
- "type": "color",
190
- "id": "title_color",
191
- "default": "#000000",
192
- "label": "标题颜色",
193
- },
194
188
  {
195
189
  "type": "video",
196
190
  "id": "video_pc",
@@ -314,7 +308,7 @@
314
308
  <div class="tw-daisy-collapse collapse-arrow tw-daisy-join-item ">
315
309
  <input type="radio" name="my-accordion-{{ section.id }}" value="{{ forloop.index }}" {% if forloop.first %}checked data-last-checked="true"{% endif %} style="cursor: pointer;" />
316
310
  {% assign collapsible_title_color = section.settings.collapsible_title_color
317
- | color_modify: 'alpha', 0.6
311
+ | color_modify: 'alpha', 0.7
318
312
  %}
319
313
  <div class="tw-daisy-collapse-title tw-py-[20px] tw-px-0 tw-text-[20px] tw-font-[700] tw-leading-[1]" style="color: {{ collapsible_title_color }};">
320
314
  {{ collapsible_row.settings.heading }}
@@ -417,7 +411,13 @@
417
411
 
418
412
  }
419
413
  #shopify-section-{{section.id}} .tw-daisy-collapse {
420
- border-bottom: 1px solid #4C4C4C;
414
+ {% if section.settings.collapse_button_color == 'black' %}
415
+ {% comment %} 黑色按钮,下划线也成黑色 {% endcomment %}
416
+ border-bottom: 1px solid rgba(0, 0, 0, 0.3);
417
+ {% else %}
418
+ border-bottom: 1px solid #4C4C4C;
419
+ {% endif %}
420
+
421
421
  }
422
422
 
423
423
  #shopify-section-{{section.id}} .row-content a {
@@ -470,7 +470,7 @@
470
470
 
471
471
  #shopify-section-{{section.id}} .swiper-button-next,
472
472
  #shopify-section-{{section.id}} .swiper-button-prev {
473
- z-index: 1;
473
+ z-index: 19;
474
474
  top: unset;
475
475
  bottom: 0;
476
476
  width: 36px;