zz-shopify-components 0.16.3-beta.4 → 0.16.3-beta.6

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.
@@ -1,3 +1,10 @@
1
+ html.zz-global-noscroll,
2
+ html.zz-global-noscroll body {
3
+ overflow: hidden !important;
4
+ position: relative;
5
+ height: 100% !important;
6
+ }
7
+
1
8
  /* tab radio组件 */
2
9
  .zz-radio-tabs {
3
10
  display: flex;
@@ -6,9 +13,11 @@
6
13
  border-radius: 32px;
7
14
  background: #F5F5F6;
8
15
  }
16
+
9
17
  body {
10
18
  overflow-x: hidden;
11
19
  }
20
+
12
21
  .zz-radio-tabs-black.zz-radio-tabs {
13
22
  background: #FFFFFF14;
14
23
  }
@@ -48,7 +57,7 @@ zz-radio-tabs-item {
48
57
  vertical-align: middle;
49
58
  height: 100%;
50
59
  white-space: nowrap;
51
-
60
+
52
61
  }
53
62
 
54
63
  .zz-radio-tabs-black.zz-radio-tabs .zz-radio-tabs-label {
@@ -64,12 +73,14 @@ zz-radio-tabs-item {
64
73
  background: #FFFFFF1F;
65
74
  color: #FFFFFF;
66
75
  }
76
+
67
77
  @media (min-width: 1024px) {
68
78
  .zz-radio-tabs {
69
- height: 48px;
79
+ height: 48px;
70
80
  }
81
+
71
82
  .zz-radio-tabs-label {
72
- font-size: 16px;
83
+ font-size: 16px;
73
84
  }
74
85
  }
75
86
 
@@ -102,29 +113,35 @@ zz-radio-tabs-item {
102
113
  background-size: 4px 4px, 4px 4px;
103
114
  background-repeat: no-repeat;
104
115
  }
116
+
105
117
  .zz-select:focus {
106
118
  border-color: #FC6C0F;
107
119
  outline: none;
108
120
  box-shadow: none;
109
121
  }
122
+
110
123
  @media (min-width: 1024px) {
111
124
  .zz-select {
112
- height: 40px;
113
- font-size: 14px;
125
+ height: 40px;
126
+ font-size: 14px;
114
127
  }
115
128
  }
129
+
116
130
  /* 内容描述 */
117
131
  .content-text strong {
118
132
  color: #000000;
119
133
  font-weight: inherit;
120
134
  }
135
+
121
136
  .content-text a {
122
137
  color: #378DDD;
123
138
  text-decoration: underline;
124
139
  }
140
+
125
141
  .content-text a:hover {
126
142
  opacity: 0.8;
127
143
  }
144
+
128
145
  .content-text ol {
129
146
  list-style: decimal;
130
147
  padding-left: 25px;
@@ -136,7 +153,7 @@ zz-radio-tabs-item {
136
153
  }
137
154
 
138
155
  /* 标题 */
139
- .zz-title-hx p{
156
+ .zz-title-hx p {
140
157
  margin: 0;
141
158
  }
142
159
 
@@ -153,11 +170,13 @@ zz-radio-tabs-item {
153
170
  border-radius: 4px;
154
171
  z-index: -1;
155
172
  }
173
+
156
174
  /* dialog 弹窗组件, PC中间弹出,移动端底部弹出 */
157
175
  body.zz-dialog-open {
158
176
  overflow: hidden;
159
177
  touch-action: none;
160
178
  }
179
+
161
180
  .zz-dialog-mask {
162
181
  position: fixed;
163
182
  inset: 0;
@@ -165,6 +184,7 @@ body.zz-dialog-open {
165
184
  display: none;
166
185
  z-index: 1000;
167
186
  }
187
+
168
188
  .zz-dialog {
169
189
  position: fixed;
170
190
  background: #fff;
@@ -174,38 +194,42 @@ body.zz-dialog-open {
174
194
  display: none;
175
195
  transition: all 0.3s ease;
176
196
  }
197
+
177
198
  @media (min-width: 1024px) {
178
199
  .zz-dialog {
179
- top: 50%;
180
- left: 50%;
181
- transform: translate(-50%, -50%) scale(0.7);
182
- opacity: 0;
200
+ top: 50%;
201
+ left: 50%;
202
+ transform: translate(-50%, -50%) scale(0.7);
203
+ opacity: 0;
183
204
 
184
205
  }
185
206
 
186
207
  .zz-dialog.show {
187
- transform: translate(-50%, -50%) scale(1);
188
- opacity: 1;
208
+ transform: translate(-50%, -50%) scale(1);
209
+ opacity: 1;
189
210
  }
190
211
  }
212
+
191
213
  @media (max-width: 1023px) {
192
214
  .zz-dialog {
193
- bottom: 0;
194
- left: 0;
195
- width: 100%;
196
- border-bottom-left-radius: 0;
197
- border-bottom-right-radius: 0;
198
- transform: translateY(100%);
215
+ bottom: 0;
216
+ left: 0;
217
+ width: 100%;
218
+ border-bottom-left-radius: 0;
219
+ border-bottom-right-radius: 0;
220
+ transform: translateY(100%);
199
221
  }
200
222
 
201
223
  .zz-dialog.show {
202
- transform: translateY(0);
224
+ transform: translateY(0);
203
225
  }
204
226
  }
227
+
205
228
  .zz-underline {
206
229
  text-decoration: none;
207
230
  border-bottom: 1px solid currentColor;
208
- padding-bottom: 2px; /* 调整位置 */
231
+ padding-bottom: 2px;
232
+ /* 调整位置 */
209
233
  }
210
234
 
211
235
  /* 按钮样式 zz-btn */
@@ -216,7 +240,7 @@ body.zz-dialog-open {
216
240
  height: 40px;
217
241
  padding: 0px 24px;
218
242
  border-radius: 4px;
219
- transition: opacity 0.2s cubic-bezier(.4,0,.2,1);
243
+ transition: opacity 0.2s cubic-bezier(.4, 0, .2, 1);
220
244
  outline: none;
221
245
  gap: 7px;
222
246
  font-weight: 500;
@@ -229,70 +253,84 @@ body.zz-dialog-open {
229
253
  background: #000000;
230
254
  color: #fff;
231
255
  }
256
+
232
257
  .zz-btn.zz-btn-primary.zz-btn-white {
233
258
  background: #fff;
234
259
  color: #000000;
235
260
  border: 1.5px solid #fff;
236
261
  }
262
+
237
263
  .zz-btn.zz-btn-primary.zz-btn-orange {
238
264
  background: #FC6C0F;
239
265
  color: #fff;
240
266
  }
267
+
241
268
  .zz-btn.zz-btn-primary.zz-btn-blue {
242
269
  background: #378DDD;
243
270
  color: #fff;
244
271
  }
272
+
245
273
  .zz-btn.zz-btn-primary.zz-btn-yellow {
246
274
  background: linear-gradient(139.02deg, #FFEB00 0.01%, #FFD400 100.55%);
247
275
  color: #000000;
248
276
  }
277
+
249
278
  .zz-btn.zz-btn-primary-round.zz-btn-black {
250
279
  background: #000000;
251
280
  color: #fff;
252
281
  border-radius: 30px;
253
282
  }
283
+
254
284
  .zz-btn.zz-btn-primary-round.zz-btn-white {
255
285
  background: #fff;
256
286
  color: #000000;
257
287
  border-radius: 30px;
258
288
  }
289
+
259
290
  .zz-btn.zz-btn-default.zz-btn-black {
260
291
  background: transparent;
261
292
  color: #000000;
262
293
  border: 1.5px solid #000000;
263
294
  }
295
+
264
296
  .zz-btn.zz-btn-default.zz-btn-white {
265
297
  background: transparent;
266
298
  color: #fff;
267
299
  border: 1.5px solid #fff;
268
300
  }
301
+
269
302
  .zz-btn.zz-btn-default.zz-btn-orange {
270
303
  background: transparent;
271
304
  color: #FC6C0F;
272
305
  border: 1.5px solid #FC6C0F;
273
306
  }
307
+
274
308
  .zz-btn.zz-btn-default.zz-btn-yellow {
275
309
  background: transparent;
276
310
  color: #000;
277
311
  border: 1.5px solid #FFEB00;
278
312
  }
313
+
279
314
  .zz-btn.zz-btn-default.zz-btn-blue {
280
315
  background: transparent;
281
316
  color: #378DDD;
282
317
  border: 1.5px solid #378DDD;
283
318
  }
319
+
284
320
  .zz-btn.zz-btn-round.zz-btn-black {
285
321
  background: transparent;
286
322
  color: #000000;
287
323
  border: 1.5px solid #000000;
288
324
  border-radius: 30px;
289
325
  }
326
+
290
327
  .zz-btn.zz-btn-round.zz-btn-white {
291
328
  background: transparent;
292
329
  color: #fff;
293
330
  border: 1.5px solid #fff;
294
331
  border-radius: 30px;
295
332
  }
333
+
296
334
  .zz-btn.zz-btn-round.zz-btn-orange {
297
335
  background: transparent;
298
336
  color: #ff9900;
@@ -303,12 +341,15 @@ body.zz-dialog-open {
303
341
  .zz-btn-link.zz-btn-blue {
304
342
  color: #378DDD;
305
343
  }
344
+
306
345
  .zz-btn-link.zz-btn-orange {
307
346
  color: #FC6C0F;
308
347
  }
348
+
309
349
  .zz-btn-link.zz-btn-white {
310
350
  color: #fff;
311
351
  }
352
+
312
353
  .zz-btn-link.zz-btn-black {
313
354
  color: #000000;
314
355
  }
@@ -325,56 +366,67 @@ body.zz-dialog-open {
325
366
  opacity: 0.5;
326
367
  cursor: not-allowed;
327
368
  }
369
+
328
370
  .zz-btn.zz-btn-large {
329
371
  height: 42px;
330
372
  padding: 0px 28px;
331
373
  }
374
+
332
375
  .zz-btn.zz-btn-small {
333
376
  height: 21px;
334
377
  padding: 0px 10px;
335
378
  font-size: 10px;
336
379
  }
380
+
337
381
  .zz-btn-link.zz-btn-link-small {
338
382
  font-size: 10px;
339
383
  }
384
+
340
385
  .zz-btn-link.zz-btn-link-large {
341
386
  font-size: 14px;
342
387
  }
343
388
 
344
389
  @media (min-width: 1024px) {
345
- .zz-btn.zz-btn-large {
346
- height: 48px;
347
- padding: 0px 32px;
348
- }
349
- .zz-btn.zz-btn-small {
350
- height: 26px;
351
- padding: 0px 10px;
352
- font-size: 14px;
353
- }
354
- .zz-btn-link.zz-btn-link-small {
355
- font-size: 12px;
356
- }
357
- .zz-btn-link.zz-btn-link-large {
358
- font-size: 16px;
359
- }
390
+ .zz-btn.zz-btn-large {
391
+ height: 48px;
392
+ padding: 0px 32px;
393
+ }
394
+
395
+ .zz-btn.zz-btn-small {
396
+ height: 26px;
397
+ padding: 0px 10px;
398
+ font-size: 14px;
399
+ }
400
+
401
+ .zz-btn-link.zz-btn-link-small {
402
+ font-size: 12px;
403
+ }
404
+
405
+ .zz-btn-link.zz-btn-link-large {
406
+ font-size: 16px;
407
+ }
360
408
  }
361
409
 
362
410
  .zz-btn-shape-round {
363
411
  border-radius: 90px;
364
412
  }
413
+
365
414
  .zz-video {
366
- border-radius: inherit;
415
+ border-radius: inherit;
367
416
  }
368
417
 
369
- .zz-toast-layer{
418
+ .zz-toast-layer {
370
419
  position: fixed;
371
420
  inset: 0;
372
421
  display: grid;
373
422
  place-items: center;
374
- pointer-events: none; /* 不阻挡点击 */
375
- z-index: 9999; /* 最高层 */
423
+ pointer-events: none;
424
+ /* 不阻挡点击 */
425
+ z-index: 9999;
426
+ /* 最高层 */
376
427
  }
377
- .zz-toast-box{
428
+
429
+ .zz-toast-box {
378
430
  pointer-events: auto;
379
431
  max-width: min(86vw, 520px);
380
432
  box-sizing: border-box;
@@ -393,17 +445,20 @@ body.zz-dialog-open {
393
445
  display: inline-flex;
394
446
 
395
447
  }
448
+
396
449
  .zz-toast-icon {
397
450
  margin-right: 4px;
398
451
  padding: 0px 2px;
399
452
  }
453
+
400
454
  @media screen and (min-width: 1024px) {
401
- .zz-toast-msg{
455
+ .zz-toast-msg {
402
456
  font-size: 16px;
403
457
  }
404
-
458
+
405
459
  }
406
- .zz-toast-box.show{
460
+
461
+ .zz-toast-box.show {
407
462
  opacity: 1;
408
463
  transform: translateZ(0) scale(1);
409
- }
464
+ }
@@ -374,3 +374,48 @@ if (!customElements.get('zz-video-popup')) {
374
374
  // 暴露到全局
375
375
  window.zzShowToast = zzShowToast;
376
376
  })();
377
+
378
+ (function () {
379
+ let scrollTop = 0;
380
+
381
+ function isSafari() {
382
+ const ua = navigator.userAgent;
383
+ // 包含 Safari / WebKit,且不包含 Chrome / CriOS / FxiOS / Android
384
+ return /Safari/.test(ua)
385
+ && /AppleWebKit/.test(ua)
386
+ && !/CriOS|FxiOS|Chrome|Edg|OPR/.test(ua);
387
+ }
388
+
389
+ function isSafari26() {
390
+ const ua = navigator.userAgent;
391
+ if (!isSafari()) return false;
392
+ // 检查 “Version/26.0” 或类似标识
393
+ return /Version\/26\./.test(ua);
394
+ }
395
+
396
+
397
+
398
+ function lockBodyScroll() {
399
+ if (isSafari26()) {
400
+ scrollTop = window.scrollY;
401
+ document.documentElement.classList.add('zz-global-noscroll');
402
+ } else {
403
+ document.body.style.overflow = 'hidden';
404
+ }
405
+ }
406
+
407
+ function unlockBodyScroll() {
408
+ if (isSafari26()) {
409
+ document.documentElement.classList.remove('zz-global-noscroll');
410
+ document.documentElement.style.scrollBehavior = 'auto';
411
+ window.scrollTo(0, scrollTop);
412
+ requestAnimationFrame(() => {
413
+ document.documentElement.style.scrollBehavior = '';
414
+ });
415
+ } else {
416
+ document.body.style.overflow = '';
417
+ }
418
+ }
419
+ window.zzLockBodyScroll = lockBodyScroll;
420
+ window.zzUnlockBodyScroll = unlockBodyScroll;
421
+ })();
@@ -16,6 +16,7 @@ class VersionDialog extends HTMLElement {
16
16
  if (!this.swiper) {
17
17
  this.initSwiper();
18
18
  }
19
+ window.zzLockBodyScroll && window.zzLockBodyScroll();
19
20
  } else {
20
21
  // 销毁swiper
21
22
  if (this.swiper) {
@@ -33,6 +34,7 @@ class VersionDialog extends HTMLElement {
33
34
  if (this.swiper) {
34
35
  this.destroySwiper();
35
36
  }
37
+ window.zzUnlockBodyScroll && window.zzUnlockBodyScroll();
36
38
  });
37
39
 
38
40
  // 添加点击backdrop关闭的事件监听
@@ -208,7 +208,7 @@
208
208
  <div
209
209
  class='zz-normal-swiper swiper zz-normal-swiper-{{ block.id }}'
210
210
  >
211
- <div class='zz-swiper-wrapper swiper-wrapper'>
211
+ <div class='zz-swiper-wrapper swiper-wrapper tw-invisible'>
212
212
  {% for block in block.blocks %}
213
213
  <div class='swiper-slide'>
214
214
  {% render block %}
@@ -291,6 +291,7 @@
291
291
  if (initialized) return;
292
292
  initialized = true;
293
293
  instance = new Swiper(swiperSelector, options);
294
+ if (swiperWrapper) swiperWrapper.classList.remove('tw-invisible');
294
295
  }
295
296
 
296
297
  const root = block.querySelector(swiperSelector);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zz-shopify-components",
3
- "version": "0.16.3-beta.4",
3
+ "version": "0.16.3-beta.6",
4
4
  "description": "Reusable Shopify components for theme projects",
5
5
  "keywords": [
6
6
  "shopify",