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,106 +1,106 @@
|
|
|
1
|
-
{% assign product = all_products[block.settings.product] %}
|
|
2
|
-
{% assign variant_id = block.settings.variant_id | times: 1 %}
|
|
3
|
-
{% assign variant = product.variants | where: 'id', variant_id | first %}
|
|
4
|
-
|
|
5
|
-
{% if variant %}
|
|
6
|
-
{% assign current_price = variant.price %}
|
|
7
|
-
{% assign compare_at_price = variant.compare_at_price %}
|
|
8
|
-
{% assign discount_percentage = 0 %}
|
|
9
|
-
|
|
10
|
-
{% if compare_at_price and compare_at_price > current_price %}
|
|
11
|
-
{% assign percent = current_price
|
|
12
|
-
| times: 100
|
|
13
|
-
| divided_by: compare_at_price
|
|
14
|
-
%}
|
|
15
|
-
{% assign discount_percentage = 100 | minus: percent %}
|
|
16
|
-
<span class='price-tag-mini'>
|
|
17
|
-
<span class='price-tag-mini__main'>UP TO</span
|
|
18
|
-
><span class='price-tag-mini__main-price'>
|
|
19
|
-
<span class='price-tag-mini__main-discount'>
|
|
20
|
-
{{- discount_percentage -}}</span
|
|
21
|
-
><span class='price-tag-mini__main-discount-off'>%off</span>
|
|
22
|
-
</span>
|
|
23
|
-
</span>
|
|
24
|
-
{% endif %}
|
|
25
|
-
{% endif %}
|
|
26
|
-
|
|
27
|
-
<style>
|
|
28
|
-
#shopify-block-{{ block.id }} .price-tag-mini {
|
|
29
|
-
left: 20px;
|
|
30
|
-
position: relative;
|
|
31
|
-
display: flex;
|
|
32
|
-
flex-direction: column;
|
|
33
|
-
height: 40px;
|
|
34
|
-
margin-bottom: 10px;
|
|
35
|
-
padding: 4px 4px;
|
|
36
|
-
color: #fff;
|
|
37
|
-
font-weight: bold;
|
|
38
|
-
background-color: #FC6C0F;
|
|
39
|
-
line-height: 1;
|
|
40
|
-
justify-content: start;
|
|
41
|
-
align-items: center;
|
|
42
|
-
clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
#shopify-block-{{ block.id }} .price-tag-mini__main {
|
|
46
|
-
font-size: 12px;
|
|
47
|
-
}
|
|
48
|
-
#shopify-block-{{ block.id }} .price-tag-mini__main-discount {
|
|
49
|
-
font-size: 13px;
|
|
50
|
-
}
|
|
51
|
-
#shopify-block-{{ block.id }} .price-tag-mini__main-discount-off {
|
|
52
|
-
font-size: 9px;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@media (min-width: 750px) {
|
|
56
|
-
#shopify-block-{{ block.id }} .price-tag-mini {
|
|
57
|
-
height: 54px;
|
|
58
|
-
}
|
|
59
|
-
#shopify-block-{{ block.id }} .price-tag-mini__main {
|
|
60
|
-
font-size: 16px;
|
|
61
|
-
}
|
|
62
|
-
#shopify-block-{{ block.id }} .price-tag-mini__main-discount {
|
|
63
|
-
font-size: 18px;
|
|
64
|
-
}
|
|
65
|
-
#shopify-block-{{ block.id }} .price-tag-mini__main-discount-off {
|
|
66
|
-
font-size: 12px;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
#shopify-block-{{ block.id }} .price-tag-mini span {
|
|
71
|
-
position: relative;
|
|
72
|
-
z-index: 1;
|
|
73
|
-
}
|
|
74
|
-
</style>
|
|
75
|
-
|
|
76
|
-
{% schema %}
|
|
77
|
-
{
|
|
78
|
-
"name": "Price Tag Mini",
|
|
79
|
-
"settings": [
|
|
80
|
-
{
|
|
81
|
-
"type": "product",
|
|
82
|
-
"id": "product",
|
|
83
|
-
"label": "Product",
|
|
84
|
-
"info": "选择产品"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"type": "text",
|
|
88
|
-
"id": "variant_id",
|
|
89
|
-
"label": "Variant ID",
|
|
90
|
-
"placeholder": "变体ID",
|
|
91
|
-
"info": "输入变体ID,变体ID可以在产品编辑页面查看"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"type": "checkbox",
|
|
95
|
-
"id": "show_discount_percentage_off",
|
|
96
|
-
"label": "展示 Off 后缀",
|
|
97
|
-
"default": true
|
|
98
|
-
}
|
|
99
|
-
],
|
|
100
|
-
"presets": [
|
|
101
|
-
{
|
|
102
|
-
"name": "Price Tag Mini"
|
|
103
|
-
}
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
{% endschema %}
|
|
1
|
+
{% assign product = all_products[block.settings.product] %}
|
|
2
|
+
{% assign variant_id = block.settings.variant_id | times: 1 %}
|
|
3
|
+
{% assign variant = product.variants | where: 'id', variant_id | first %}
|
|
4
|
+
|
|
5
|
+
{% if variant %}
|
|
6
|
+
{% assign current_price = variant.price %}
|
|
7
|
+
{% assign compare_at_price = variant.compare_at_price %}
|
|
8
|
+
{% assign discount_percentage = 0 %}
|
|
9
|
+
|
|
10
|
+
{% if compare_at_price and compare_at_price > current_price %}
|
|
11
|
+
{% assign percent = current_price
|
|
12
|
+
| times: 100
|
|
13
|
+
| divided_by: compare_at_price
|
|
14
|
+
%}
|
|
15
|
+
{% assign discount_percentage = 100 | minus: percent %}
|
|
16
|
+
<span class='price-tag-mini'>
|
|
17
|
+
<span class='price-tag-mini__main'>UP TO</span
|
|
18
|
+
><span class='price-tag-mini__main-price'>
|
|
19
|
+
<span class='price-tag-mini__main-discount'>
|
|
20
|
+
{{- discount_percentage -}}</span
|
|
21
|
+
><span class='price-tag-mini__main-discount-off'>%off</span>
|
|
22
|
+
</span>
|
|
23
|
+
</span>
|
|
24
|
+
{% endif %}
|
|
25
|
+
{% endif %}
|
|
26
|
+
|
|
27
|
+
<style>
|
|
28
|
+
#shopify-block-{{ block.id }} .price-tag-mini {
|
|
29
|
+
left: 20px;
|
|
30
|
+
position: relative;
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
height: 40px;
|
|
34
|
+
margin-bottom: 10px;
|
|
35
|
+
padding: 4px 4px;
|
|
36
|
+
color: #fff;
|
|
37
|
+
font-weight: bold;
|
|
38
|
+
background-color: #FC6C0F;
|
|
39
|
+
line-height: 1;
|
|
40
|
+
justify-content: start;
|
|
41
|
+
align-items: center;
|
|
42
|
+
clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
#shopify-block-{{ block.id }} .price-tag-mini__main {
|
|
46
|
+
font-size: 12px;
|
|
47
|
+
}
|
|
48
|
+
#shopify-block-{{ block.id }} .price-tag-mini__main-discount {
|
|
49
|
+
font-size: 13px;
|
|
50
|
+
}
|
|
51
|
+
#shopify-block-{{ block.id }} .price-tag-mini__main-discount-off {
|
|
52
|
+
font-size: 9px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@media (min-width: 750px) {
|
|
56
|
+
#shopify-block-{{ block.id }} .price-tag-mini {
|
|
57
|
+
height: 54px;
|
|
58
|
+
}
|
|
59
|
+
#shopify-block-{{ block.id }} .price-tag-mini__main {
|
|
60
|
+
font-size: 16px;
|
|
61
|
+
}
|
|
62
|
+
#shopify-block-{{ block.id }} .price-tag-mini__main-discount {
|
|
63
|
+
font-size: 18px;
|
|
64
|
+
}
|
|
65
|
+
#shopify-block-{{ block.id }} .price-tag-mini__main-discount-off {
|
|
66
|
+
font-size: 12px;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
#shopify-block-{{ block.id }} .price-tag-mini span {
|
|
71
|
+
position: relative;
|
|
72
|
+
z-index: 1;
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
75
|
+
|
|
76
|
+
{% schema %}
|
|
77
|
+
{
|
|
78
|
+
"name": "Price Tag Mini",
|
|
79
|
+
"settings": [
|
|
80
|
+
{
|
|
81
|
+
"type": "product",
|
|
82
|
+
"id": "product",
|
|
83
|
+
"label": "Product",
|
|
84
|
+
"info": "选择产品"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"type": "text",
|
|
88
|
+
"id": "variant_id",
|
|
89
|
+
"label": "Variant ID",
|
|
90
|
+
"placeholder": "变体ID",
|
|
91
|
+
"info": "输入变体ID,变体ID可以在产品编辑页面查看"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"type": "checkbox",
|
|
95
|
+
"id": "show_discount_percentage_off",
|
|
96
|
+
"label": "展示 Off 后缀",
|
|
97
|
+
"default": true
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"presets": [
|
|
101
|
+
{
|
|
102
|
+
"name": "Price Tag Mini"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
{% endschema %}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
{% assign product = all_products[block.settings.product] %}
|
|
2
|
-
{% assign variant_id = block.settings.variant_id | times: 1 %}
|
|
3
|
-
{% assign variant = product.variants | where: 'id', variant_id | first %}
|
|
4
|
-
|
|
5
|
-
{% render 'zz-price-tag',
|
|
6
|
-
price: variant.price,
|
|
7
|
-
compare_at_price: variant.compare_at_price,
|
|
8
|
-
show_discount_percentage_off: block.settings.show_discount_percentage_off
|
|
9
|
-
%}
|
|
10
|
-
|
|
11
|
-
{% schema %}
|
|
12
|
-
{
|
|
13
|
-
"name": "Price Tag",
|
|
14
|
-
"settings": [
|
|
15
|
-
{
|
|
16
|
-
"type": "product",
|
|
17
|
-
"id": "product",
|
|
18
|
-
"label": "Product",
|
|
19
|
-
"info": "选择产品"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"type": "text",
|
|
23
|
-
"id": "variant_id",
|
|
24
|
-
"label": "Variant ID",
|
|
25
|
-
"placeholder": "变体ID",
|
|
26
|
-
"info": "输入变体ID,变体ID可以在产品编辑页面查看"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"type": "checkbox",
|
|
30
|
-
"id": "show_discount_percentage_off",
|
|
31
|
-
"label": "展示 Off 后缀",
|
|
32
|
-
"default": false
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
"presets": [
|
|
36
|
-
{
|
|
37
|
-
"name": "Price Tag"
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
{% endschema %}
|
|
1
|
+
{% assign product = all_products[block.settings.product] %}
|
|
2
|
+
{% assign variant_id = block.settings.variant_id | times: 1 %}
|
|
3
|
+
{% assign variant = product.variants | where: 'id', variant_id | first %}
|
|
4
|
+
|
|
5
|
+
{% render 'zz-price-tag',
|
|
6
|
+
price: variant.price,
|
|
7
|
+
compare_at_price: variant.compare_at_price,
|
|
8
|
+
show_discount_percentage_off: block.settings.show_discount_percentage_off
|
|
9
|
+
%}
|
|
10
|
+
|
|
11
|
+
{% schema %}
|
|
12
|
+
{
|
|
13
|
+
"name": "Price Tag",
|
|
14
|
+
"settings": [
|
|
15
|
+
{
|
|
16
|
+
"type": "product",
|
|
17
|
+
"id": "product",
|
|
18
|
+
"label": "Product",
|
|
19
|
+
"info": "选择产品"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"type": "text",
|
|
23
|
+
"id": "variant_id",
|
|
24
|
+
"label": "Variant ID",
|
|
25
|
+
"placeholder": "变体ID",
|
|
26
|
+
"info": "输入变体ID,变体ID可以在产品编辑页面查看"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"type": "checkbox",
|
|
30
|
+
"id": "show_discount_percentage_off",
|
|
31
|
+
"label": "展示 Off 后缀",
|
|
32
|
+
"default": false
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"presets": [
|
|
36
|
+
{
|
|
37
|
+
"name": "Price Tag"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
{% endschema %}
|
|
@@ -1,182 +1,182 @@
|
|
|
1
|
-
{% schema %}
|
|
2
|
-
{
|
|
3
|
-
"name": "Ratio Image",
|
|
4
|
-
"class": "ratio-image",
|
|
5
|
-
"settings": [
|
|
6
|
-
{
|
|
7
|
-
"type": "header",
|
|
8
|
-
"content": "PC端设置"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"type": "image_picker",
|
|
12
|
-
"id": "desktop_image",
|
|
13
|
-
"label": "PC端图片"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"type": "range",
|
|
17
|
-
"id": "pc_width",
|
|
18
|
-
"min": 0,
|
|
19
|
-
"max": 100,
|
|
20
|
-
"step": 1,
|
|
21
|
-
"unit": "%",
|
|
22
|
-
"label": "PC端占父容器的百分比,单位%",
|
|
23
|
-
"default": 50
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"type": "number",
|
|
27
|
-
"id": "desktop_border_radius",
|
|
28
|
-
"label": "PC端圆角",
|
|
29
|
-
"default": 16,
|
|
30
|
-
"info": "单位:px"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"type": "header",
|
|
34
|
-
"content": "移动端设置"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"type": "image_picker",
|
|
38
|
-
"id": "mobile_image",
|
|
39
|
-
"label": "移动端图片"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"type": "range",
|
|
43
|
-
"id": "mobile_width",
|
|
44
|
-
"min": 0,
|
|
45
|
-
"max": 100,
|
|
46
|
-
"step": 1,
|
|
47
|
-
"unit": "%",
|
|
48
|
-
"label": "移动端占父容器的百分比,单位%",
|
|
49
|
-
"default": 100
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"type": "number",
|
|
53
|
-
"id": "mobile_border_radius",
|
|
54
|
-
"label": "移动端圆角",
|
|
55
|
-
"default": 10,
|
|
56
|
-
"info": "单位:px"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"type": "text",
|
|
60
|
-
"id": "alt",
|
|
61
|
-
"label": "alt",
|
|
62
|
-
"default": "image loading"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"type": "checkbox",
|
|
66
|
-
"id": "has_link",
|
|
67
|
-
"label": "是否有链接",
|
|
68
|
-
"default": false
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"type": "select",
|
|
72
|
-
"id": "function_type",
|
|
73
|
-
"label": "功能类型",
|
|
74
|
-
"options": [
|
|
75
|
-
{
|
|
76
|
-
"value": "link",
|
|
77
|
-
"label": "链接"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"value": "link_map",
|
|
81
|
-
"label": "多国家映射"
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
|
-
"default": "link",
|
|
85
|
-
"visible_if": "{{ block.settings.has_link == true }}"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"type": "url",
|
|
89
|
-
"id": "url",
|
|
90
|
-
"label": "链接",
|
|
91
|
-
"visible_if": "{{ block.settings.function_type == 'link' and block.settings.has_link == true }}"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"type": "textarea",
|
|
95
|
-
"id": "links",
|
|
96
|
-
"label": "Sites Link Map",
|
|
97
|
-
"info": "国家对应链接的表,国家即是国家选择器上显示的字段,国家和路由之间用冒号隔开( 冒号后要加空格)。国家之间换行,“default”为其他未写的默认的链接 EG: Canada: https://hoverair.com/ default: https://hoverair.com/ ",
|
|
98
|
-
"visible_if": "{{ block.settings.function_type == 'link_map' and block.settings.has_link == true }}"
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
],
|
|
102
|
-
"presets": [
|
|
103
|
-
{
|
|
104
|
-
"name": "Ratio Image"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"name": "宽度比例图片"
|
|
108
|
-
}
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
{% endschema %}
|
|
112
|
-
|
|
113
|
-
{% assign link_class = 'zz-link-' | append: block.id %}
|
|
114
|
-
{% assign image_class = 'ratio-image ' | append: link_class %}
|
|
115
|
-
|
|
116
|
-
{% render 'zz-img',
|
|
117
|
-
pc_image: block.settings.desktop_image,
|
|
118
|
-
mb_image: block.settings.mobile_image,
|
|
119
|
-
image_alt: block.settings.alt | escape,
|
|
120
|
-
class_name: image_class,
|
|
121
|
-
%}
|
|
122
|
-
|
|
123
|
-
<style>
|
|
124
|
-
|
|
125
|
-
#shopify-block-{{ block.id }} {
|
|
126
|
-
{% if block.settings.has_link %}
|
|
127
|
-
cursor: pointer;
|
|
128
|
-
{% endif %}
|
|
129
|
-
overflow: hidden;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
@media screen and (max-width: 1023px) {
|
|
133
|
-
#shopify-block-{{ block.id }} {
|
|
134
|
-
width: {% if block.settings.mobile_width > 0 %}{{ block.settings.mobile_width }}%{% else %}100%{% endif %};
|
|
135
|
-
border-radius: {{ block.settings.mobile_border_radius }}px;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
@media screen and (min-width: 1024px) {
|
|
140
|
-
#shopify-block-{{ block.id }} {
|
|
141
|
-
width: {% if block.settings.pc_width > 0 %}{{ block.settings.pc_width }}%{% else %}100%{% endif %};
|
|
142
|
-
border-radius: {{ block.settings.desktop_border_radius }}px;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
</style>
|
|
148
|
-
|
|
149
|
-
{% if block.settings.has_link %}
|
|
150
|
-
{% if block.settings.function_type == 'link_map' %}
|
|
151
|
-
<script>
|
|
152
|
-
document.addEventListener('DOMContentLoaded', (event) => {
|
|
153
|
-
const btn = document.getElementsByClassName('{{ link_class }}')
|
|
154
|
-
if(btn && btn.length > 0) {
|
|
155
|
-
Array.from(btn).forEach(item => {
|
|
156
|
-
if(window.bindSiteJump) {
|
|
157
|
-
bindSiteJump(item, {{ block.settings.links | json }})
|
|
158
|
-
}
|
|
159
|
-
})
|
|
160
|
-
}
|
|
161
|
-
})
|
|
162
|
-
</script>
|
|
163
|
-
{% else %}
|
|
164
|
-
<script>
|
|
165
|
-
document.addEventListener('DOMContentLoaded', (event) => {
|
|
166
|
-
|
|
167
|
-
const btn = document.getElementsByClassName('{{ link_class }}')
|
|
168
|
-
if(btn && btn.length > 0) {
|
|
169
|
-
Array.from(btn).forEach(item => {
|
|
170
|
-
item.addEventListener('click', (event) => {
|
|
171
|
-
event.preventDefault();
|
|
172
|
-
// 阻止冒泡
|
|
173
|
-
event.stopPropagation();
|
|
174
|
-
window.location.href = '{{ block.settings.url }}';
|
|
175
|
-
})
|
|
176
|
-
})
|
|
177
|
-
}
|
|
178
|
-
})
|
|
179
|
-
</script>
|
|
180
|
-
{% endif %}
|
|
181
|
-
|
|
1
|
+
{% schema %}
|
|
2
|
+
{
|
|
3
|
+
"name": "Ratio Image",
|
|
4
|
+
"class": "ratio-image",
|
|
5
|
+
"settings": [
|
|
6
|
+
{
|
|
7
|
+
"type": "header",
|
|
8
|
+
"content": "PC端设置"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"type": "image_picker",
|
|
12
|
+
"id": "desktop_image",
|
|
13
|
+
"label": "PC端图片"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"type": "range",
|
|
17
|
+
"id": "pc_width",
|
|
18
|
+
"min": 0,
|
|
19
|
+
"max": 100,
|
|
20
|
+
"step": 1,
|
|
21
|
+
"unit": "%",
|
|
22
|
+
"label": "PC端占父容器的百分比,单位%",
|
|
23
|
+
"default": 50
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "number",
|
|
27
|
+
"id": "desktop_border_radius",
|
|
28
|
+
"label": "PC端圆角",
|
|
29
|
+
"default": 16,
|
|
30
|
+
"info": "单位:px"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"type": "header",
|
|
34
|
+
"content": "移动端设置"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": "image_picker",
|
|
38
|
+
"id": "mobile_image",
|
|
39
|
+
"label": "移动端图片"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"type": "range",
|
|
43
|
+
"id": "mobile_width",
|
|
44
|
+
"min": 0,
|
|
45
|
+
"max": 100,
|
|
46
|
+
"step": 1,
|
|
47
|
+
"unit": "%",
|
|
48
|
+
"label": "移动端占父容器的百分比,单位%",
|
|
49
|
+
"default": 100
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "number",
|
|
53
|
+
"id": "mobile_border_radius",
|
|
54
|
+
"label": "移动端圆角",
|
|
55
|
+
"default": 10,
|
|
56
|
+
"info": "单位:px"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"type": "text",
|
|
60
|
+
"id": "alt",
|
|
61
|
+
"label": "alt",
|
|
62
|
+
"default": "image loading"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "checkbox",
|
|
66
|
+
"id": "has_link",
|
|
67
|
+
"label": "是否有链接",
|
|
68
|
+
"default": false
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"type": "select",
|
|
72
|
+
"id": "function_type",
|
|
73
|
+
"label": "功能类型",
|
|
74
|
+
"options": [
|
|
75
|
+
{
|
|
76
|
+
"value": "link",
|
|
77
|
+
"label": "链接"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"value": "link_map",
|
|
81
|
+
"label": "多国家映射"
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
"default": "link",
|
|
85
|
+
"visible_if": "{{ block.settings.has_link == true }}"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"type": "url",
|
|
89
|
+
"id": "url",
|
|
90
|
+
"label": "链接",
|
|
91
|
+
"visible_if": "{{ block.settings.function_type == 'link' and block.settings.has_link == true }}"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"type": "textarea",
|
|
95
|
+
"id": "links",
|
|
96
|
+
"label": "Sites Link Map",
|
|
97
|
+
"info": "国家对应链接的表,国家即是国家选择器上显示的字段,国家和路由之间用冒号隔开( 冒号后要加空格)。国家之间换行,“default”为其他未写的默认的链接 EG: Canada: https://hoverair.com/ default: https://hoverair.com/ ",
|
|
98
|
+
"visible_if": "{{ block.settings.function_type == 'link_map' and block.settings.has_link == true }}"
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
],
|
|
102
|
+
"presets": [
|
|
103
|
+
{
|
|
104
|
+
"name": "Ratio Image"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "宽度比例图片"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
{% endschema %}
|
|
112
|
+
|
|
113
|
+
{% assign link_class = 'zz-link-' | append: block.id %}
|
|
114
|
+
{% assign image_class = 'ratio-image ' | append: link_class %}
|
|
115
|
+
|
|
116
|
+
{% render 'zz-img',
|
|
117
|
+
pc_image: block.settings.desktop_image,
|
|
118
|
+
mb_image: block.settings.mobile_image,
|
|
119
|
+
image_alt: block.settings.alt | escape,
|
|
120
|
+
class_name: image_class,
|
|
121
|
+
%}
|
|
122
|
+
|
|
123
|
+
<style>
|
|
124
|
+
|
|
125
|
+
#shopify-block-{{ block.id }} {
|
|
126
|
+
{% if block.settings.has_link %}
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
{% endif %}
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@media screen and (max-width: 1023px) {
|
|
133
|
+
#shopify-block-{{ block.id }} {
|
|
134
|
+
width: {% if block.settings.mobile_width > 0 %}{{ block.settings.mobile_width }}%{% else %}100%{% endif %};
|
|
135
|
+
border-radius: {{ block.settings.mobile_border_radius }}px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
@media screen and (min-width: 1024px) {
|
|
140
|
+
#shopify-block-{{ block.id }} {
|
|
141
|
+
width: {% if block.settings.pc_width > 0 %}{{ block.settings.pc_width }}%{% else %}100%{% endif %};
|
|
142
|
+
border-radius: {{ block.settings.desktop_border_radius }}px;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
</style>
|
|
148
|
+
|
|
149
|
+
{% if block.settings.has_link %}
|
|
150
|
+
{% if block.settings.function_type == 'link_map' %}
|
|
151
|
+
<script>
|
|
152
|
+
document.addEventListener('DOMContentLoaded', (event) => {
|
|
153
|
+
const btn = document.getElementsByClassName('{{ link_class }}')
|
|
154
|
+
if(btn && btn.length > 0) {
|
|
155
|
+
Array.from(btn).forEach(item => {
|
|
156
|
+
if(window.bindSiteJump) {
|
|
157
|
+
bindSiteJump(item, {{ block.settings.links | json }})
|
|
158
|
+
}
|
|
159
|
+
})
|
|
160
|
+
}
|
|
161
|
+
})
|
|
162
|
+
</script>
|
|
163
|
+
{% else %}
|
|
164
|
+
<script>
|
|
165
|
+
document.addEventListener('DOMContentLoaded', (event) => {
|
|
166
|
+
|
|
167
|
+
const btn = document.getElementsByClassName('{{ link_class }}')
|
|
168
|
+
if(btn && btn.length > 0) {
|
|
169
|
+
Array.from(btn).forEach(item => {
|
|
170
|
+
item.addEventListener('click', (event) => {
|
|
171
|
+
event.preventDefault();
|
|
172
|
+
// 阻止冒泡
|
|
173
|
+
event.stopPropagation();
|
|
174
|
+
window.location.href = '{{ block.settings.url }}';
|
|
175
|
+
})
|
|
176
|
+
})
|
|
177
|
+
}
|
|
178
|
+
})
|
|
179
|
+
</script>
|
|
180
|
+
{% endif %}
|
|
181
|
+
|
|
182
182
|
{% endif %}
|