zz-shopify-components 0.24.0 → 0.24.1-beta.0

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.
@@ -137,6 +137,18 @@
137
137
  "label": "PC端底部内边距 (px)",
138
138
  "default": 0
139
139
  },
140
+ {
141
+ "type": "number",
142
+ "id": "pc_margin_top",
143
+ "label": "PC端顶部外边距 (px)",
144
+ "default": 0
145
+ },
146
+ {
147
+ "type": "number",
148
+ "id": "pc_margin_bottom",
149
+ "label": "PC端底部外边距 (px)",
150
+ "default": 0
151
+ },
140
152
  {
141
153
  "type": "checkbox",
142
154
  "id": "pc_full_width",
@@ -159,13 +171,6 @@
159
171
  "info": "非全屏展示时有效",
160
172
  "visible_if": "{{ block.settings.pc_full_width == false }}"
161
173
  },
162
- {
163
- "type": "number",
164
- "id": "pc_padding_x",
165
- "label": "PC端左右内边距",
166
- "default": 0,
167
- "info": "单位:px"
168
- },
169
174
  {
170
175
  "type": "number",
171
176
  "id": "pc_fixed_height",
@@ -180,16 +185,6 @@
180
185
  "default": 0,
181
186
  "info": "默认自适应高度,单位:px",
182
187
  },
183
- {
184
- "type": "range",
185
- "id": "pc_border_radius",
186
- "min": 0,
187
- "max": 50,
188
- "step": 1,
189
- "unit": "px",
190
- "label": "PC端圆角大小",
191
- "default": 0
192
- },
193
188
  {
194
189
  "type": "header",
195
190
  "content": "📱 移动端布局设置"
@@ -256,16 +251,6 @@
256
251
  "label": "移动端底部内边距 (px)",
257
252
  "default": 0
258
253
  },
259
- {
260
- "type": "range",
261
- "id": "mobile_border_radius",
262
- "min": 0,
263
- "max": 50,
264
- "step": 1,
265
- "unit": "px",
266
- "label": "移动端圆角大小",
267
- "default": 0
268
- },
269
254
  {
270
255
  "type": "header",
271
256
  "content": "动画设置"
@@ -296,10 +281,6 @@
296
281
  ],
297
282
  "default": "none-animation"
298
283
  },
299
- {
300
- "type": "header",
301
- "content": "特殊设置"
302
- },
303
284
  {
304
285
  "type": "checkbox",
305
286
  "id": "has_link",
@@ -352,24 +333,7 @@
352
333
  "id": "overflow_x_hidden",
353
334
  "label": "是否禁止横轴移动",
354
335
  "default": true
355
- },
356
- {
357
- "type": "header",
358
- "content": "统计相关"
359
- },
360
- {
361
- "type": "text",
362
- "id": "module_id",
363
- "label": "唯一业务id",
364
- "info": "需要唯一不要与其他模块重复,用户定位、埋点统计、代码隐藏控制等"
365
- },
366
- {
367
- "type": "checkbox",
368
- "id": "is_exposure",
369
- "label": "是否曝光统计",
370
- "default": false,
371
- "info": "勾选后会对Block模块进行曝光统计埋点, 必须填写唯一业务id"
372
- },
336
+ }
373
337
 
374
338
  ],
375
339
  "blocks": [
@@ -492,22 +456,11 @@
492
456
  padding-bottom: {{ block.settings.mobile_padding_bottom }}px;
493
457
  padding-left: {{ block.settings.mobile_padding_x }}px;
494
458
  padding-right: {{ block.settings.mobile_padding_x }}px;
495
- border-radius: {{ block.settings.mobile_border_radius }}px;
496
459
  {% if block.settings.has_link %}
497
460
  cursor: pointer;
498
461
  {% endif %}
499
462
  }
500
463
 
501
- {% if block.settings.mobile_border_radius != 0 %}
502
- #shopify-block-{{ block.id }} .flex-layout-image {
503
- border-radius: {{ block.settings.mobile_border_radius }}px;
504
- }
505
- #shopify-block-{{ block.id }} .flex-layout-video {
506
- border-radius: {{ block.settings.mobile_border_radius }}px;
507
- }
508
- {% endif %}
509
-
510
-
511
464
  @media (min-width: 1024px) {
512
465
  #shopify-block-{{ block.id }} .bg-responsive-block-layout {
513
466
  flex-direction: {{ block.settings.pc_direction }};
@@ -516,9 +469,11 @@
516
469
  gap: {{ block.settings.pc_gap }}px;
517
470
  padding-top: {{ block.settings.pc_padding_top }}px;
518
471
  padding-bottom: {{ block.settings.pc_padding_bottom }}px;
519
- padding-left: {{ block.settings.pc_padding_x }}px;
520
- padding-right: {{ block.settings.pc_padding_x }}px;
521
- border-radius: {{ block.settings.pc_border_radius }}px;
472
+ margin-top: {{ block.settings.pc_margin_top }}px;
473
+ margin-bottom: {{ block.settings.pc_margin_bottom }}px;
474
+ padding-left: 0px;
475
+ padding-right: 0px;
476
+
522
477
  {% if block.settings.pc_full_width %}
523
478
  width: 100%;
524
479
  {% else %}
@@ -536,15 +491,6 @@
536
491
  object-fit: cover;
537
492
  }
538
493
  {% endif %}
539
-
540
- {% if block.settings.pc_border_radius != 0 %}
541
- #shopify-block-{{ block.id }} .flex-layout-image {
542
- border-radius: {{ block.settings.pc_border_radius }}px;
543
- }
544
- #shopify-block-{{ block.id }} .flex-layout-video {
545
- border-radius: {{ block.settings.pc_border_radius }}px;
546
- }
547
- {% endif %}
548
494
  }
549
495
 
550
496
  @media (min-width: 1280px) {
@@ -628,14 +574,7 @@
628
574
 
629
575
  {% assign layout_class = 'bg-layout' | append: block.id %}
630
576
 
631
- <div
632
- {% if block.settings.module_id != blank %}
633
- data-track-zz-block="{{ block.settings.module_id }}"
634
- {% endif %}
635
- {% if block.settings.is_exposure != false %}
636
- data-track-zz-exposure="true"
637
- {% endif %}
638
- class="bg-responsive-block-layout {{ layout_class }} {{ block.settings.self_animation }} {{ block.settings.child_animation }}">
577
+ <div class="bg-responsive-block-layout {{ layout_class }} {{ block.settings.self_animation }} {{ block.settings.child_animation }}">
639
578
 
640
579
  {% content_for 'blocks' %}
641
580
  </div>
@@ -76,6 +76,18 @@
76
76
  "label": "PC端底部内边距 (px)",
77
77
  "default": 0
78
78
  },
79
+ {
80
+ "type": "number",
81
+ "id": "pc_margin_top",
82
+ "label": "PC端顶部外边距 (px)",
83
+ "default": 0
84
+ },
85
+ {
86
+ "type": "number",
87
+ "id": "pc_margin_bottom",
88
+ "label": "PC端底部外边距 (px)",
89
+ "default": 0
90
+ },
79
91
  {
80
92
  "type": "number",
81
93
  "id": "pc_border_radius",
@@ -605,6 +617,8 @@
605
617
  padding-bottom: {{ block.settings.pc_padding_bottom }}px;
606
618
  padding-left: {{ block.settings.pc_padding_x }}px;
607
619
  padding-right: {{ block.settings.pc_padding_x }}px;
620
+ margin-top: {{ block.settings.pc_margin_top }}px;
621
+ margin-bottom: {{ block.settings.pc_margin_bottom }}px;
608
622
  border-radius: {{ block.settings.pc_border_radius }}px;
609
623
 
610
624
  {% if block.settings.pc_full_width %}
@@ -64,7 +64,8 @@
64
64
  "options": [
65
65
  { "value": "flex-start", "label": "起始对齐 (Flex Start)" },
66
66
  { "value": "center", "label": "居中对齐 (Center)" },
67
- { "value": "flex-end", "label": "末尾对齐 (Flex End)" }
67
+ { "value": "flex-end", "label": "末尾对齐 (Flex End)" },
68
+ { "value": "stretch", "label": "拉伸对齐 (Stretch)" }
68
69
  ],
69
70
  "default": "center"
70
71
  },
@@ -150,7 +151,8 @@
150
151
  "options": [
151
152
  { "value": "flex-start", "label": "起始对齐 (Flex Start)" },
152
153
  { "value": "center", "label": "居中对齐 (Center)" },
153
- { "value": "flex-end", "label": "末尾对齐 (Flex End)" }
154
+ { "value": "flex-end", "label": "末尾对齐 (Flex End)" },
155
+ { "value": "stretch", "label": "拉伸对齐 (Stretch)" }
154
156
  ],
155
157
  "default": "center"
156
158
  },
@@ -0,0 +1,84 @@
1
+ {% assign discount_percentage = block.settings.percentage %}
2
+ <span class='price-tag-mini'>
3
+ <span class='price-tag-mini__main'>UP TO</span
4
+ ><span class='price-tag-mini__main-price'>
5
+ <span class='price-tag-mini__main-discount'>
6
+ {{- discount_percentage -}}</span
7
+ ><span class='price-tag-mini__main-discount-off'>%off</span>
8
+ </span>
9
+ </span>
10
+
11
+ <style>
12
+ #shopify-block-{{ block.id }} .price-tag-mini {
13
+ left: 0px;
14
+ position: relative;
15
+ display: flex;
16
+ flex-direction: column;
17
+ height: 40px;
18
+ margin-bottom: 10px;
19
+ padding: 4px 4px;
20
+ color: #fff;
21
+ font-weight: bold;
22
+ background-color: #FC6C0F;
23
+ line-height: 1;
24
+ justify-content: start;
25
+ align-items: center;
26
+ clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%);
27
+ }
28
+
29
+ #shopify-block-{{ block.id }} .price-tag-mini__main {
30
+ font-size: 12px;
31
+ }
32
+ #shopify-block-{{ block.id }} .price-tag-mini__main-discount {
33
+ font-size: 13px;
34
+ }
35
+ #shopify-block-{{ block.id }} .price-tag-mini__main-discount-off {
36
+ font-size: 9px;
37
+ }
38
+
39
+ @media (min-width: 750px) {
40
+ #shopify-block-{{ block.id }} .price-tag-mini {
41
+ height: 54px;
42
+ }
43
+ #shopify-block-{{ block.id }} .price-tag-mini__main {
44
+ font-size: 16px;
45
+ }
46
+ #shopify-block-{{ block.id }} .price-tag-mini__main-discount {
47
+ font-size: 18px;
48
+ }
49
+ #shopify-block-{{ block.id }} .price-tag-mini__main-discount-off {
50
+ font-size: 12px;
51
+ }
52
+ }
53
+
54
+ #shopify-block-{{ block.id }} .price-tag-mini span {
55
+ position: relative;
56
+ z-index: 1;
57
+ }
58
+ </style>
59
+
60
+ {% schema %}
61
+ {
62
+ "name": "Price Tag Plain",
63
+ "settings": [
64
+ {
65
+ "type": "number",
66
+ "id": "percentage",
67
+ "label": "Percentage",
68
+ "info": "输入百分比",
69
+ "default": 10
70
+ },
71
+ {
72
+ "type": "checkbox",
73
+ "id": "show_discount_percentage_off",
74
+ "label": "展示 Off 后缀",
75
+ "default": true
76
+ }
77
+ ],
78
+ "presets": [
79
+ {
80
+ "name": "Price Tag Plain"
81
+ }
82
+ ]
83
+ }
84
+ {% endschema %}
@@ -39,6 +39,28 @@
39
39
 
40
40
  {% assign media_class = 'zz-link-' | append: block.id %}
41
41
 
42
+ {% if block.settings.title_and_content_position == 'top' %}
43
+ <div class='slide-box {% if block.settings.has_title_and_content %} tw-pb-[20px] lg:tw-pb-[48px] {% else %} tw-h-[25px] {% endif %} tw-box-border'>
44
+ <div class='active-box-content tw-hidden'>
45
+ {% render 'zz-h3',
46
+ title: block.settings.heading,
47
+ title_color: block.settings.title_color,
48
+ class_name: 'tw-text-center'
49
+ %}
50
+ <div class='tw-mt-[8px] lg:tw-mt-[16px]'>
51
+ {% render 'zz-content-text',
52
+ text: block.settings.row_content,
53
+ mb_text: block.settings.row_content,
54
+ pc_font_size: 16,
55
+ mobile_font_size: 12,
56
+ text_color: block.settings.content_color,
57
+ class_name: 'tw-text-center'
58
+ %}
59
+ </div>
60
+ </div>
61
+ </div>
62
+ {% endif %}
63
+
42
64
  <div class='media-box banner-item {{ media_class }}'>
43
65
  {% if block.settings.video_pc != blank %}
44
66
  {% if block.settings.video_url_pc != blank %}
@@ -67,6 +89,12 @@
67
89
  {% endif %}
68
90
  </div>
69
91
 
92
+ {% if block.settings.title_and_content_position == 'top' %}
93
+ <div class='max-lg:tw-h-[25px]'>
94
+ </div>
95
+ {% endif %}
96
+
97
+ {% if block.settings.title_and_content_position != 'top' %}
70
98
  <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
99
  <div class='active-box-content tw-hidden'>
72
100
  {% render 'zz-h5',
@@ -86,6 +114,7 @@
86
114
  </div>
87
115
  </div>
88
116
  </div>
117
+ {% endif %}
89
118
 
90
119
  {% schema %}
91
120
  {
@@ -124,6 +153,17 @@
124
153
  "label": "是否有标题与内容",
125
154
  "default": true
126
155
  },
156
+ {
157
+ "type": "select",
158
+ "id": "title_and_content_position",
159
+ "label": "标题与内容位置",
160
+ "options": [
161
+ { "value": "top", "label": "顶部" },
162
+ { "value": "bottom", "label": "底部" },
163
+ ],
164
+ "default": "bottom",
165
+ "visible_if": "{{ block.settings.has_title_and_content == true }}"
166
+ },
127
167
  {
128
168
  "type": "text",
129
169
  "id": "heading",
@@ -23,11 +23,18 @@
23
23
  height: fit-content;
24
24
  position: relative;
25
25
  letter-spacing: 0;
26
+ {% if block.settings.has_title_and_content and block.settings.title_and_content_position == 'top' %}
27
+ padding-bottom: 40px;
28
+ {% endif %}
26
29
  }
27
30
 
28
31
  #shopify-block-{{block.id}} .swiper-button-next,
29
32
  #shopify-block-{{block.id}} .swiper-button-prev {
30
- top: 0;
33
+ {% if block.settings.has_title_and_content and block.settings.title_and_content_position == 'top' %}
34
+ bottom: 0;
35
+ {% else %}
36
+ top: 0;
37
+ {% endif %}
31
38
  width: 48px;
32
39
  height: 48px;
33
40
  }
@@ -61,7 +68,9 @@
61
68
  #shopify-block-{{block.id}} .zz-video-swiper-preview .swiper-pagination-bullets .swiper-pagination-bullet-active {
62
69
  position: relative;
63
70
  width: 120px;
64
- {% if block.settings.if_autoplay == false %}
71
+ {% if block.settings.title_and_content_position == 'top' %}
72
+ background: rgba(0, 0, 0, 1);
73
+ {% elsif block.settings.if_autoplay == false %}
65
74
  background: #fff;
66
75
  {% endif %}
67
76
  }
@@ -121,7 +130,11 @@
121
130
  }
122
131
  #shopify-block-{{block.id}} .zz-video-swiper-preview .swiper-pagination-bullets {
123
132
  {% if block.settings.has_title_and_content %}
124
- bottom: 220px;
133
+ {% if block.settings.title_and_content_position == 'top' %}
134
+ bottom: 0px;
135
+ {% else %}
136
+ bottom: 220px;
137
+ {% endif %}
125
138
  {% else %}
126
139
  bottom: 21px;
127
140
  {% endif %}
@@ -134,7 +147,11 @@
134
147
  display: block;
135
148
  position: absolute;
136
149
  left: calc(50% - 30px);
137
- top: 0;
150
+ {% if block.settings.title_and_content_position == 'top' %}
151
+ bottom: 40px;
152
+ {% else %}
153
+ top: 0;
154
+ {% endif %}
138
155
  width: 83.3594vw;
139
156
  height: 46.875vw;
140
157
  transform: translateX(-150%);
@@ -148,7 +165,11 @@
148
165
  display: block;
149
166
  position: absolute;
150
167
  right: calc(50% - 30px);
151
- top: 0;
168
+ {% if block.settings.title_and_content_position == 'top' %}
169
+ bottom: 40px;
170
+ {% else %}
171
+ top: 0;
172
+ {% endif %}
152
173
  width: 83.3594vw;
153
174
  height: 46.875vw;
154
175
  transform: translateX(150%);
@@ -166,22 +187,36 @@
166
187
  height: 600px;
167
188
  }
168
189
  #shopify-block-{{block.id}} .swiper-button-prev {
169
- transform: translate(-594px, 300px);
190
+ {% if block.settings.title_and_content_position == 'top' %}
191
+ transform: translate(-594px, 60px);
192
+ {% else %}
193
+ transform: translate(-594px, 300px);
194
+ {% endif %}
170
195
  }
171
196
  #shopify-block-{{block.id}} .swiper-button-next {
172
- transform: translate(594px, 300px);
197
+ {% if block.settings.title_and_content_position == 'top' %}
198
+ transform: translate(594px, 60px);
199
+ {% else %}
200
+ transform: translate(594px, 300px);
201
+ {% endif %}
173
202
  }
174
-
175
203
  }
204
+
205
+ {% if block.settings.title_and_content_position == 'top' %}
206
+ #shopify-block-{{block.id}} .swiper-wrapper {
207
+ align-items: stretch;
208
+ }
209
+ #shopify-block-{{block.id}} .swiper-slide {
210
+ display: flex;
211
+ flex-direction: column;
212
+ height: auto !important;
213
+ align-content: end;
214
+ align-self: flex-end;
215
+ }
216
+ {% endif %}
176
217
  </style>
177
218
 
178
219
  <div
179
- {% if block.settings.module_id != blank %}
180
- data-track-zz-block="{{ block.settings.module_id }}"
181
- {% endif %}
182
- {% if block.settings.is_exposure != false %}
183
- data-track-zz-exposure="true"
184
- {% endif %}
185
220
  class='zz-video-swiper-preview zz-video-swiper-preview-{{ block.id }}'
186
221
  >
187
222
  <div class='swiper-wrapper'>
@@ -532,25 +567,18 @@
532
567
  "type": "checkbox",
533
568
  "id": "has_title_and_content",
534
569
  "label": "是否有标题与内容",
535
- "default": true
536
- },
537
- {
538
- "type": "header",
539
- "content": "统计相关"
540
- },
541
- {
542
- "type": "text",
543
- "id": "module_id",
544
- "label": "唯一业务id",
545
- "info": "需要唯一不要与其他模块重复,用户定位、埋点统计、代码隐藏控制等"
570
+ "default": true,
546
571
  },
547
572
  {
548
- "type": "checkbox",
549
- "id": "is_exposure",
550
- "label": "是否曝光统计",
551
- "default": false,
552
- "info": "勾选后会对Block模块进行曝光统计埋点, 必须填写唯一业务id"
553
- },
573
+ "type": "select",
574
+ "id": "title_and_content_position",
575
+ "label": "标题与内容位置",
576
+ "options": [
577
+ { "value": "top", "label": "顶部" },
578
+ { "value": "bottom", "label": "底部" },
579
+ ],
580
+ "default": "bottom",
581
+ }
554
582
  ],
555
583
  "blocks": [
556
584
  {
@@ -573,7 +601,8 @@
573
601
  "gradient_color_left": "linear-gradient(270deg, rgba(255,255,255, 0) 0%, rgba(255,255,255, 1) 40%)",
574
602
  "gradient_color_right": "linear-gradient(90deg, rgba(255,255,255, 0) 0%, rgba(255,255,255, 1) 40%)",
575
603
  "prev_next_type": "dark",
576
- "has_title_and_content": true
604
+ "has_title_and_content": true,
605
+ "title_and_content_position": "bottom"
577
606
  },
578
607
  "blocks": [
579
608
  {
@@ -586,6 +615,7 @@
586
615
  "title_color": "#333232",
587
616
  "row_content": "<p>Description set here, Description set here.</p>",
588
617
  "content_color": "#5d544c",
618
+ "title_and_content_position": "bottom"
589
619
  },
590
620
  },
591
621
  {
@@ -598,6 +628,7 @@
598
628
  "title_color": "#333232",
599
629
  "row_content": "<p>Description set here, Description set here.</p>",
600
630
  "content_color": "#5d544c",
631
+ "title_and_content_position": "bottom"
601
632
  },
602
633
 
603
634
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zz-shopify-components",
3
- "version": "0.24.0",
3
+ "version": "0.24.1-beta.0",
4
4
  "description": "Reusable Shopify components for theme projects",
5
5
  "keywords": [
6
6
  "shopify",
@@ -66,6 +66,7 @@
66
66
  }
67
67
  #shopify-section-{{ section.id }} .swiper-pagination-horizontal {
68
68
  overflow-x: auto; /* 启用横向滚动 */
69
+ overflow-y: hidden;
69
70
  white-space: nowrap; /* 不换行,强制所有子项在一行 */
70
71
  -webkit-overflow-scrolling: touch; /* 移动端流畅滚动(可选) */
71
72
  scrollbar-width: none; /* Firefox */
@@ -152,18 +153,18 @@
152
153
  }
153
154
  @media screen and (min-width: 1280px) {
154
155
  #shopify-section-{{ section.id }} .zz-banner-tab-swiper {
155
- width: 1220px;
156
+ width: 1080px;
156
157
  }
157
158
  #shopify-section-{{ section.id }} .zz-banner-tab-swiper .swiper-slide {
158
- width: 1220px;
159
+ width: 1080px;
159
160
  }
160
161
  #shopify-section-{{ section.id }} .zz-banner-tab-swiper .swiper-slide .media-box {
161
162
  position: relative;
162
- width: 1220px;
163
- height: 686px;
163
+ width: 1080px;
164
+ height: 608px;
164
165
  }
165
166
  #shopify-section-{{ section.id }} .zz-banner-tab-swiper .swiper-pagination-bullets {
166
- width: 1030px;
167
+ width: 930px;
167
168
  }
168
169
  }
169
170