zz-shopify-components 0.0.24 → 0.0.26

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.
@@ -15,7 +15,7 @@ class WorldVideoCommentsDialog extends HTMLElement {
15
15
  this.baseUrl =
16
16
  this.dataset.requestType === 'prod'
17
17
  ? 'https://h130-app-server-us.hoverx1.cn'
18
- : 'https://h130-app-server-test-cn.hoverx1.cn';
18
+ : 'https://h130-app-server-test-us.hoverx1.cn';
19
19
  }
20
20
 
21
21
  init() {
@@ -14,7 +14,7 @@ class WorldVideoList extends HTMLElement {
14
14
  this.baseUrl =
15
15
  this.dataset.requestType === 'prod'
16
16
  ? 'https://h130-app-server-us.hoverx1.cn'
17
- : 'https://h130-app-server-test-cn.hoverx1.cn';
17
+ : 'https://h130-app-server-test-us.hoverx1.cn';
18
18
  this.shopSelect = this.dataset.shopSelect;
19
19
  }
20
20
 
@@ -1,194 +1,203 @@
1
1
  <style>
2
- @media screen and (max-width: 750px) {
3
- #shopify-block-{{block.id}} {
4
- width: calc(100% - 72px);
5
- box-sizing: border-box;
6
- transform: translateX(-18px);
7
- }
2
+ @media screen and (max-width: 750px) {
3
+ #shopify-block-{{block.id}} {
4
+ width: calc(100% - 72px);
5
+ box-sizing: border-box;
6
+ transform: translateX(-18px);
8
7
  }
9
- @media screen and (min-width: 750px) {
10
- #shopify-block-{{block.id}} {
11
- width: 318px;
12
- }
8
+ #shopify-block-{{block.id}} .image-video-box {
9
+ width: 100%;
10
+ aspect-ratio: 3 / 4;
11
+ object-fit: cover;
13
12
  }
14
-
15
- #shopify-block-{{block.id}} .media-box {
16
- {% if block.settings.has_link %}
17
- cursor: pointer;
18
- {% endif %}
13
+ }
14
+ @media screen and (min-width: 750px) {
15
+ #shopify-block-{{block.id}} {
16
+ width: 318px;
19
17
  }
20
-
21
- </style>
22
-
23
- {% assign media_class = 'zz-link-' | append: block.id %}
24
-
25
- <div class='media-box banner-item {{ media_class }} max-md:tw-rounded-[12px] md:tw-rounded-[16px]'>
26
- {% if block.settings.video_pc != blank %}
27
- {% if block.settings.video_url_pc != blank %}
28
- {% assign pc_video = block.settings.video_url_pc %}
29
- {% else %}
30
- {% assign pc_video = block.settings.video_pc %}
31
- {% endif %}
32
- {% render 'zz-video-md',
33
- pc_video: pc_video,
34
- pc_poster: block.settings.poster_pc,
35
- mb_video: block.settings.video_mb,
36
- mb_poster: block.settings.poster_mb,
37
- lazy: true,
38
- class: 'image-video-box tw-w-full tw-h-auto max-md:tw-rounded-[12px] md:tw-rounded-[16px]',
39
- autoplay: true,
40
- muted: true,
41
- loop: true
42
- %}
18
+ #shopify-block-{{block.id}} .image-video-box {
19
+ width: 100%;
20
+ aspect-ratio: 9 / 16;
21
+ object-fit: cover;
22
+ }
23
+ }
24
+
25
+ #shopify-block-{{block.id}} .media-box {
26
+ {% if block.settings.has_link %}
27
+ cursor: pointer;
28
+ {% endif %}
29
+ }
30
+
31
+ </style>
32
+
33
+ {% assign media_class = 'zz-link-' | append: block.id %}
34
+
35
+ <div class='media-box banner-item {{ media_class }} max-md:tw-rounded-[12px] md:tw-rounded-[16px]'>
36
+ {% if block.settings.video_pc != blank %}
37
+ {% if block.settings.video_url_pc != blank %}
38
+ {% assign pc_video = block.settings.video_url_pc %}
43
39
  {% else %}
44
- {%
45
- render 'zz-img-md',
46
- pc_image: block.settings.poster_pc,
47
- mb_image: block.settings.poster_mb,
48
- image_alt: block.settings.heading | escape,
49
- class_name: 'image-video-box max-md:tw-rounded-[12px] md:tw-rounded-[16px]',
50
- %}
40
+ {% assign pc_video = block.settings.video_pc %}
51
41
  {% endif %}
52
- </div>
53
- {% if block.settings.has_title_and_content %}
54
- <div class='active-box-content md:tw-text-[20px] max-md:tw-text-[17px] max-md:tw-mt-[20px] md:tw-mt-[24px]'>
55
- <div class="tw-text-left tw-font-bold max-md:tw-text-[17px] md:tw-text-[20px]" style="color: {{ block.settings.title_color }};">
56
- {{ block.settings.heading }}
57
- </div>
58
- <div class='tw-mt-[12px] max-md:tw-text-[12px] md:tw-text-[14px] tw-leading-[1.5]' style="color: {{ block.settings.content_color }};">
59
- {{ block.settings.row_content }}
60
- </div>
61
- </div>
62
-
42
+ {% render 'zz-video-md',
43
+ pc_video: pc_video,
44
+ pc_poster: block.settings.poster_pc,
45
+ mb_video: block.settings.video_mb,
46
+ mb_poster: block.settings.poster_mb,
47
+ lazy: true,
48
+ class: 'image-video-box tw-w-full tw-h-auto max-md:tw-rounded-[12px] md:tw-rounded-[16px]',
49
+ autoplay: true,
50
+ muted: true,
51
+ loop: true
52
+ %}
53
+ {% else %}
54
+ {%
55
+ render 'zz-img-md',
56
+ pc_image: block.settings.poster_pc,
57
+ mb_image: block.settings.poster_mb,
58
+ image_alt: block.settings.heading | escape,
59
+ class_name: 'image-video-box max-md:tw-rounded-[12px] md:tw-rounded-[16px]',
60
+ %}
63
61
  {% endif %}
62
+ </div>
63
+ {% if block.settings.has_title_and_content %}
64
+ <div class='active-box-content md:tw-text-[20px] max-md:tw-text-[17px] max-md:tw-mt-[20px] md:tw-mt-[24px]'>
65
+ <div class="tw-text-left tw-font-bold max-md:tw-text-[17px] md:tw-text-[20px]" style="color: {{ block.settings.title_color }};">
66
+ {{ block.settings.heading }}
67
+ </div>
68
+ <div class='tw-mt-[12px] max-md:tw-text-[12px] md:tw-text-[14px] tw-leading-[1.5]' style="color: {{ block.settings.content_color }};">
69
+ {{ block.settings.row_content }}
70
+ </div>
71
+ </div>
64
72
 
65
- {% schema %}
66
- {
67
- "name": "ZZ Video Img Item",
68
- "class": "zz-video-img-item",
69
- "settings": [
70
- {
71
- "type": "text",
72
- "id": "video_url_pc",
73
- "label": "Video url PC",
74
- "info": "使用cdn视频时,填写视频url。防止大屏幕视频模糊"
75
- },
76
- {
77
- "type": "video",
78
- "id": "video_pc",
79
- "label": "Video"
80
- },
81
- {
82
- "type": "image_picker",
83
- "id": "poster_pc",
84
- "label": "Poster"
85
- },
86
- {
87
- "type": "video",
88
- "id": "video_mb",
89
- "label": "Video(Mobile)"
90
- },
91
- {
92
- "type": "image_picker",
93
- "id": "poster_mb",
94
- "label": "Poster(Mobile)"
95
- },
96
- {
97
- "type": "checkbox",
98
- "id": "has_title_and_content",
99
- "label": "是否有标题与内容",
100
- "default": true
101
- },
102
- {
103
- "type": "text",
104
- "id": "heading",
105
- "label": "标题",
106
- "visible_if": "{{ block.settings.has_title_and_content == true }}"
107
- },
108
- {
109
- "type": "color",
110
- "id": "title_color",
111
- "default": "#ffffff",
112
- "label": "标题颜色",
113
- "visible_if": "{{ block.settings.has_title_and_content == true }}"
114
- },
115
- {
116
- "type": "richtext",
117
- "id": "row_content",
118
- "label": "description",
119
- "visible_if": "{{ block.settings.has_title_and_content == true }}"
120
- },
121
- {
122
- "type": "color",
123
- "id": "content_color",
124
- "default": "#B2B2B2",
125
- "label": "内容颜色",
126
- "visible_if": "{{ block.settings.has_title_and_content == true }}"
127
- },
128
- {
129
- "type": "checkbox",
130
- "id": "has_link",
131
- "label": "是否有链接",
132
- "default": false
133
- },
134
- {
135
- "type": "select",
136
- "id": "function_type",
137
- "label": "功能类型",
138
- "options": [
139
- {
140
- "value": "link",
141
- "label": "链接"
142
- },
143
- {
144
- "value": "link_map",
145
- "label": "多国家映射"
73
+ {% endif %}
74
+
75
+ {% schema %}
76
+ {
77
+ "name": "ZZ Video Img Item",
78
+ "class": "zz-video-img-item",
79
+ "settings": [
80
+ {
81
+ "type": "text",
82
+ "id": "video_url_pc",
83
+ "label": "Video url PC",
84
+ "info": "使用cdn视频时,填写视频url。防止大屏幕视频模糊"
85
+ },
86
+ {
87
+ "type": "video",
88
+ "id": "video_pc",
89
+ "label": "Video"
90
+ },
91
+ {
92
+ "type": "image_picker",
93
+ "id": "poster_pc",
94
+ "label": "Poster"
95
+ },
96
+ {
97
+ "type": "video",
98
+ "id": "video_mb",
99
+ "label": "Video(Mobile)"
100
+ },
101
+ {
102
+ "type": "image_picker",
103
+ "id": "poster_mb",
104
+ "label": "Poster(Mobile)"
105
+ },
106
+ {
107
+ "type": "checkbox",
108
+ "id": "has_title_and_content",
109
+ "label": "是否有标题与内容",
110
+ "default": true
111
+ },
112
+ {
113
+ "type": "text",
114
+ "id": "heading",
115
+ "label": "标题",
116
+ "visible_if": "{{ block.settings.has_title_and_content == true }}"
117
+ },
118
+ {
119
+ "type": "color",
120
+ "id": "title_color",
121
+ "default": "#ffffff",
122
+ "label": "标题颜色",
123
+ "visible_if": "{{ block.settings.has_title_and_content == true }}"
124
+ },
125
+ {
126
+ "type": "richtext",
127
+ "id": "row_content",
128
+ "label": "description",
129
+ "visible_if": "{{ block.settings.has_title_and_content == true }}"
130
+ },
131
+ {
132
+ "type": "color",
133
+ "id": "content_color",
134
+ "default": "#B2B2B2",
135
+ "label": "内容颜色",
136
+ "visible_if": "{{ block.settings.has_title_and_content == true }}"
137
+ },
138
+ {
139
+ "type": "checkbox",
140
+ "id": "has_link",
141
+ "label": "是否有链接",
142
+ "default": false
143
+ },
144
+ {
145
+ "type": "select",
146
+ "id": "function_type",
147
+ "label": "功能类型",
148
+ "options": [
149
+ {
150
+ "value": "link",
151
+ "label": "链接"
152
+ },
153
+ {
154
+ "value": "link_map",
155
+ "label": "多国家映射"
156
+ }
157
+ ],
158
+ "default": "link",
159
+ "visible_if": "{{ block.settings.has_link == true }}"
160
+ },
161
+ {
162
+ "type": "url",
163
+ "id": "url",
164
+ "label": "链接",
165
+ "visible_if": "{{ block.settings.function_type == 'link' and block.settings.has_link == true }}"
166
+ },
167
+ {
168
+ "type": "textarea",
169
+ "id": "links",
170
+ "label": "Sites Link Map",
171
+ "info": "国家对应链接的表,国家即是国家选择器上显示的字段,国家和路由之间用冒号隔开( 冒号后要加空格)。国家之间换行,“default”为其他未写的默认的链接 EG: Canada: https://hoverair.com/ default: https://hoverair.com/ ",
172
+ "visible_if": "{{ block.settings.function_type == 'link_map' and block.settings.has_link == true }}"
173
+ }
174
+ ],
175
+ "presets": [
176
+ {
177
+ "name": "ZZ Video Img Item"
178
+ },
179
+ ]
180
+ }
181
+ {% endschema %}
182
+
183
+ {% if block.settings.has_link %}
184
+ <script>
185
+ document.addEventListener('DOMContentLoaded', (event) => {
186
+ const btn = document.getElementsByClassName('{{ media_class }}')
187
+ if(btn && btn[0]) {
188
+ {% if block.settings.function_type == 'link_map' %}
189
+ if(window.bindSiteJump) {
190
+ bindSiteJump(btn[0], {{ block.settings.links | json }})
146
191
  }
147
- ],
148
- "default": "link",
149
- "visible_if": "{{ block.settings.has_link == true }}"
150
- },
151
- {
152
- "type": "url",
153
- "id": "url",
154
- "label": "链接",
155
- "visible_if": "{{ block.settings.function_type == 'link' and block.settings.has_link == true }}"
156
- },
157
- {
158
- "type": "textarea",
159
- "id": "links",
160
- "label": "Sites Link Map",
161
- "info": "国家对应链接的表,国家即是国家选择器上显示的字段,国家和路由之间用冒号隔开( 冒号后要加空格)。国家之间换行,“default”为其他未写的默认的链接 EG: Canada: https://hoverair.com/ default: https://hoverair.com/ ",
162
- "visible_if": "{{ block.settings.function_type == 'link_map' and block.settings.has_link == true }}"
192
+ {% else %}
193
+ // 监听点击事件
194
+ btn[0].addEventListener('click', (event) => {
195
+ event.preventDefault();
196
+ window.location.href = '{{ block.settings.url }}';
197
+ })
198
+ {% endif %}
163
199
  }
164
- ],
165
- "presets": [
166
- {
167
- "name": "ZZ Video Img Item"
168
- },
169
- ]
170
- }
171
- {% endschema %}
172
-
173
- {% if block.settings.has_link %}
174
- <script>
175
- document.addEventListener('DOMContentLoaded', (event) => {
176
- const btn = document.getElementsByClassName('{{ media_class }}')
177
- if(btn && btn[0]) {
178
- {% if block.settings.function_type == 'link_map' %}
179
- if(window.bindSiteJump) {
180
- bindSiteJump(btn[0], {{ block.settings.links | json }})
181
- }
182
- {% else %}
183
- // 监听点击事件
184
- btn[0].addEventListener('click', (event) => {
185
- event.preventDefault();
186
- window.location.href = '{{ block.settings.url }}';
187
- })
188
- {% endif %}
189
- }
190
-
191
- })
192
- </script>
193
- {% endif %}
194
-
200
+
201
+ })
202
+ </script>
203
+ {% endif %}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zz-shopify-components",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "description": "Reusable Shopify components for theme projects",
5
5
  "keywords": [
6
6
  "shopify",