Guest User

Untitled

a guest
Jun 22nd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.35 KB | None | 0 0
  1. <div class="homepage-slideshow {{ section.settings.height }}" data-section-id="{{ section.id }}" data-section-type="slideshow">
  2. {% if section.blocks.size > 0 %}
  3. <div id="slideshow-{{ section.id }}" data-autoplay="{{ section.settings.autoplay }}" data-speed="{{ section.settings.autoplay_speed | times: 1000 }}">
  4. {% for block in section.blocks %}
  5. <div class="slick-slide slideshow__slide slideshow__slide--{{ block.id }} preventOverflow homepage-image {{ block.settings.color }}" {{ block.shopify_attributes }} data-color="{{ block.settings.color }}">
  6. {%- if block.settings.image -%}
  7. {%- assign slide_image = block.settings.image | img_url: '1800x' -%}
  8. {%- else -%}
  9. {%- assign slide_image = 'blank.svg' | asset_url -%}
  10. {%- endif -%}
  11.  
  12. {% if block.settings.link_text == '' and block.settings.link and block.settings.button_image == nil %}
  13. <a href="{{ block.settings.link }}">
  14. {% endif %}
  15. <div class="content--centered">
  16. <div class="{{ block.settings.text_align }} preventOverflowContent">
  17. {% if block.settings.button_image %}
  18. <a href="{{ block.settings.link }}" class="button-image-slide">
  19. <img src="{{ block.settings.button_image | img_url: '1000x' }}" alt="{{ block.settings.button_image.alt | default: block.settings.link_text }}" class="image--flex" />
  20. </a>
  21. {% else %}
  22. {% unless block.settings.title == '' %}<h1 class="title--flex">{{ block.settings.title }}</h1>{% endunless %}
  23. {% unless block.settings.description == '' %}<p class="content--flex h4--body">{{ block.settings.description }}</p>{% endunless %}
  24. {% unless block.settings.link_text == '' %}<a class="{{ block.settings.button_style }}" href="{{ block.settings.link }}">{{ block.settings.link_text | escape }}</a>{% endunless %}
  25. {% endif %}
  26. </div>
  27. </div>
  28. <div class="image-overlay image-overlay-{{ block.settings.overlay_opacity }}"></div>
  29. {% if section.settings.height == 'use_image' %}
  30. <img src="{{ slide_image }}" alt="{{ block.settings.image.alt | default: shop.name }}" class="responsive-wide-image"/>
  31. {% else %}
  32. <div class="background-size-cover" style="background-image: url('{{ slide_image }}');"></div>
  33. {% endif %}
  34. {% if block.settings.link_text == '' and block.settings.link and block.settings.button_image == nil %}
  35. </a>
  36. {% endif %}
  37.  
  38. {% if section.settings.height == 'use_screen_full' %}
  39. <div class="scroll_icon_wrap">
  40. <a href="#scroll-{{ section.id }}" class="scroll_link bloop">
  41. <span class="scroll_icon">{% include 'svg-down' %}</span>
  42. </a>
  43. </div>
  44. <div class="scroll__link" id="scroll-{{ section.id }}"></div>
  45. {% endif %}
  46.  
  47. </div>
  48. {% endfor %}
  49. </div>
  50. {% endif %}
  51.  
  52. {% if section.blocks.size == 0 %}
  53. <div class="slideshow__slide">
  54. <div class="text-center vertical-align">{{ 'home_page.onboarding.no_content' | t }}</div>
  55. <div class="image-overlay homepage--dark image-overlay-15"></div>
  56. </div>
  57. {% endif %}
  58.  
  59. </div>
  60.  
  61. {% schema %}
  62. {
  63. "name": "Slideshow",
  64. "settings": [
  65. {
  66. "type": "checkbox",
  67. "id": "autoplay",
  68. "label": "Auto-rotate slides",
  69. "default": false
  70. },
  71. {
  72. "type": "range",
  73. "id": "autoplay_speed",
  74. "min": 1,
  75. "max": 15,
  76. "step": 1,
  77. "unit": "sec",
  78. "label": "Change slides every",
  79. "default": 8
  80. },
  81. {
  82. "type": "select",
  83. "id": "height",
  84. "label": "Section height",
  85. "default": "use_screen_two_thirds",
  86. "options": [
  87. { "value": "use_screen_full", "label": "Full screen height"},
  88. { "value": "use_screen_two_thirds", "label": "Tall"},
  89. { "value": "use_screen_one_half", "label": "Medium"},
  90. { "value": "use_screen_one_third", "label": "Short"},
  91. { "value": "use_image", "label": "Image height"}
  92. ]
  93. }
  94. ],
  95. "blocks": [
  96. {
  97. "type": "image",
  98. "name": "Image slide",
  99. "settings": [
  100. {
  101. "type": "image_picker",
  102. "id": "image",
  103. "label": "Background image",
  104. "info": "Match size to other slides"
  105. },
  106. {
  107. "type": "range",
  108. "id": "overlay_opacity",
  109. "min": 0,
  110. "max": 100,
  111. "step": 5,
  112. "label": "Image overlay opacity",
  113. "info": "Increase contrast for legible text.",
  114. "default": 15
  115. },
  116. {
  117. "type": "header",
  118. "content": "Text"
  119. },
  120. {
  121. "type": "text",
  122. "id": "title",
  123. "label": "Headline",
  124. "default": "Image slide"
  125. },
  126. {
  127. "type": "textarea",
  128. "id": "description",
  129. "label": "Description",
  130. "default": "Tell your brand's story through images."
  131. },
  132. {
  133. "type": "select",
  134. "id": "text_align",
  135. "label": "Alignment",
  136. "default": "text-center",
  137. "options": [
  138. { "value": "text-left", "label": "Align Left"},
  139. { "value": "text-center", "label": "Align Center"},
  140. { "value": "text-right", "label": "Align Right"}
  141. ]
  142. },
  143. {
  144. "type": "select",
  145. "id": "color",
  146. "label": "Text color",
  147. "default": "homepage--white",
  148. "options": [
  149. { "value": "homepage--white", "label": "White"},
  150. { "value": "homepage--light", "label": "Light"},
  151. { "value": "homepage--splash", "label": "Accent"},
  152. { "value": "homepage--dark", "label": "Dark"}
  153. ]
  154. },
  155. {
  156. "type": "header",
  157. "content": "Button"
  158. },
  159. {
  160. "type": "text",
  161. "id": "link_text",
  162. "label": "Text",
  163. "default": "View products",
  164. "info": "Leave blank to link entire image"
  165. },
  166. {
  167. "type": "url",
  168. "id": "link",
  169. "label": "Link"
  170. },
  171. {
  172. "type": "select",
  173. "id": "button_style",
  174. "label": "Button style",
  175. "default": "btn btn--large btn--clear btn--square uppercase",
  176. "options": [
  177. { "value": "btn btn--large btn--splash uppercase", "label": "Round"},
  178. { "value": "btn btn--large btn--splash btn--square uppercase", "label": "Square"},
  179. { "value": "btn btn--large btn--clear uppercase", "label": "Transparent round"},
  180. { "value": "btn btn--large btn--clear btn--square uppercase", "label": "Transparent square"},
  181. { "value": "btn btn--large btn--outline btn--square uppercase", "label": "Outlined square"}
  182. ]
  183. },
  184. {
  185. "type": "header",
  186. "content": "Button image (optional)"
  187. },
  188. {
  189. "type": "image_picker",
  190. "id": "button_image",
  191. "label": "Button image",
  192. "info": "1000 x 1000px .png max"
  193. }
  194. ]
  195. }
  196. ],
  197. "presets": [{
  198. "name": "Slideshow",
  199. "category": "Image",
  200. "settings": {
  201. "height": "use_screen_two_thirds"
  202. },
  203. "blocks": [
  204. {
  205. "type": "image"
  206. },
  207. {
  208. "type": "image"
  209. }
  210. ]
  211. }]
  212. }
  213. {% endschema %}
Add Comment
Please, Sign In to add comment