shoplazza-cli 0.0.1

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.
Files changed (181) hide show
  1. package/.editorconfig +28 -0
  2. package/.prettierrc +9 -0
  3. package/LICENSE +21 -0
  4. package/README.md +208 -0
  5. package/bin/shoplazza +117 -0
  6. package/fixtures/assets/blog.scss +74 -0
  7. package/fixtures/assets/cart_modal.scss +450 -0
  8. package/fixtures/assets/collection_detail.js +234 -0
  9. package/fixtures/assets/collection_detail.scss +345 -0
  10. package/fixtures/assets/collection_list.scss +11 -0
  11. package/fixtures/assets/collection_slider.scss +169 -0
  12. package/fixtures/assets/feature_columns.scss +26 -0
  13. package/fixtures/assets/feature_product.scss +109 -0
  14. package/fixtures/assets/footer.js +58 -0
  15. package/fixtures/assets/footer.scss +337 -0
  16. package/fixtures/assets/four_images.scss +29 -0
  17. package/fixtures/assets/gallery.scss +55 -0
  18. package/fixtures/assets/header.js +178 -0
  19. package/fixtures/assets/header.scss +929 -0
  20. package/fixtures/assets/image_text.scss +72 -0
  21. package/fixtures/assets/logo_bar.scss +11 -0
  22. package/fixtures/assets/newsletter.scss +90 -0
  23. package/fixtures/assets/not_found.scss +39 -0
  24. package/fixtures/assets/page_detail.scss +16 -0
  25. package/fixtures/assets/pagination.scss +150 -0
  26. package/fixtures/assets/postcss.config.js +6 -0
  27. package/fixtures/assets/product_description.scss +88 -0
  28. package/fixtures/assets/product_detail.js +634 -0
  29. package/fixtures/assets/product_detail.scss +1106 -0
  30. package/fixtures/assets/relative_product.scss +45 -0
  31. package/fixtures/assets/reviews.scss +70 -0
  32. package/fixtures/assets/rich_text.scss +71 -0
  33. package/fixtures/assets/search.js +87 -0
  34. package/fixtures/assets/search.scss +67 -0
  35. package/fixtures/assets/slide.scss +51 -0
  36. package/fixtures/assets/slider.scss +141 -0
  37. package/fixtures/assets/theme.css +976 -0
  38. package/fixtures/assets/theme.scss +1100 -0
  39. package/fixtures/assets/three_images.scss +20 -0
  40. package/fixtures/assets/tools.scss +23 -0
  41. package/fixtures/assets/two_images.scss +24 -0
  42. package/fixtures/assets/video.scss +45 -0
  43. package/fixtures/assets/video_text.scss +63 -0
  44. package/fixtures/config/settings_data.json +107 -0
  45. package/fixtures/config/settings_schema.json +690 -0
  46. package/fixtures/layout/theme.liquid +76 -0
  47. package/fixtures/locales/ar-SA.json +212 -0
  48. package/fixtures/locales/de-DE.json +290 -0
  49. package/fixtures/locales/en-US.json +290 -0
  50. package/fixtures/locales/es-ES.json +290 -0
  51. package/fixtures/locales/fr-FR.json +290 -0
  52. package/fixtures/locales/id-ID.json +212 -0
  53. package/fixtures/locales/it-IT.json +212 -0
  54. package/fixtures/locales/ja-JP.json +289 -0
  55. package/fixtures/locales/ko-KR.json +290 -0
  56. package/fixtures/locales/nl-NL.json +290 -0
  57. package/fixtures/locales/pl-PL.json +290 -0
  58. package/fixtures/locales/pt-PT.json +212 -0
  59. package/fixtures/locales/ru-RU.json +212 -0
  60. package/fixtures/locales/th-TH.json +212 -0
  61. package/fixtures/locales/zh-CN.json +290 -0
  62. package/fixtures/locales/zh-TW.json +290 -0
  63. package/fixtures/sections/apps.liquid +47 -0
  64. package/fixtures/sections/blog.liquid +137 -0
  65. package/fixtures/sections/collection_desc.liquid +34 -0
  66. package/fixtures/sections/collection_detail.liquid +436 -0
  67. package/fixtures/sections/collection_image.liquid +104 -0
  68. package/fixtures/sections/collection_list.liquid +161 -0
  69. package/fixtures/sections/collection_name.liquid +34 -0
  70. package/fixtures/sections/collection_slider.liquid +330 -0
  71. package/fixtures/sections/feature_columns.liquid +275 -0
  72. package/fixtures/sections/feature_product.liquid +227 -0
  73. package/fixtures/sections/footer.liquid +488 -0
  74. package/fixtures/sections/four_images.liquid +160 -0
  75. package/fixtures/sections/gallery.liquid +258 -0
  76. package/fixtures/sections/header.liquid +1157 -0
  77. package/fixtures/sections/html.liquid +40 -0
  78. package/fixtures/sections/image_text.liquid +350 -0
  79. package/fixtures/sections/instagram_plus.liquid +393 -0
  80. package/fixtures/sections/logo_bar.liquid +183 -0
  81. package/fixtures/sections/newsletter.liquid +225 -0
  82. package/fixtures/sections/not_found.liquid +39 -0
  83. package/fixtures/sections/overlay_image.liquid +648 -0
  84. package/fixtures/sections/page_detail.liquid +39 -0
  85. package/fixtures/sections/photo_collection.liquid +433 -0
  86. package/fixtures/sections/product_description.liquid +208 -0
  87. package/fixtures/sections/product_detail.liquid +611 -0
  88. package/fixtures/sections/products.liquid +216 -0
  89. package/fixtures/sections/relative_product.liquid +121 -0
  90. package/fixtures/sections/reviews.liquid +115 -0
  91. package/fixtures/sections/rich_text.liquid +157 -0
  92. package/fixtures/sections/search.liquid +163 -0
  93. package/fixtures/sections/slide.liquid +719 -0
  94. package/fixtures/sections/three_images.liquid +157 -0
  95. package/fixtures/sections/two_images.liquid +125 -0
  96. package/fixtures/sections/video.liquid +95 -0
  97. package/fixtures/sections/video_text.liquid +128 -0
  98. package/fixtures/snippets/bgset.liquid +21 -0
  99. package/fixtures/snippets/card_title.liquid +8 -0
  100. package/fixtures/snippets/cart_modal.liquid +74 -0
  101. package/fixtures/snippets/collection.liquid +77 -0
  102. package/fixtures/snippets/collection_filter_modal.liquid +56 -0
  103. package/fixtures/snippets/default_image_4.liquid +14 -0
  104. package/fixtures/snippets/default_image_6.liquid +18 -0
  105. package/fixtures/snippets/default_image_8.liquid +23 -0
  106. package/fixtures/snippets/four_images_item.liquid +8 -0
  107. package/fixtures/snippets/header_ads.liquid +95 -0
  108. package/fixtures/snippets/hero_image.liquid +94 -0
  109. package/fixtures/snippets/icon_video_play_large.liquid +1 -0
  110. package/fixtures/snippets/icon_video_play_medium.liquid +4 -0
  111. package/fixtures/snippets/icon_video_play_small.liquid +4 -0
  112. package/fixtures/snippets/lazyimg.liquid +22 -0
  113. package/fixtures/snippets/lazyimg_art.liquid +36 -0
  114. package/fixtures/snippets/lazysizes.liquid +41 -0
  115. package/fixtures/snippets/link.liquid +2 -0
  116. package/fixtures/snippets/pagination.liquid +48 -0
  117. package/fixtures/snippets/product.liquid +126 -0
  118. package/fixtures/snippets/product_art_tpl.liquid +152 -0
  119. package/fixtures/snippets/product_info_body.liquid +337 -0
  120. package/fixtures/snippets/product_info_tpl.liquid +423 -0
  121. package/fixtures/snippets/product_label.liquid +46 -0
  122. package/fixtures/snippets/settings.liquid +295 -0
  123. package/fixtures/snippets/social-meta-tags.liquid +106 -0
  124. package/fixtures/snippets/video_html.liquid +11 -0
  125. package/fixtures/snippets/video_source.liquid +98 -0
  126. package/fixtures/snippets/video_thumb_icon.liquid +2 -0
  127. package/fixtures/templates/404.liquid +1 -0
  128. package/fixtures/templates/collection.liquid +92 -0
  129. package/fixtures/templates/index.liquid +206 -0
  130. package/fixtures/templates/page.liquid +1 -0
  131. package/fixtures/templates/product.liquid +99 -0
  132. package/fixtures/templates/search.liquid +1 -0
  133. package/jest.config.js +192 -0
  134. package/lib/__tests__/log.test.js +15 -0
  135. package/lib/__tests__/utils.test.js +69 -0
  136. package/lib/auth/__mocks__/getCode.js +7 -0
  137. package/lib/auth/__mocks__/index.js +0 -0
  138. package/lib/auth/child.js +23 -0
  139. package/lib/auth/getCode.js +35 -0
  140. package/lib/auth/index.js +91 -0
  141. package/lib/commands/__tests__/login.test.js +77 -0
  142. package/lib/commands/__tests__/logout.test.js +29 -0
  143. package/lib/commands/__tests__/store.test.js +44 -0
  144. package/lib/commands/__tests__/switch.test.js +45 -0
  145. package/lib/commands/login.js +99 -0
  146. package/lib/commands/logout.js +14 -0
  147. package/lib/commands/store.js +14 -0
  148. package/lib/commands/switch.js +52 -0
  149. package/lib/commands/theme/__tests__/delete.test.js +49 -0
  150. package/lib/commands/theme/__tests__/init.test.js +21 -0
  151. package/lib/commands/theme/__tests__/list.test.js +80 -0
  152. package/lib/commands/theme/__tests__/package.test.js +17 -0
  153. package/lib/commands/theme/__tests__/publish.test.js +61 -0
  154. package/lib/commands/theme/__tests__/pull.test.js +69 -0
  155. package/lib/commands/theme/__tests__/push.test.js +63 -0
  156. package/lib/commands/theme/__tests__/serve.test.js +107 -0
  157. package/lib/commands/theme/delete.js +64 -0
  158. package/lib/commands/theme/init.js +51 -0
  159. package/lib/commands/theme/list.js +28 -0
  160. package/lib/commands/theme/package.js +37 -0
  161. package/lib/commands/theme/publish.js +56 -0
  162. package/lib/commands/theme/pull.js +62 -0
  163. package/lib/commands/theme/push.js +106 -0
  164. package/lib/commands/theme/serve.js +153 -0
  165. package/lib/commands/theme/share.js +20 -0
  166. package/lib/commands/version.js +6 -0
  167. package/lib/config.js +5 -0
  168. package/lib/db/__mocks__/index.js +9 -0
  169. package/lib/db/__tests__/analytics.test.js +19 -0
  170. package/lib/db/__tests__/user.test.js +20 -0
  171. package/lib/db/analytics.js +48 -0
  172. package/lib/db/index.js +9 -0
  173. package/lib/db/user.js +68 -0
  174. package/lib/log.js +13 -0
  175. package/lib/openAPI/__mocks__/index.js +20 -0
  176. package/lib/openAPI/api.js +76 -0
  177. package/lib/openAPI/index.js +46 -0
  178. package/lib/report.js +37 -0
  179. package/lib/tracing.js +50 -0
  180. package/lib/utils.js +48 -0
  181. package/package.json +54 -0
@@ -0,0 +1,719 @@
1
+ {% use 'slide.css' %}
2
+ {% assign text = section.settings.text %}
3
+ {% assign text_color=section.settings.text_color %}
4
+ {% comment %} 高度转换 {% endcomment %}
5
+ {% if section.settings.img_height == "large" %}
6
+ {% assign mobile_height = "460px" %}
7
+ {% assign pc_height = "600px" %}
8
+ {% elsif section.settings.img_height == "medium" %}
9
+ {% assign mobile_height = "325px" %}
10
+ {% assign pc_height = "450px" %}
11
+ {% elsif section.settings.img_height == "small" %}
12
+ {% assign mobile_height = "200px" %}
13
+ {% assign pc_height = "300px" %}
14
+ {% elsif section.settings.img_height == "x-small" %}
15
+ {% assign mobile_height = "150px" %}
16
+ {% assign pc_height = "200px" %}
17
+ {% elsif section.settings.img_height == "normal" %}
18
+ {% assign mobile_height = "normal" %}
19
+ {% assign pc_height = "normal" %}
20
+ {% else %}
21
+ {% comment %} 默认值兼容旧数据 {% endcomment %}
22
+ {% assign mobile_height = "325px" %}
23
+ {% assign pc_height = "450px" %}
24
+ {% endif %}
25
+ {% if section.settings.img_height != "normal" %}
26
+ {% assign type = "static" %}
27
+ {% else %}
28
+ {% assign type = "cover" %}
29
+ {% endif %}
30
+
31
+ {% if type == "cover" %}
32
+ {% assign pc_height = "100%" %}
33
+ {% assign mobile_height = "100%" %}
34
+ {% endif %}
35
+
36
+ {% assign full_width = section.settings.is_full_width %}
37
+
38
+ <div id="slider{{section.id}}" class="style_{{section.settings.style}} {% if full_width != true and full_width != nil %}container{% else %}slide__bottom-margin{% endif %}">
39
+ {% if full_width != true and full_width != nil %}<div class="d-block row mb-padding slide__bottom-margin">{% endif %}
40
+ {% if section.blocks.size == 0 %}
41
+ {% assign blocks = '1,2,3' | split: ',' %}
42
+ {% else %}
43
+ {% assign blocks = section.blocks %}
44
+ {% endif %}
45
+
46
+ {% for block in blocks %}
47
+ {% assign url = block.settings.url.url %}
48
+ {% assign title = block.settings.title %}
49
+ {% assign sub_title = block.settings.sub_title %}
50
+ {% assign link_type = block.settings.url.type %}
51
+ {% assign text_size = section.settings.text_size %}
52
+ {% assign alignment = block.settings.alignment %}
53
+ {% assign button_label = block.settings.button_label %}
54
+ {% assign button_link = block.settings.button_link.url %}
55
+ {% assign button_link_type = block.settings.button_link.type %}
56
+ {% assign button_text_color = block.settings.button_text_color %}
57
+ {% assign button_bg_color = block.settings.button_bg_color %}
58
+ {% assign text_color = block.settings.text_color %}
59
+ {% assign text_position = block.settings.text_position %}
60
+ {% assign opacity = block.settings.opacity %}
61
+ {% assign image_src = block.settings.src %}
62
+ {% assign mobile_image_src = block.settings.mobile_src | default: block.settings.src %}
63
+ {% assign defaultImg = 'oss/operation/bbb5b6c710007fbaa2ad1adc6800ee6c.png' %}
64
+
65
+ {% if section.blocks.size == 0 %}
66
+ {% assign alignment = "center" %}
67
+ {% assign opacity = 25 %}
68
+ {% assign title = "Image Slide" %}
69
+ {% assign sub_title = "Tell your brand's story through images" %}
70
+ {% assign url = "" %}
71
+ {% assign button_link = "" %}
72
+ {% assign button_label = "" %}
73
+ {% assign text_position = nil %}
74
+ {% assign image_src = blank %}
75
+ {% endif %}
76
+
77
+ {% if image_src == blank %}
78
+ {% assign image_src = defaultImg %}
79
+ {% endif %}
80
+ {% if mobile_image_src == blank %}
81
+ {% assign mobile_image_src = defaultImg %}
82
+ {% endif %}
83
+ <div {% if type == "cover" %}style="height: 100%;"{% endif %} class="hero hero--{{block.id}} {% if url %}url-cursor{% endif %}">
84
+ <a
85
+ {% if url %}href="{{url}}"{% endif %}
86
+ {% if link_type == "web" %}target="_blank"{% endif %}
87
+ class="slide__img-wrapper slide__img-wrapper-{{forloop.index0}} position-relative d-flex m-auto w-100 justify-content-center"
88
+ >
89
+ <img
90
+ class="slide__img h-100 {% unless forloop.index0 == 0 %}lazy-{% endunless %}lazyload position-absolute {% if height == '100%' %} slide__img_auto {% endif %}"
91
+ src="{{shop.default_img}}"
92
+ data-srcs="{{mobile_image_src | img_url: '{width}x' }},{{image_src | img_url: '{width}x' }}"
93
+
94
+ data-sizes="auto"
95
+ style="object-position: center {{alignment}};"
96
+ alt="{{images[image_src].alt | escape}}"
97
+ />
98
+ {% comment %} 灰色萌层以及文案 {% endcomment %}
99
+ {% if title or sub_title or button_link %}
100
+ <div class="hero__inner w-100 m-auto" style="background: rgba(0, 0, 0, {{ opacity | divided_by: 100.0 }})"></div>
101
+ {% endif %}
102
+ </a>
103
+ {% if title or sub_title or button_link %}
104
+ <div class="banner_content flex_{%if text_position != blank%}{{text_position}}{%else%}center{%endif%}">
105
+ <div class="page-width gap_{{text_size}}">
106
+ <div
107
+ {%if url%}
108
+ {% if link_type == 'web' %}
109
+ onclick="window.open('{{ url }}')"
110
+ {% else %}
111
+ onclick="location.href = '{{ url }}';"
112
+ {% endif %}
113
+ {%endif%}
114
+ >
115
+ {% if title != blank %}
116
+ <h2 class="mega-title mega-title-{{text_size}}" {%if text_color!=blank%}style="color:{{text_color}};"{%endif%}>{{ title | escape }}</h2>
117
+ {% endif %}
118
+ {% if sub_title != blank %}
119
+ <div class="mega-subtitle mega-subtitle-{{text_size}}" {%if text_color!=blank%}style="color:{{text_color}};"{%endif%}>{{ sub_title }}</div>
120
+ {% endif %}
121
+ </div>
122
+ {% if button_link != blank and button_label != blank %}
123
+ <a
124
+ {% if button_link_type == 'web' %}
125
+ target="_blank"
126
+ {% endif %}
127
+ href="{{button_link}}"
128
+ class="hero-btn btn"
129
+ style="
130
+ {%if button_text_color!=blank%}color:{{button_text_color}};{%endif%}
131
+ {%if button_bg_color!=blank%}background-color:{{button_bg_color}};{%endif%}
132
+ cursor:pointer;"
133
+ >
134
+ {{ button_label | escape }}
135
+ </a>
136
+
137
+ {% endif %}
138
+ </div>
139
+ </div>
140
+ {%endif%}
141
+ </div>
142
+ {% endfor %}
143
+ {% if full_width != true and full_width != nil %}</div>{% endif %}
144
+ </div>
145
+ <style>
146
+ {%if section.settings.img_height == "x-small"%}
147
+ [data-section-id='{{section.id}}'] .btn-primary{
148
+ display:none;
149
+ }
150
+ {%endif%}
151
+ [data-section-id='{{section.id}}'] .hero .mega-title{
152
+ {% assign titleFont = settings.skin_title_font_family %}
153
+ font-family: {{titleFont.family}},{{titleFont.fallback_families}};
154
+ font-style: {{titleFont.style}};
155
+ font-weight: {{titleFont.weight}};
156
+ }
157
+ {% if section.settings.img_height == "x-small" %}
158
+ [data-section-id='{{section.id}}'] .sep-loaded-slider__bullets{
159
+ display:none;
160
+ }
161
+ {%endif%}
162
+ .slide__bottom-margin {
163
+ margin-bottom: {% if section.settings.show_bottom_margin %}2.5rem{% else %}0{% endif %} !important;
164
+ }
165
+ [data-section-id='{{section.id}}'] .hero .mega-subtitle,.hero .mega-title {
166
+ overflow: hidden;
167
+ display: -webkit-box;
168
+ -webkit-line-clamp: 2;
169
+ -webkit-box-orient: vertical;
170
+ }
171
+ [data-section-id='{{section.id}}'] .hero .hero-btn:hover {
172
+ background: #fff;
173
+ color:#000;
174
+ }
175
+ [data-section-id='{{section.id}}'] .btn-primary{
176
+ color: #000;
177
+ background-color: #fff;
178
+ border-color: #fff;
179
+ max-width: 20rem;
180
+ white-space: nowrap;
181
+ overflow: hidden;
182
+ text-overflow: ellipsis;
183
+ }
184
+ [data-section-id='{{section.id}}'] .gap_small .hero-btn {
185
+ margin-top: 30px;
186
+ }
187
+ [data-section-id='{{section.id}}'] .gap_medium .hero-btn {
188
+ margin-top: 40px;
189
+ }
190
+ [data-section-id='{{section.id}}'] .gap_large .hero-btn {
191
+ margin-top: 50px;
192
+ }
193
+ [data-section-id='{{section.id}}'] .hero .page-width{
194
+ padding-bottom:30px;
195
+ padding-top:30px;
196
+ display: inline-block;
197
+ }
198
+ [data-section-id='{{section.id}}'] .banner_content{
199
+ position:absolute;
200
+ left:50%;
201
+ top:50%;
202
+ transform:translate(-50%,-50%);
203
+ -webkit-transform:translate(-50%,-50%);
204
+ color: #fff;
205
+ z-index: 10;
206
+ box-sizing: border-box;
207
+ width: 100%;
208
+ }
209
+ {% for block in blocks %}
210
+ {% assign image_src = block.settings.src | default: defaultImg %}
211
+ {% assign mobile_image_src = block.settings.mobile_src | default: block.settings.src %}
212
+ {% unless forloop.index0 == 0 %}
213
+ .hero--{{block.id}}{
214
+ display: none;
215
+ }
216
+ {% endunless %}
217
+ [data-section-id='{{section.id}}'] .slide__img-wrapper-{{forloop.index0}}{
218
+ padding-bottom:
219
+ {% if type == 'cover' %}
220
+ {{ images[image_src].height | image_padding_bottom : images[image_src].width, origin:'unlimit' }};
221
+ {% else %}
222
+ {{ pc_height }}
223
+ {% endif %};
224
+ }
225
+ @media (max-width:768px){
226
+ [data-section-id='{{section.id}}'] .slide__img-wrapper-{{forloop.index0}}{
227
+ padding-bottom:
228
+ {% if type == 'cover' %}
229
+ {{ images[mobile_image_src].height | image_padding_bottom : images[mobile_image_src].width, origin:'unlimit' }};
230
+ {% else %}
231
+ {{ mobile_height }}
232
+ {% endif %};
233
+ }
234
+ }
235
+ {% endfor %}
236
+ @media (max-width:768px){
237
+ [data-section-id='{{section.id}}'] .banner_content{
238
+ padding:0 15px;
239
+ }
240
+ [data-section-id='{{section.id}}'] .hero .page-width{
241
+ max-width:100%;
242
+ }
243
+ {%if section.settings.img_height == "x-small" or section.settings.img_height == "small" %}
244
+ [data-section-id='{{section.id}}'] .hero .mega-subtitle,[data-section-id='{{section.id}}'] .hero .mega-title {
245
+ overflow: hidden;
246
+ white-space: nowrap;
247
+ text-overflow: ellipsis;
248
+ display: block;
249
+ }
250
+ [data-section-id='{{section.id}}'] .hero .page-width{
251
+ margin-bottom:30px;
252
+ }
253
+ {%endif%}
254
+ [data-section-id='{{section.id}}'] .hero-btn {
255
+ margin-top: 1rem !important;
256
+ }
257
+ }
258
+ [data-section-id='{{section.id}}'] .banner_content.flex_center {
259
+ left:50%;
260
+ top:50%;
261
+ transform:translate(-50%,-50%);
262
+ -webkit-transform:translate(-50%,-50%);
263
+ text-align:center;
264
+ }
265
+ [data-section-id='{{section.id}}'] .banner_content.flex_center_left {
266
+ left:0;
267
+ top:50%;
268
+ transform:translate(0,-50%);
269
+ -webkit-transform:translate(0,-50%);
270
+ text-align:left;
271
+ }
272
+ [data-section-id='{{section.id}}'] .banner_content.flex_center_right {
273
+ left:auto;
274
+ right:0;
275
+ top:50%;
276
+ transform:translate(0,-50%);
277
+ -webkit-transform:translate(0,-50%);
278
+ text-align:right;
279
+ }
280
+ [data-section-id='{{section.id}}'] .banner_content.flex_bottom_left {
281
+ left:0;
282
+ top:auto;
283
+ bottom:0;
284
+ transform:translate(0,0);
285
+ -webkit-transform:translate(0,0);
286
+ text-align:left;
287
+ }
288
+ [data-section-id='{{section.id}}'] .banner_content.flex_bottom_center {
289
+ left:50%;
290
+ top:auto;
291
+ bottom:0;
292
+ transform:translate(-50%,0);
293
+ -webkit-transform:translate(-50%,0);
294
+ text-align:center;
295
+ }
296
+ [data-section-id='{{section.id}}'] .banner_content.flex_bottom_right {
297
+ left:auto;
298
+ top:auto;
299
+ right:0;
300
+ bottom:0;
301
+ transform:translate(0,0);
302
+ -webkit-transform:translate(0,0);
303
+ text-align:right;
304
+ }
305
+ </style>
306
+
307
+ {% javascript %}
308
+ $(function(){
309
+ var $slider = $("{% if full_width != true and full_width != nil %}#slider{{section.id}} .row{% else %}#slider{{section.id}}{% endif %}");
310
+ $slider.hasClass('slick-initialized') && $slider.slick('destroy');
311
+ $slider.slick({
312
+ slidesToShow: 1,
313
+ slidesToScroll: 1,
314
+ arrows: false,
315
+ dots: true,
316
+ infinite: true,
317
+ adaptiveHeight: true,
318
+ touchThreshold: 10,
319
+ speed: 300,
320
+ autoplaySpeed:{{ section.settings.delay }},
321
+ autoplay:{% if section.settings.is_auto_play %}true{%else%}false{%endif%},
322
+ rtl: document.documentElement.getAttribute("dir") == "rtl"
323
+ }).on("beforeChange",function (event, slick){
324
+ $(slick.$slider).find(".lazy-lazyload").removeClass("lazy-lazyload").addClass("lazyload");
325
+ });
326
+ });
327
+ {% endjavascript %}
328
+
329
+ {% schema %}
330
+ {
331
+ "name": "slide",
332
+ "max_blocks": 10,
333
+ "settings": [
334
+ {
335
+ "type": "header",
336
+ "content": {
337
+ "zh-CN": "轮播规则",
338
+ "en-US": "Settings"
339
+ }
340
+ },
341
+ {
342
+ "type": "checkbox",
343
+ "label": {
344
+ "en-US": "Auto-change slides",
345
+ "zh-CN": "自动轮播"
346
+ },
347
+ "id": "is_auto_play",
348
+ "default": true
349
+ },
350
+ {
351
+ "type": "select",
352
+ "id": "delay",
353
+ "label": {
354
+ "zh-CN": "轮播时间",
355
+ "en-US": "Change slides every"
356
+ },
357
+ "default": "5000",
358
+ "options": [
359
+ {
360
+ "value": "2000",
361
+ "label": {
362
+ "en-US": "2s",
363
+ "zh-CN": "2秒"
364
+ }
365
+ },
366
+ {
367
+ "value": "3000",
368
+ "label": {
369
+ "en-US": "3s",
370
+ "zh-CN": "3秒"
371
+ }
372
+ },
373
+ {
374
+ "value": "5000",
375
+ "label": {
376
+ "en-US": "5s",
377
+ "zh-CN": "5秒"
378
+ }
379
+ }
380
+ ]
381
+ },
382
+ {
383
+ "type": "select",
384
+ "label": {
385
+ "zh-CN": "图片高度",
386
+ "en-US": "Image height"
387
+ },
388
+ "id": "img_height",
389
+ "default": "medium",
390
+ "options": [
391
+ {
392
+ "value": "normal",
393
+ "label": {
394
+ "zh-CN": "自适应",
395
+ "en-US": "Full"
396
+ }
397
+ },
398
+ {
399
+ "value": "large",
400
+ "label": {
401
+ "en-US": "Large(PC: 600px, Phone: 460px)",
402
+ "zh-CN": "大(PC:600px,移动:460px )"
403
+ }
404
+ },
405
+ {
406
+ "value": "medium",
407
+ "label": {
408
+ "zh-CN": "中(PC:450px,移动:325px )",
409
+ "en-US": "Medium(PC: 450px, Phone: 325px)"
410
+ }
411
+ },
412
+ {
413
+ "value": "small",
414
+ "label": {
415
+ "en-US": "Small(PC: 300px, Phone: 200px)",
416
+ "zh-CN": "小(PC:300px,移动:200px )"
417
+ }
418
+ },
419
+ {
420
+ "value": "x-small",
421
+ "label": {
422
+ "en-US": "Ultra-small(PC: 200px, Phone: 150px)",
423
+ "zh-CN": "超小(PC:200px,移动:150px )"
424
+ }
425
+ }
426
+ ]
427
+ },
428
+ {
429
+ "type": "select",
430
+ "label": {
431
+ "en-US": "Text size",
432
+ "zh-CN": "文字大小"
433
+ },
434
+ "id": "text_size",
435
+ "default": "medium",
436
+ "options": [
437
+ {
438
+ "value": "large",
439
+ "label": {
440
+ "zh-CN": "大",
441
+ "en-US": "Large"
442
+ }
443
+ },
444
+ {
445
+ "value": "medium",
446
+ "label": {
447
+ "zh-CN": "中",
448
+ "en-US": "Medium"
449
+ }
450
+ },
451
+ {
452
+ "value": "small",
453
+ "label": {
454
+ "zh-CN": "小",
455
+ "en-US": "Small"
456
+ }
457
+ }
458
+ ]
459
+ },
460
+ {
461
+ "type": "checkbox",
462
+ "label": {
463
+ "zh-CN": "宽度铺满屏幕",
464
+ "en-US": "Full page width"
465
+ },
466
+ "id": "is_full_width",
467
+ "default": true
468
+ },
469
+ {
470
+ "type": "checkbox",
471
+ "label": {
472
+ "en-US": "Show below space",
473
+ "zh-CN": "显示下间距"
474
+ },
475
+ "id": "show_bottom_margin",
476
+ "default": false
477
+ },
478
+ {
479
+ "type": "header",
480
+ "content": {
481
+ "en-US": "Content fill",
482
+ "zh-CN": "内容填充"
483
+ }
484
+ }
485
+ ],
486
+ "blocks": [
487
+ {
488
+ "type": "banner",
489
+ "name": {
490
+ "zh-CN": "图片",
491
+ "en-US": "Image"
492
+ },
493
+ "settings": [
494
+ {
495
+ "type": "image_picker",
496
+ "label": {
497
+ "en-US": "Desktop image",
498
+ "zh-CN": "PC端图片"
499
+ },
500
+ "id": "src",
501
+ "info": {
502
+ "zh-CN": "如果您选择自适应,建议尺寸(宽*高):1920*667px",
503
+ "en-US": "Recommended resolution (width * height): 1920*667px if you choose responsive layout"
504
+ }
505
+ },
506
+ {
507
+ "type": "image_picker",
508
+ "id": "mobile_src",
509
+ "label": {
510
+ "en-US": "Mobile image",
511
+ "zh-CN": "移动端图片"
512
+ },
513
+ "info": {
514
+ "zh-CN": "如果您选择自适应,建议尺寸(宽*高):750*918px",
515
+ "en-US": "Recommended resolution (width * height): 750*918px if you choose responsive layout"
516
+ }
517
+ },
518
+ {
519
+ "type": "text",
520
+ "id": "button_label",
521
+ "label": {
522
+ "zh-CN": "按钮文字",
523
+ "en-US": "Button text"
524
+ },
525
+ "default": "Learn More"
526
+ },
527
+ {
528
+ "type": "url",
529
+ "id": "button_link",
530
+ "label": {
531
+ "en-US": "Button link",
532
+ "zh-CN": "按钮链接"
533
+ }
534
+ },
535
+ {
536
+ "type": "color",
537
+ "id": "button_bg_color",
538
+ "label": {
539
+ "en-US": "Button background color",
540
+ "zh-CN": "按钮背景颜色"
541
+ },
542
+ "default": "#FFFFFF"
543
+ },
544
+ {
545
+ "type": "color",
546
+ "id": "button_text_color",
547
+ "label": {
548
+ "en-US": "Button text color",
549
+ "zh-CN": "按钮文字颜色"
550
+ },
551
+ "default": "#000000"
552
+ },
553
+ {
554
+ "type": "range",
555
+ "id": "opacity",
556
+ "step": 1,
557
+ "max": 100,
558
+ "min": 0,
559
+ "label": {
560
+ "en-US": "Opacity",
561
+ "zh-CN": "蒙层不透明度"
562
+ },
563
+ "default": 25,
564
+ "unit": "%"
565
+ },
566
+ {
567
+ "type": "select",
568
+ "id": "alignment",
569
+ "label": {
570
+ "zh-CN": "图片截取位置",
571
+ "en-US": "Crop"
572
+ },
573
+ "default": "center",
574
+ "options": [
575
+ {
576
+ "value": "top",
577
+ "label": {
578
+ "en-US": "Top",
579
+ "zh-CN": "上"
580
+ }
581
+ },
582
+ {
583
+ "value": "center",
584
+ "label": {
585
+ "en-US": "Center",
586
+ "zh-CN": "中"
587
+ }
588
+ },
589
+ {
590
+ "value": "bottom",
591
+ "label": {
592
+ "en-US": "Bottom",
593
+ "zh-CN": "下"
594
+ }
595
+ }
596
+ ]
597
+ },
598
+ {
599
+ "type": "select",
600
+ "id": "text_position",
601
+ "label": {
602
+ "en-US": "Text and button position",
603
+ "zh-CN": "文字&按钮位置"
604
+ },
605
+ "default": "center",
606
+ "options": [
607
+ {
608
+ "label": {
609
+ "en-US": "Center left",
610
+ "zh-CN": "中左"
611
+ },
612
+ "value": "center_left"
613
+ },
614
+ {
615
+ "label": {
616
+ "en-US": "Center",
617
+ "zh-CN": "中间"
618
+ },
619
+ "value": "center"
620
+ },
621
+ {
622
+ "label": {
623
+ "en-US": "Center right",
624
+ "zh-CN": "中右"
625
+ },
626
+ "value": "center_right"
627
+ }
628
+ ]
629
+ },
630
+ {
631
+ "type": "color",
632
+ "id": "text_color",
633
+ "label": {
634
+ "zh-CN": "标题&副标题颜色",
635
+ "en-US": "Heading and subheading color"
636
+ },
637
+ "default": "#FFFFFF"
638
+ },
639
+ {
640
+ "type": "text",
641
+ "id": "title",
642
+ "label": {
643
+ "en-US": "Heading",
644
+ "zh-CN": "标题"
645
+ },
646
+ "default": "Image Slide",
647
+ "placeholder": {
648
+ "zh-CN": "输入标题",
649
+ "en-US": "Input heading"
650
+ }
651
+ },
652
+ {
653
+ "type": "text",
654
+ "id": "sub_title",
655
+ "label": {
656
+ "en-US": "Subheading",
657
+ "zh-CN": "副标题"
658
+ },
659
+ "default": "Tell your brand's story through images",
660
+ "placeholder": {
661
+ "en-US": "Input subheading",
662
+ "zh-CN": "输入副标题"
663
+ }
664
+ },
665
+ {
666
+ "type": "url",
667
+ "id": "url",
668
+ "label": {
669
+ "zh-CN": "两图共用链接",
670
+ "en-US": "Image link"
671
+ },
672
+ "is_image_link": true
673
+ }
674
+ ]
675
+ }
676
+ ],
677
+ "presets": [
678
+ {
679
+ "name": "slide",
680
+ "cname": {
681
+ "en-US": "Slideshow",
682
+ "zh-CN": "轮播图"
683
+ },
684
+ "category": {
685
+ "en-US": "Material",
686
+ "zh-CN": "素材"
687
+ },
688
+ "ccategory": {
689
+ "en-US": "Material",
690
+ "zh-CN": "素材"
691
+ },
692
+ "display": true,
693
+ "blocks": [
694
+ {
695
+ "type": "banner",
696
+ "name": {
697
+ "zh-CN": "banner广告图",
698
+ "en-US": "Banner Ads placement"
699
+ },
700
+ "max_blocks": 10,
701
+ "settings": {
702
+ "src": "",
703
+ "mobile_src": "",
704
+ "url": "",
705
+ "opacity": 25,
706
+ "alignment": "center",
707
+ "title": "Image Slide",
708
+ "sub_title": "Tell your brand's story through images",
709
+ "button_label": "Learn More",
710
+ "button_bg_color": "#FFFFFF",
711
+ "button_text_color": "#000000",
712
+ "text_color": "#FFFFFF"
713
+ }
714
+ }
715
+ ]
716
+ }
717
+ ]
718
+ }
719
+ {% endschema %}