zz-shopify-components 0.32.1-beta.0 → 0.32.1-beta.2
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/assets/zz-components.css +16 -0
- package/assets/zz-components.js +18 -0
- package/blocks/zz-accessories-swiper.liquid +9 -0
- package/blocks/zz-modal-block.liquid +7 -0
- package/blocks/zz-ratio-image.liquid +31 -1
- package/blocks/zz-title.liquid +15 -0
- package/blocks/zz-video-button.liquid +56 -7
- package/blocks/zz-video-swiper-right.liquid +17 -1
- package/package.json +1 -1
- package/sections/zz-flex-layout-section.liquid +1 -1
- package/sections/zz-video-collapse-swiper.liquid +33 -9
- package/sections/zz-video-progress-swiper.liquid +1 -0
- package/snippets/zz-video-popup.liquid +2 -1
package/assets/zz-components.css
CHANGED
|
@@ -462,4 +462,20 @@ body.zz-dialog-open {
|
|
|
462
462
|
.zz-toast-box.show {
|
|
463
463
|
opacity: 1;
|
|
464
464
|
transform: translateZ(0) scale(1);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
.zz-overflow-scrollbar-hidden {
|
|
470
|
+
scrollbar-width: none;
|
|
471
|
+
/* Firefox */
|
|
472
|
+
-ms-overflow-style: none;
|
|
473
|
+
/* IE 10+ */
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.zz-overflow-scrollbar-hidden::-webkit-scrollbar {
|
|
477
|
+
width: 0;
|
|
478
|
+
height: 0;
|
|
479
|
+
display: none;
|
|
480
|
+
/* Chrome/Safari/Edge */
|
|
465
481
|
}
|
package/assets/zz-components.js
CHANGED
|
@@ -463,5 +463,23 @@ document.addEventListener('DOMContentLoaded', (event) => {
|
|
|
463
463
|
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
+
// 处理统一的定位脚本
|
|
467
|
+
document.addEventListener('click', (e) => {
|
|
468
|
+
// data-zz-module-name
|
|
469
|
+
const positionTrigger = e.target.closest('[data-zz-module-target]');
|
|
470
|
+
if (positionTrigger) {
|
|
471
|
+
const selector = positionTrigger.getAttribute('data-zz-module-target');
|
|
472
|
+
if (selector) {
|
|
473
|
+
const target = document.querySelector(`[data-zz-module-name="${selector}"]`);
|
|
474
|
+
const headerHeight = 50;
|
|
475
|
+
const offsetTop = target.offsetTop - headerHeight;
|
|
476
|
+
window.scrollTo(0, offsetTop);
|
|
477
|
+
|
|
478
|
+
}
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
|
|
466
483
|
|
|
467
484
|
});
|
|
485
|
+
|
|
@@ -71,6 +71,15 @@
|
|
|
71
71
|
padding-top: 64px;
|
|
72
72
|
padding-bottom: 108px;
|
|
73
73
|
}
|
|
74
|
+
{% if block_size <= 3 %}
|
|
75
|
+
#shopify-block-{{ block.id }} .swiper-button-next,
|
|
76
|
+
#shopify-block-{{ block.id }} .swiper-button-prev {
|
|
77
|
+
display: none;
|
|
78
|
+
}
|
|
79
|
+
#shopify-block-{{ block.id }} .zz-accessories-swiper .swiper-pagination-bullets {
|
|
80
|
+
display: none;
|
|
81
|
+
}
|
|
82
|
+
{% endif %}
|
|
74
83
|
|
|
75
84
|
}
|
|
76
85
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
--zz-modal-radius: {{ block.settings.radius_mobile }}px;
|
|
6
6
|
--zz-modal-padding: {{ block.settings.padding_mobile }}px;
|
|
7
7
|
--zz-modal-width: {{ block.settings.width_mobile }};
|
|
8
|
+
--zz-modal-background: {{ block.settings.bg_color }};
|
|
8
9
|
}
|
|
9
10
|
@media (min-width: 1024px) {
|
|
10
11
|
#{{ block.settings.modal_id }} {
|
|
@@ -71,6 +72,12 @@
|
|
|
71
72
|
{ "value": "white", "label": "白色" },
|
|
72
73
|
{ "value": "black", "label": "黑色" }
|
|
73
74
|
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"type": "color",
|
|
78
|
+
"id": "bg_color",
|
|
79
|
+
"default": "#ffffff",
|
|
80
|
+
"label": "背景色"
|
|
74
81
|
},
|
|
75
82
|
{
|
|
76
83
|
"type": "checkbox",
|
|
@@ -80,6 +80,14 @@
|
|
|
80
80
|
"value": "link_map",
|
|
81
81
|
"label": "多国家映射"
|
|
82
82
|
},
|
|
83
|
+
{
|
|
84
|
+
"value": "modal",
|
|
85
|
+
"label": "弹窗"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"value": "position_to_module",
|
|
89
|
+
"label": "定位到某个模块"
|
|
90
|
+
}
|
|
83
91
|
],
|
|
84
92
|
"default": "link",
|
|
85
93
|
"visible_if": "{{ block.settings.has_link == true }}"
|
|
@@ -97,6 +105,25 @@
|
|
|
97
105
|
"info": "国家对应链接的表,国家即是国家选择器上显示的字段,国家和路由之间用冒号隔开( 冒号后要加空格)。国家之间换行,“default”为其他未写的默认的链接 EG: Canada: https://hoverair.com/ default: https://hoverair.com/ ",
|
|
98
106
|
"visible_if": "{{ block.settings.function_type == 'link_map' and block.settings.has_link == true }}"
|
|
99
107
|
},
|
|
108
|
+
{
|
|
109
|
+
"type": "text",
|
|
110
|
+
"id": "position_module_id",
|
|
111
|
+
"label": "定位到模块的id",
|
|
112
|
+
"visible_if": "{{ block.settings.function_type == 'position_to_module' and block.settings.has_link == true }}"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"type": "text",
|
|
116
|
+
"id": "modal_id",
|
|
117
|
+
"label": "按钮触发modal的id",
|
|
118
|
+
"visible_if": "{{ block.settings.function_type == 'modal' and block.settings.has_link == true }}"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"type": "text",
|
|
122
|
+
"id": "btn_id",
|
|
123
|
+
"label": "业务id",
|
|
124
|
+
"info": "按钮的唯一id,用于代码控制、埋点统计等"
|
|
125
|
+
},
|
|
126
|
+
|
|
100
127
|
|
|
101
128
|
],
|
|
102
129
|
"presets": [
|
|
@@ -112,12 +139,15 @@
|
|
|
112
139
|
|
|
113
140
|
{% assign link_class = 'zz-link-' | append: block.id %}
|
|
114
141
|
{% assign image_class = 'ratio-image ' | append: link_class %}
|
|
142
|
+
{% assign modalTarget = block.settings.modal_id | prepend: '#' %}
|
|
115
143
|
|
|
116
144
|
{% render 'zz-img',
|
|
117
145
|
pc_image: block.settings.desktop_image,
|
|
118
146
|
mb_image: block.settings.mobile_image,
|
|
119
147
|
image_alt: block.settings.alt | escape,
|
|
120
148
|
class_name: image_class,
|
|
149
|
+
modal_target: modalTarget,
|
|
150
|
+
module_target: block.settings.position_module_id,
|
|
121
151
|
%}
|
|
122
152
|
|
|
123
153
|
<style>
|
|
@@ -160,7 +190,7 @@
|
|
|
160
190
|
}
|
|
161
191
|
})
|
|
162
192
|
</script>
|
|
163
|
-
{%
|
|
193
|
+
{% elsif block.settings.function_type == 'link' %}
|
|
164
194
|
<script>
|
|
165
195
|
document.addEventListener('DOMContentLoaded', (event) => {
|
|
166
196
|
|
package/blocks/zz-title.liquid
CHANGED
|
@@ -53,6 +53,11 @@
|
|
|
53
53
|
"id": "text_gradient",
|
|
54
54
|
"label": "文字渐变 (可选)"
|
|
55
55
|
},
|
|
56
|
+
{
|
|
57
|
+
"type": "color",
|
|
58
|
+
"id": "text_color_strong",
|
|
59
|
+
"label": "重点颜色(B 加粗颜色)可选",
|
|
60
|
+
},
|
|
56
61
|
{
|
|
57
62
|
"type": "header",
|
|
58
63
|
"content": "💻 PC 样式设置"
|
|
@@ -297,4 +302,14 @@
|
|
|
297
302
|
}
|
|
298
303
|
{% endif %}
|
|
299
304
|
|
|
305
|
+
#shopify-block-{{ block.id }} .title-block {
|
|
306
|
+
overflow-wrap: break-word;
|
|
307
|
+
}
|
|
308
|
+
#shopify-block-{{ block.id }} .title-block strong {
|
|
309
|
+
font-weight: {{ block.settings.pc_font_weight_custom | default: '700' }};
|
|
310
|
+
{% if block.settings.text_color_strong %}
|
|
311
|
+
color: {{ block.settings.text_color_strong }};
|
|
312
|
+
{% endif %}
|
|
313
|
+
}
|
|
314
|
+
|
|
300
315
|
</style>
|
|
@@ -17,6 +17,16 @@
|
|
|
17
17
|
"type": "image_picker",
|
|
18
18
|
"id": "poster_pc",
|
|
19
19
|
"label": "视频 封面"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"type": "video",
|
|
23
|
+
"id": "video_mb",
|
|
24
|
+
"label": "视频 移动端"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "image_picker",
|
|
28
|
+
"id": "poster_mb",
|
|
29
|
+
"label": "视频 移动端 封面"
|
|
20
30
|
},
|
|
21
31
|
{
|
|
22
32
|
"type": "select",
|
|
@@ -73,10 +83,49 @@
|
|
|
73
83
|
}
|
|
74
84
|
{% endschema %}
|
|
75
85
|
|
|
76
|
-
{%
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
%}
|
|
86
|
+
{% assign video_mb = block.settings.video_mb %}
|
|
87
|
+
{% assign poster_mb = block.settings.poster_mb %}
|
|
88
|
+
{% if block.settings.video_mb == blank %}
|
|
89
|
+
{% assign video_mb = block.settings.video_pc %}
|
|
90
|
+
{% endif %}
|
|
91
|
+
{% if block.settings.poster_mb == blank %}
|
|
92
|
+
{% assign poster_mb = block.settings.poster_pc %}
|
|
93
|
+
{% endif %}
|
|
94
|
+
|
|
95
|
+
{% render 'zz-video-popup',
|
|
96
|
+
pc_video: block.settings.video_pc,
|
|
97
|
+
pc_poster: block.settings.poster_pc,
|
|
98
|
+
mb_video: video_mb,
|
|
99
|
+
mb_poster: poster_mb,
|
|
100
|
+
module_id: 'video-btn'
|
|
101
|
+
%}
|
|
102
|
+
|
|
103
|
+
{% render 'zz-button',
|
|
104
|
+
type: 'default',
|
|
105
|
+
color: block.settings.color,
|
|
106
|
+
text: block.settings.text,
|
|
107
|
+
size: block.settings.size,
|
|
108
|
+
backdrop_filter: true,
|
|
109
|
+
class_name: 'zz-video-btn',
|
|
110
|
+
icon: '<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
111
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.635 6.42979C14.5112 6.91507 14.5112 8.08492 13.635 8.57021L6.84517 12.331C5.94149 12.8315 4.79058 12.232 4.79058 11.2608L4.79058 3.73925C4.79058 2.768 5.94148 2.16851 6.84517 2.66904L13.635 6.42979Z" fill="white"/>
|
|
112
|
+
</svg>
|
|
113
|
+
'
|
|
114
|
+
%}
|
|
115
|
+
<script>
|
|
116
|
+
|
|
117
|
+
(function () {
|
|
118
|
+
const block = document.getElementById(
|
|
119
|
+
'shopify-block-{{block.id}}'
|
|
120
|
+
);
|
|
121
|
+
const videoPopup = block.querySelector('zz-video-popup');
|
|
122
|
+
const showBtns = block.querySelectorAll('.zz-video-btn');
|
|
123
|
+
showBtns.forEach(btn => {
|
|
124
|
+
btn.addEventListener('click', function () {
|
|
125
|
+
videoPopup.togglePopup();
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
})();
|
|
130
|
+
|
|
131
|
+
</script>
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
{% if block.settings.is_exposure != false %}
|
|
154
154
|
data-track-zz-exposure="true"
|
|
155
155
|
{% endif %}
|
|
156
|
-
class='zz-swiper-right zz-swiper-right-{{ block.id }}
|
|
156
|
+
class='zz-swiper-right zz-swiper-right-{{ block.id }}'
|
|
157
157
|
>
|
|
158
158
|
<div class='swiper-wrapper'>
|
|
159
159
|
{% content_for 'blocks' %}
|
|
@@ -326,6 +326,22 @@
|
|
|
326
326
|
});
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
+
if(isDesktop) {
|
|
330
|
+
setTimeout(() => {
|
|
331
|
+
// 获取zzAccessoriesSwiper的宽度, 500px, 631px
|
|
332
|
+
|
|
333
|
+
const swiperWidth = zzAccessoriesSwiper.offsetWidth;
|
|
334
|
+
let paddingRight = 200;
|
|
335
|
+
if (window.innerWidth >= 1280) {
|
|
336
|
+
paddingRight = swiperWidth - 631;
|
|
337
|
+
} else if (window.innerWidth >= 1024) {
|
|
338
|
+
paddingRight = swiperWidth - 500;
|
|
339
|
+
}
|
|
340
|
+
zzAccessoriesSwiper.style.paddingRight = paddingRight + 'px';
|
|
341
|
+
}, 1000);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
|
|
329
345
|
});
|
|
330
346
|
</script>
|
|
331
347
|
|
package/package.json
CHANGED
|
@@ -226,7 +226,7 @@
|
|
|
226
226
|
|
|
227
227
|
<style>
|
|
228
228
|
#shopify-section-{{ section.id }} {
|
|
229
|
-
background
|
|
229
|
+
background: {{ section.settings.background_color }};
|
|
230
230
|
{% if section.settings.top_offset != 0 %}
|
|
231
231
|
margin-top: -{{ section.settings.top_offset }}px;
|
|
232
232
|
{% endif %}
|
|
@@ -62,7 +62,6 @@
|
|
|
62
62
|
{ "value": "black", "label": "黑色" },
|
|
63
63
|
],
|
|
64
64
|
"default": "white",
|
|
65
|
-
"visible_if": "{{ section.settings.mobile_style == 'left_right' }}"
|
|
66
65
|
},
|
|
67
66
|
{
|
|
68
67
|
"type": "image_picker",
|
|
@@ -552,14 +551,23 @@
|
|
|
552
551
|
|
|
553
552
|
{% else %}
|
|
554
553
|
#shopify-section-{{ section.id }} .zz-collapse-swiper .swiper-pagination-bullets {
|
|
554
|
+
display: flex;
|
|
555
|
+
align-items: center;
|
|
555
556
|
bottom: 170px;
|
|
556
557
|
left: 50%;
|
|
557
558
|
transform: translateX(-50%);
|
|
558
559
|
width: calc(100% - 40px);
|
|
559
560
|
{% if section.settings.mobile_style == 'tab' %}
|
|
560
561
|
{% comment %} tab栏展示两行文字 {% endcomment %}
|
|
561
|
-
|
|
562
|
+
|
|
562
563
|
border-radius: 10px;
|
|
564
|
+
{% if section.settings.collapse_button_color == 'black' %}
|
|
565
|
+
background: white;
|
|
566
|
+
{% else %}
|
|
567
|
+
background: #282828;
|
|
568
|
+
{% endif %}
|
|
569
|
+
|
|
570
|
+
|
|
563
571
|
|
|
564
572
|
{% else %}
|
|
565
573
|
{% comment %} tab栏展示一行文字 {% endcomment %}
|
|
@@ -589,12 +597,21 @@
|
|
|
589
597
|
{% if section.settings.mobile_style == 'tab' %}
|
|
590
598
|
{% comment %} tab栏展示两行文字 {% endcomment %}
|
|
591
599
|
box-sizing: border-box;
|
|
592
|
-
line-height: normal;
|
|
593
600
|
border-radius: 10px;
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
601
|
+
display: flex;
|
|
602
|
+
align-items: center;
|
|
603
|
+
justify-content: center;
|
|
604
|
+
|
|
605
|
+
height: 58px;
|
|
597
606
|
padding: 16px;
|
|
607
|
+
{% if section.settings.collapse_button_color == 'black' %}
|
|
608
|
+
color: #00000080;
|
|
609
|
+
background: none;
|
|
610
|
+
{% else %}
|
|
611
|
+
color: #FFFFFF80;
|
|
612
|
+
background: none;
|
|
613
|
+
|
|
614
|
+
{% endif %}
|
|
598
615
|
|
|
599
616
|
{% else %}
|
|
600
617
|
{% comment %} tab栏展示一行文字 {% endcomment %}
|
|
@@ -602,13 +619,13 @@
|
|
|
602
619
|
color: #FFFFFFB2;
|
|
603
620
|
white-space: nowrap;
|
|
604
621
|
height: auto;
|
|
622
|
+
background: none;
|
|
605
623
|
|
|
606
624
|
{% endif %}
|
|
607
625
|
|
|
608
626
|
margin: 0;
|
|
609
627
|
width: fit-content;
|
|
610
628
|
font-size: 14px;
|
|
611
|
-
background: none;
|
|
612
629
|
border-top: 0;
|
|
613
630
|
opacity: 1;
|
|
614
631
|
|
|
@@ -619,8 +636,15 @@
|
|
|
619
636
|
#shopify-section-{{ section.id }} .zz-collapse-swiper .swiper-pagination-bullets .swiper-pagination-bullet-active {
|
|
620
637
|
{% if section.settings.mobile_style == 'tab' %}
|
|
621
638
|
{% comment %} tab栏展示两行文字 {% endcomment %}
|
|
622
|
-
|
|
623
|
-
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
{% if section.settings.collapse_button_color == 'black' %}
|
|
642
|
+
background:#000000;
|
|
643
|
+
color: #ffffff;
|
|
644
|
+
{% else %}
|
|
645
|
+
background: #0000004D;
|
|
646
|
+
color: #ffffff;
|
|
647
|
+
{% endif %}
|
|
624
648
|
|
|
625
649
|
{% else %}
|
|
626
650
|
{% comment %} tab栏展示一行文字 {% endcomment %}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
align-items: center;
|
|
14
14
|
padding-top: {{ section.settings.mobile_padding_top }}px;
|
|
15
15
|
padding-bottom: {{ section.settings.mobile_padding_bottom }}px;
|
|
16
|
+
overflow: hidden;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
#shopify-section-{{ section.id }} .bullet-title , #shopify-section-{{ section.id }} .bullet-desc {
|
|
@@ -5,7 +5,7 @@ mb_video: 移动端视频
|
|
|
5
5
|
mb_poster: 移动端封面
|
|
6
6
|
title: 标题
|
|
7
7
|
content: 内容
|
|
8
|
-
|
|
8
|
+
module_id: 唯一业务id
|
|
9
9
|
- class_name:自定义类名
|
|
10
10
|
{% endcomment %}
|
|
11
11
|
|
|
@@ -44,6 +44,7 @@ content: 内容
|
|
|
44
44
|
class: 'tw-w-full tw-h-auto',
|
|
45
45
|
autoplay: false,
|
|
46
46
|
loop: true,
|
|
47
|
+
module_id: module_id
|
|
47
48
|
%}
|
|
48
49
|
|
|
49
50
|
|