Guest User

Untitled

a guest
Jul 2nd, 2022
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.20 KB | None | 0 0
  1. <link rel="stylesheet" href="{{ 'component-list-menu.css' | asset_url }}" media="print" onload="this.media='all'">
  2. <link rel="stylesheet" href="{{ 'component-search.css' | asset_url }}" media="print" onload="this.media='all'">
  3. <link rel="stylesheet" href="{{ 'component-menu-drawer.css' | asset_url }}" media="print" onload="this.media='all'">
  4. <link rel="stylesheet" href="{{ 'component-cart-notification.css' | asset_url }}" media="print" onload="this.media='all'">
  5. <link rel="stylesheet" href="{{ 'component-cart-items.css' | asset_url }}" media="print" onload="this.media='all'">
  6. {%- if settings.predictive_search_enabled -%}
  7. <link rel="stylesheet" href="{{ 'component-price.css' | asset_url }}" media="print" onload="this.media='all'">
  8. <link rel="stylesheet" href="{{ 'component-loading-overlay.css' | asset_url }}" media="print" onload="this.media='all'">
  9. {%- endif -%}
  10. {%- if section.settings.menu_type_desktop == 'mega' -%}
  11. <link rel="stylesheet" href="{{ 'component-mega-menu.css' | asset_url }}" media="print" onload="this.media='all'">
  12. <noscript>{{ 'component-mega-menu.css' | asset_url | stylesheet_tag }}</noscript>
  13. {%- endif -%}
  14. {%- if settings.cart_type == "drawer" -%}
  15. {{ 'component-cart-drawer.css' | asset_url | stylesheet_tag }}
  16. {{ 'component-cart.css' | asset_url | stylesheet_tag }}
  17. {{ 'component-totals.css' | asset_url | stylesheet_tag }}
  18. {{ 'component-price.css' | asset_url | stylesheet_tag }}
  19. {{ 'component-discounts.css' | asset_url | stylesheet_tag }}
  20. {{ 'component-loading-overlay.css' | asset_url | stylesheet_tag }}
  21. {%- endif -%}
  22.  
  23. <noscript>{{ 'component-list-menu.css' | asset_url | stylesheet_tag }}</noscript>
  24. <noscript>{{ 'component-search.css' | asset_url | stylesheet_tag }}</noscript>
  25. <noscript>{{ 'component-menu-drawer.css' | asset_url | stylesheet_tag }}</noscript>
  26. <noscript>{{ 'component-cart-notification.css' | asset_url | stylesheet_tag }}</noscript>
  27. <noscript>{{ 'component-cart-items.css' | asset_url | stylesheet_tag }}</noscript>
  28.  
  29. <style>
  30. header-drawer {
  31. justify-self: start;
  32. margin-left: -1.2rem;
  33. }
  34.  
  35. .header__heading-logo {
  36. max-width: {{ section.settings.logo_width }}px;
  37. }
  38.  
  39. @media screen and (min-width: 990px) {
  40. header-drawer {
  41. display: none;
  42. }
  43. }
  44.  
  45. .menu-drawer-container {
  46. display: flex;
  47. }
  48.  
  49. .list-menu {
  50. list-style: none;
  51. padding: 0;
  52. margin: 0;
  53. }
  54.  
  55. .list-menu--inline {
  56. display: inline-flex;
  57. flex-wrap: wrap;
  58. }
  59.  
  60. summary.list-menu__item {
  61. padding-right: 2.7rem;
  62. }
  63.  
  64. .list-menu__item {
  65. display: flex;
  66. align-items: center;
  67. line-height: calc(1 + 0.3 / var(--font-body-scale));
  68. }
  69.  
  70. .list-menu__item--link {
  71. text-decoration: none;
  72. padding-bottom: 1rem;
  73. padding-top: 1rem;
  74. line-height: calc(1 + 0.8 / var(--font-body-scale));
  75. }
  76.  
  77. @media screen and (min-width: 750px) {
  78. .list-menu__item--link {
  79. padding-bottom: 0.5rem;
  80. padding-top: 0.5rem;
  81. }
  82. }
  83. </style>
  84.  
  85. {%- style -%}
  86. .header {
  87. padding-top: {{ section.settings.padding_top | times: 0.5 | round: 0 }}px;
  88. padding-bottom: {{ section.settings.padding_bottom | times: 0.5 | round: 0 }}px;
  89. }
  90.  
  91. .section-header {
  92. margin-bottom: {{ section.settings.margin_bottom | times: 0.75 | round: 0 }}px;
  93. }
  94.  
  95. @media screen and (min-width: 750px) {
  96. .section-header {
  97. margin-bottom: {{ section.settings.margin_bottom }}px;
  98. }
  99. }
  100.  
  101. @media screen and (min-width: 990px) {
  102. .header {
  103. padding-top: {{ section.settings.padding_top }}px;
  104. padding-bottom: {{ section.settings.padding_bottom }}px;
  105. }
  106. }
  107. {%- endstyle -%}
  108.  
  109. <script src="{{ 'details-disclosure.js' | asset_url }}" defer="defer"></script>
  110. <script src="{{ 'details-modal.js' | asset_url }}" defer="defer"></script>
  111. <script src="{{ 'cart-notification.js' | asset_url }}" defer="defer"></script>
  112. {%- if settings.cart_type == "drawer" -%}
  113. <script src="{{ 'cart-drawer.js' | asset_url }}" defer="defer"></script>
  114. {%- endif -%}
  115.  
  116. <svg xmlns="http://www.w3.org/2000/svg" class="hidden">
  117. <symbol id="icon-search" viewbox="0 0 18 19" fill="none">
  118. <path fill-rule="evenodd" clip-rule="evenodd" d="M11.03 11.68A5.784 5.784 0 112.85 3.5a5.784 5.784 0 018.18 8.18zm.26 1.12a6.78 6.78 0 11.72-.7l5.4 5.4a.5.5 0 11-.71.7l-5.41-5.4z" fill="currentColor"/>
  119. </symbol>
  120.  
  121. <symbol id="icon-close" class="icon icon-close" fill="none" viewBox="0 0 18 17">
  122. <path d="M.865 15.978a.5.5 0 00.707.707l7.433-7.431 7.579 7.282a.501.501 0 00.846-.37.5.5 0 00-.153-.351L9.712 8.546l7.417-7.416a.5.5 0 10-.707-.708L8.991 7.853 1.413.573a.5.5 0 10-.693.72l7.563 7.268-7.418 7.417z" fill="currentColor">
  123. </symbol>
  124. </svg>
  125. <{% if section.settings.enable_sticky_header %}sticky-header{% else %}div{% endif %} class="header-wrapper color-{{ section.settings.color_scheme }} gradient{% if section.settings.show_line_separator %} header-wrapper--border-bottom{% endif %}">
  126. <header class="header header--{{ section.settings.logo_position }} page-width{% if section.settings.menu != blank %} header--has-menu{% endif %}">
  127. {%- if section.settings.menu != blank -%}
  128. <header-drawer data-breakpoint="tablet">
  129. <details id="Details-menu-drawer-container" class="menu-drawer-container">
  130. <summary class="header__icon header__icon--menu header__icon--summary link focus-inset" aria-label="{{ 'sections.header.menu' | t }}">
  131. <span>
  132. {% render 'icon-hamburger' %}
  133. {% render 'icon-close' %}
  134. </span>
  135. </summary>
  136. <div id="menu-drawer" class="gradient menu-drawer motion-reduce" tabindex="-1">
  137. <div class="menu-drawer__inner-container">
  138. <div class="menu-drawer__navigation-container">
  139. <nav class="menu-drawer__navigation">
  140. <ul class="menu-drawer__menu has-submenu list-menu" role="list">
  141. {%- for link in section.settings.menu.links -%}
  142. <li>
  143. {%- if link.links != blank -%}
  144. <details id="Details-menu-drawer-menu-item-{{ forloop.index }}">
  145. <summary class="menu-drawer__menu-item list-menu__item link link--text focus-inset{% if link.child_active %} menu-drawer__menu-item--active{% endif %}">
  146. {{ link.title | escape }}
  147. {% render 'icon-arrow' %}
  148. {% render 'icon-caret' %}
  149. </summary>
  150. <div id="link-{{ link.title | escape }}" class="menu-drawer__submenu has-submenu gradient motion-reduce" tabindex="-1">
  151. <div class="menu-drawer__inner-submenu">
  152. <button class="menu-drawer__close-button link link--text focus-inset" aria-expanded="true">
  153. {% render 'icon-arrow' %}
  154. {{ link.title | escape }}
  155. </button>
  156. <ul class="menu-drawer__menu list-menu" role="list" tabindex="-1">
  157. {%- for childlink in link.links -%}
  158. <li>
  159. {%- if childlink.links == blank -%}
  160. <a href="{{ childlink.url }}" class="menu-drawer__menu-item link link--text list-menu__item focus-inset{% if childlink.current %} menu-drawer__menu-item--active{% endif %}"{% if childlink.current %} aria-current="page"{% endif %}>
  161. {{ childlink.title | escape }}
  162. </a>
  163. {%- else -%}
  164. <details id="Details-menu-drawer-submenu-{{ forloop.index }}">
  165. <summary class="menu-drawer__menu-item link link--text list-menu__item focus-inset">
  166. {{ childlink.title | escape }}
  167. {% render 'icon-arrow' %}
  168. {% render 'icon-caret' %}
  169. </summary>
  170. <div id="childlink-{{ childlink.title | escape }}" class="menu-drawer__submenu has-submenu gradient motion-reduce">
  171. <button class="menu-drawer__close-button link link--text focus-inset" aria-expanded="true">
  172. {% render 'icon-arrow' %}
  173. {{ childlink.title | escape }}
  174. </button>
  175. <ul class="menu-drawer__menu list-menu" role="list" tabindex="-1">
  176. {%- for grandchildlink in childlink.links -%}
  177. <li>
  178. <a href="{{ grandchildlink.url }}" class="menu-drawer__menu-item link link--text list-menu__item focus-inset{% if grandchildlink.current %} menu-drawer__menu-item--active{% endif %}"{% if grandchildlink.current %} aria-current="page"{% endif %}>
  179. {{ grandchildlink.title | escape }}
  180. </a>
  181. </li>
  182. {%- endfor -%}
  183. </ul>
  184. </div>
  185. </details>
  186. {%- endif -%}
  187. </li>
  188. {%- endfor -%}
  189. </ul>
  190. </div>
  191. </div>
  192. </details>
  193. {%- else -%}
  194. <a href="{{ link.url }}" class="menu-drawer__menu-item list-menu__item link link--text focus-inset{% if link.current %} menu-drawer__menu-item--active{% endif %}"{% if link.current %} aria-current="page"{% endif %}>
  195. {{ link.title | escape }}
  196. </a>
  197. {%- endif -%}
  198. </li>
  199. {%- endfor -%}
  200. </ul>
  201. </nav>
  202. <div class="menu-drawer__utility-links">
  203. {%- if shop.customer_accounts_enabled -%}
  204. <a href="{%- if customer -%}{{ routes.account_url }}{%- else -%}{{ routes.account_login_url }}{%- endif -%}" class="menu-drawer__account link focus-inset h5">
  205. {% render 'icon-account' %}
  206. {%- liquid
  207. if customer
  208. echo 'customer.account_fallback' | t
  209. else
  210. echo 'customer.log_in' | t
  211. endif
  212. -%}
  213. </a>
  214. {%- endif -%}
  215. <ul class="list list-social list-unstyled" role="list">
  216. {%- if settings.social_twitter_link != blank -%}
  217. <li class="list-social__item">
  218. <a href="{{ settings.social_twitter_link }}" class="list-social__link link">
  219. {%- render 'icon-twitter' -%}
  220. <span class="visually-hidden">{{ 'general.social.links.twitter' | t }}</span>
  221. </a>
  222. </li>
  223. {%- endif -%}
  224. {%- if settings.social_facebook_link != blank -%}
  225. <li class="list-social__item">
  226. <a href="{{ settings.social_facebook_link }}" class="list-social__link link">
  227. {%- render 'icon-facebook' -%}
  228. <span class="visually-hidden">{{ 'general.social.links.facebook' | t }}</span>
  229. </a>
  230. </li>
  231. {%- endif -%}
  232. {%- if settings.social_pinterest_link != blank -%}
  233. <li class="list-social__item">
  234. <a href="{{ settings.social_pinterest_link }}" class="list-social__link link">
  235. {%- render 'icon-pinterest' -%}
  236. <span class="visually-hidden">{{ 'general.social.links.pinterest' | t }}</span>
  237. </a>
  238. </li>
  239. {%- endif -%}
  240. {%- if settings.social_instagram_link != blank -%}
  241. <li class="list-social__item">
  242. <a href="{{ settings.social_instagram_link }}" class="list-social__link link">
  243. {%- render 'icon-instagram' -%}
  244. <span class="visually-hidden">{{ 'general.social.links.instagram' | t }}</span>
  245. </a>
  246. </li>
  247. {%- endif -%}
  248. {%- if settings.social_tiktok_link != blank -%}
  249. <li class="list-social__item">
  250. <a href="{{ settings.social_tiktok_link }}" class="list-social__link link">
  251. {%- render 'icon-tiktok' -%}
  252. <span class="visually-hidden">{{ 'general.social.links.tiktok' | t }}</span>
  253. </a>
  254. </li>
  255. {%- endif -%}
  256. {%- if settings.social_tumblr_link != blank -%}
  257. <li class="list-social__item">
  258. <a href="{{ settings.social_tumblr_link }}" class="list-social__link link">
  259. {%- render 'icon-tumblr' -%}
  260. <span class="visually-hidden">{{ 'general.social.links.tumblr' | t }}</span>
  261. </a>
  262. </li>
  263. {%- endif -%}
  264. {%- if settings.social_snapchat_link != blank -%}
  265. <li class="list-social__item">
  266. <a href="{{ settings.social_snapchat_link }}" class="list-social__link link">
  267. {%- render 'icon-snapchat' -%}
  268. <span class="visually-hidden">{{ 'general.social.links.snapchat' | t }}</span>
  269. </a>
  270. </li>
  271. {%- endif -%}
  272. {%- if settings.social_youtube_link != blank -%}
  273. <li class="list-social__item">
  274. <a href="{{ settings.social_youtube_link }}" class="list-social__link link">
  275. {%- render 'icon-youtube' -%}
  276. <span class="visually-hidden">{{ 'general.social.links.youtube' | t }}</span>
  277. </a>
  278. </li>
  279. {%- endif -%}
  280. {%- if settings.social_vimeo_link != blank -%}
  281. <li class="list-social__item">
  282. <a href="{{ settings.social_vimeo_link }}" class="list-social__link link">
  283. {%- render 'icon-vimeo' -%}
  284. <span class="visually-hidden">{{ 'general.social.links.vimeo' | t }}</span>
  285. </a>
  286. </li>
  287. {%- endif -%}
  288. </ul>
  289. </div>
  290. </div>
  291. </div>
  292. </div>
  293. </details>
  294. </header-drawer>
  295. {%- endif -%}
  296.  
  297. {%- if section.settings.logo_position == 'top-center' or section.settings.menu == blank -%}
  298. <details-modal class="header__search">
  299. <details>
  300. <summary class="header__icon header__icon--search header__icon--summary link focus-inset modal__toggle" aria-haspopup="dialog" aria-label="{{ 'general.search.search' | t }}">
  301. <span>
  302. <svg class="modal__toggle-open icon icon-search" aria-hidden="true" focusable="false" role="presentation">
  303. <use href="#icon-search">
  304. </svg>
  305. <svg class="modal__toggle-close icon icon-close" aria-hidden="true" focusable="false" role="presentation">
  306. <use href="#icon-close">
  307. </svg>
  308. </span>
  309. </summary>
  310. <div class="search-modal modal__content gradient" role="dialog" aria-modal="true" aria-label="{{ 'general.search.search' | t }}">
  311. <div class="modal-overlay"></div>
  312. <div class="search-modal__content{% if settings.inputs_shadow_vertical_offset != 0 and settings.inputs_shadow_vertical_offset < 0 %} search-modal__content-top{% else %} search-modal__content-bottom{% endif %}" tabindex="-1">
  313. {%- if settings.predictive_search_enabled -%}
  314. <predictive-search class="search-modal__form" data-loading-text="{{ 'accessibility.loading' | t }}">
  315. {%- endif -%}
  316. <form action="{{ routes.search_url }}" method="get" role="search" class="search search-modal__form">
  317. <div class="field">
  318. <input class="search__input field__input"
  319. id="Search-In-Modal-1"
  320. type="search"
  321. name="q"
  322. value=""
  323. placeholder="{{ 'general.search.search' | t }}"
  324. {%- if settings.predictive_search_enabled -%}
  325. role="combobox"
  326. aria-expanded="false"
  327. aria-owns="predictive-search-results-list"
  328. aria-controls="predictive-search-results-list"
  329. aria-haspopup="listbox"
  330. aria-autocomplete="list"
  331. autocorrect="off"
  332. autocomplete="off"
  333. autocapitalize="off"
  334. spellcheck="false"
  335. {%- endif -%}
  336. >
  337. <label class="field__label" for="Search-In-Modal-1">{{ 'general.search.search' | t }}</label>
  338. <input type="hidden" name="options[prefix]" value="last">
  339. <button class="search__button field__button" aria-label="{{ 'general.search.search' | t }}">
  340. <svg class="icon icon-search" aria-hidden="true" focusable="false" role="presentation">
  341. <use href="#icon-search">
  342. </svg>
  343. </button>
  344. </div>
  345.  
  346. {%- if settings.predictive_search_enabled -%}
  347. <div class="predictive-search predictive-search--header" tabindex="-1" data-predictive-search>
  348. <div class="predictive-search__loading-state">
  349. <svg aria-hidden="true" focusable="false" role="presentation" class="spinner" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">
  350. <circle class="path" fill="none" stroke-width="6" cx="33" cy="33" r="30"></circle>
  351. </svg>
  352. </div>
  353. </div>
  354.  
  355. <span class="predictive-search-status visually-hidden" role="status" aria-hidden="true"></span>
  356. {%- endif -%}
  357. </form>
  358. {%- if settings.predictive_search_enabled -%}
  359. </predictive-search>
  360. {%- endif -%}
  361. <button type="button" class="modal__close-button link link--text focus-inset" aria-label="{{ 'accessibility.close' | t }}">
  362. <svg class="icon icon-close" aria-hidden="true" focusable="false" role="presentation">
  363. <use href="#icon-close">
  364. </svg>
  365. </button>
  366. </div>
  367. </div>
  368. </details>
  369. </details-modal>
  370. {%- endif -%}
  371.  
  372. {%- if request.page_type == 'index' -%}
  373. <h1 class="header__heading">
  374. {%- endif -%}
  375. <a href="{{ routes.root_url }}" class="header__heading-link link link--text focus-inset">
  376. {%- if section.settings.logo != blank -%}
  377. {%- assign logo_alt = section.settings.logo.alt | default: shop.name | escape -%}
  378. {%- assign logo_height = section.settings.logo_width | divided_by: section.settings.logo.aspect_ratio -%}
  379. {{ section.settings.logo | image_url: width: section.settings.width | image_tag:
  380. class: 'header__heading-logo',
  381. widths: '50, 100, 150, 200, 250, 300, 400, 500',
  382. height: logo_height,
  383. width: section.settings.logo_width,
  384. alt: logo_alt
  385. }}
  386. {%- else -%}
  387. <span class="h2">{{ shop.name }}</span>
  388. {%- endif -%}
  389. </a>
  390. {%- if request.page_type == 'index' -%}
  391. </h1>
  392. {%- endif -%}
  393.  
  394. {%- if section.settings.menu != blank -%}
  395. {%- if section.settings.menu_type_desktop == 'dropdown' -%}
  396. <nav class="header__inline-menu">
  397. <ul class="list-menu list-menu--inline" role="list">
  398. {%- for link in section.settings.menu.links -%}
  399. <li>
  400. {%- if link.links != blank -%}
  401. <header-menu>
  402. <details id="Details-HeaderMenu-{{ forloop.index }}">
  403. <summary class="header__menu-item list-menu__item link focus-inset">
  404. <span {%- if link.child_active %} class="header__active-menu-item"{% endif %}>{{ link.title | escape }}</span>
  405. {% render 'icon-caret' %}
  406. </summary>
  407. <ul id="HeaderMenu-MenuList-{{ forloop.index }}" class="header__submenu list-menu list-menu--disclosure gradient caption-large motion-reduce global-settings-popup" role="list" tabindex="-1">
  408. {%- for childlink in link.links -%}
  409. <li>
  410. {%- if childlink.links == blank -%}
  411. <a href="{{ childlink.url }}" class="header__menu-item list-menu__item link link--text focus-inset caption-large{% if childlink.current %} list-menu__item--active{% endif %}"{% if childlink.current %} aria-current="page"{% endif %}>
  412. {{ childlink.title | escape }}
  413. </a>
  414. {%- else -%}
  415. <details id="Details-HeaderSubMenu-{{ forloop.index }}">
  416. <summary class="header__menu-item link link--text list-menu__item focus-inset caption-large">
  417. <span>{{ childlink.title | escape }}</span>
  418. {% render 'icon-caret' %}
  419. </summary>
  420. <ul id="HeaderMenu-SubMenuList-{{ forloop.index }}" class="header__submenu list-menu motion-reduce">
  421. {%- for grandchildlink in childlink.links -%}
  422. <li>
  423. <a href="{{ grandchildlink.url }}" class="header__menu-item list-menu__item link link--text focus-inset caption-large{% if grandchildlink.current %} list-menu__item--active{% endif %}"{% if grandchildlink.current %} aria-current="page"{% endif %}>
  424. {{ grandchildlink.title | escape }}
  425. </a>
  426. </li>
  427. {%- endfor -%}
  428. </ul>
  429. </details>
  430. {%- endif -%}
  431. </li>
  432. {%- endfor -%}
  433. </ul>
  434. </details>
  435. </header-menu>
  436. {%- else -%}
  437. <a href="{{ link.url }}" class="header__menu-item header__menu-item list-menu__item link link--text focus-inset"{% if link.current %} aria-current="page"{% endif %}>
  438. <span {%- if link.current %} class="header__active-menu-item"{% endif %}>{{ link.title | escape }}</span>
  439. </a>
  440. {%- endif -%}
  441. </li>
  442. {%- endfor -%}
  443. </ul>
  444. </nav>
  445. {%- else -%}
  446. <nav class="header__inline-menu">
  447. <ul class="list-menu list-menu--inline" role="list">
  448. {%- for link in section.settings.menu.links -%}
  449. <li>
  450. {%- if link.links != blank -%}
  451. <header-menu>
  452. <details id="Details-HeaderMenu-{{ forloop.index }}" class="mega-menu">
  453. <summary class="header__menu-item list-menu__item link focus-inset">
  454. <span {%- if link.child_active %} class="header__active-menu-item"{% endif %}>{{ link.title | escape }}</span>
  455. {% render 'icon-caret' %}
  456. </summary>
  457. <div id="MegaMenu-Content-{{ forloop.index }}" class="mega-menu__content gradient motion-reduce global-settings-popup" tabindex="-1">
  458. <ul class="mega-menu__list page-width{% if link.levels == 1 %} mega-menu__list--condensed{% endif %}" role="list">
  459. {%- for childlink in link.links -%}
  460. <li>
  461. <a href="{{ childlink.url }}" class="mega-menu__link mega-menu__link--level-2 link{% if childlink.current %} mega-menu__link--active{% endif %}"{% if childlink.current %} aria-current="page"{% endif %}>
  462. {{ childlink.title | escape }}
  463. </a>
  464. {%- if childlink.links != blank -%}
  465. <ul class="list-unstyled" role="list">
  466. {%- for grandchildlink in childlink.links -%}
  467. <li>
  468. <a href="{{ grandchildlink.url }}" class="mega-menu__link link{% if grandchildlink.current %} mega-menu__link--active{% endif %}"{% if grandchildlink.current %} aria-current="page"{% endif %}>
  469. {{ grandchildlink.title | escape }}
  470. </a>
  471. </li>
  472. {%- endfor -%}
  473. </ul>
  474. {%- endif -%}
  475. </li>
  476. {%- endfor -%}
  477. </ul>
  478. </div>
  479. </details>
  480. </header-menu>
  481. {%- else -%}
  482. <a href="{{ link.url }}" class="header__menu-item header__menu-item list-menu__item link link--text focus-inset"{% if link.current %} aria-current="page"{% endif %}>
  483. <span {%- if link.current %} class="header__active-menu-item"{% endif %}>{{ link.title | escape }}</span>
  484. </a>
  485. {%- endif -%}
  486. </li>
  487. {%- endfor -%}
  488. </ul>
  489. </nav>
  490. {%- endif -%}
  491. {%- endif -%}
  492.  
  493. <div class="header__icons">
  494. <details-modal class="header__search">
  495. <details>
  496. <summary class="header__icon header__icon--search header__icon--summary link focus-inset modal__toggle" aria-haspopup="dialog" aria-label="{{ 'general.search.search' | t }}">
  497. <span>
  498. <svg class="modal__toggle-open icon icon-search" aria-hidden="true" focusable="false" role="presentation">
  499. <use href="#icon-search">
  500. </svg>
  501. <svg class="modal__toggle-close icon icon-close" aria-hidden="true" focusable="false" role="presentation">
  502. <use href="#icon-close">
  503. </svg>
  504. </span>
  505. </summary>
  506. <div class="search-modal modal__content gradient" role="dialog" aria-modal="true" aria-label="{{ 'general.search.search' | t }}">
  507. <div class="modal-overlay"></div>
  508. <div class="search-modal__content{% if settings.inputs_shadow_vertical_offset != 0 and settings.inputs_shadow_vertical_offset < 0 %} search-modal__content-top{% else %} search-modal__content-bottom{% endif %}" tabindex="-1">
  509. {%- if settings.predictive_search_enabled -%}
  510. <predictive-search class="search-modal__form" data-loading-text="{{ 'accessibility.loading' | t }}">
  511. {%- endif -%}
  512. <form action="{{ routes.search_url }}" method="get" role="search" class="search search-modal__form">
  513. <div class="field">
  514. <input class="search__input field__input"
  515. id="Search-In-Modal"
  516. type="search"
  517. name="q"
  518. value=""
  519. placeholder="{{ 'general.search.search' | t }}"
  520. {%- if settings.predictive_search_enabled -%}
  521. role="combobox"
  522. aria-expanded="false"
  523. aria-owns="predictive-search-results-list"
  524. aria-controls="predictive-search-results-list"
  525. aria-haspopup="listbox"
  526. aria-autocomplete="list"
  527. autocorrect="off"
  528. autocomplete="off"
  529. autocapitalize="off"
  530. spellcheck="false"
  531. {%- endif -%}
  532. >
  533. <label class="field__label" for="Search-In-Modal">{{ 'general.search.search' | t }}</label>
  534. <input type="hidden" name="options[prefix]" value="last">
  535. <button class="search__button field__button" aria-label="{{ 'general.search.search' | t }}">
  536. <svg class="icon icon-search" aria-hidden="true" focusable="false" role="presentation">
  537. <use href="#icon-search">
  538. </svg>
  539. </button>
  540. </div>
  541.  
  542. {%- if settings.predictive_search_enabled -%}
  543. <div class="predictive-search predictive-search--header" tabindex="-1" data-predictive-search>
  544. <div class="predictive-search__loading-state">
  545. <svg aria-hidden="true" focusable="false" role="presentation" class="spinner" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">
  546. <circle class="path" fill="none" stroke-width="6" cx="33" cy="33" r="30"></circle>
  547. </svg>
  548. </div>
  549. </div>
  550.  
  551. <span class="predictive-search-status visually-hidden" role="status" aria-hidden="true"></span>
  552. {%- endif -%}
  553. </form>
  554. {%- if settings.predictive_search_enabled -%}
  555. </predictive-search>
  556. {%- endif -%}
  557. <button type="button" class="search-modal__close-button modal__close-button link link--text focus-inset" aria-label="{{ 'accessibility.close' | t }}">
  558. <svg class="icon icon-close" aria-hidden="true" focusable="false" role="presentation">
  559. <use href="#icon-close">
  560. </svg>
  561. </button>
  562. </div>
  563. </div>
  564. </details>
  565. </details-modal>
  566.  
  567. {%- if shop.customer_accounts_enabled -%}
  568. <a href="{%- if customer -%}{{ routes.account_url }}{%- else -%}{{ routes.account_login_url }}{%- endif -%}" class="header__icon header__icon--account link focus-inset{% if section.settings.menu != blank %} small-hide{% endif %}">
  569. {% render 'icon-account' %}
  570. <span class="visually-hidden">
  571. {%- liquid
  572. if customer
  573. echo 'customer.account_fallback' | t
  574. else
  575. echo 'customer.log_in' | t
  576. endif
  577. -%}
  578. </span>
  579. </a>
  580. {%- endif -%}
  581.  
  582. <a href="{{ routes.cart_url }}" class="header__icon header__icon--cart link focus-inset" id="cart-icon-bubble">
  583. {%- liquid
  584. if cart == empty
  585. render 'icon-cart-empty'
  586. else
  587. render 'icon-cart'
  588. endif
  589. -%}
  590. <span class="visually-hidden">{{ 'templates.cart.cart' | t }}</span>
  591. {%- if cart != empty -%}
  592. <div class="cart-count-bubble">
  593. {%- if cart.item_count < 100 -%}
  594. <span aria-hidden="true">{{ cart.item_count }}</span>
  595. {%- endif -%}
  596. <span class="visually-hidden">{{ 'sections.header.cart_count' | t: count: cart.item_count }}</span>
  597. </div>
  598. {%- endif -%}
  599. </a>
  600. </div>
  601. </header>
  602. </{% if section.settings.enable_sticky_header %}sticky-header{% else %}div{% endif %}>
  603.  
  604. {%- if settings.cart_type == "notification" -%}
  605. {%- render 'cart-notification', color_scheme: section.settings.color_scheme -%}
  606. {%- endif -%}
  607.  
  608. {% javascript %}
  609. class StickyHeader extends HTMLElement {
  610. constructor() {
  611. super();
  612. }
  613.  
  614. connectedCallback() {
  615. this.header = document.getElementById('shopify-section-header');
  616. this.headerBounds = {};
  617. this.currentScrollTop = 0;
  618. this.preventReveal = false;
  619. this.predictiveSearch = this.querySelector('predictive-search');
  620.  
  621. this.onScrollHandler = this.onScroll.bind(this);
  622. this.hideHeaderOnScrollUp = () => this.preventReveal = true;
  623.  
  624. this.addEventListener('preventHeaderReveal', this.hideHeaderOnScrollUp);
  625. window.addEventListener('scroll', this.onScrollHandler, false);
  626.  
  627. this.createObserver();
  628. }
  629.  
  630. disconnectedCallback() {
  631. this.removeEventListener('preventHeaderReveal', this.hideHeaderOnScrollUp);
  632. window.removeEventListener('scroll', this.onScrollHandler);
  633. }
  634.  
  635. createObserver() {
  636. let observer = new IntersectionObserver((entries, observer) => {
  637. this.headerBounds = entries[0].intersectionRect;
  638. observer.disconnect();
  639. });
  640.  
  641. observer.observe(this.header);
  642. }
  643.  
  644. onScroll() {
  645. const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
  646.  
  647. if (this.predictiveSearch && this.predictiveSearch.isOpen) return;
  648.  
  649. if (scrollTop > this.currentScrollTop && scrollTop > this.headerBounds.bottom) {
  650. if (this.preventHide) return;
  651. requestAnimationFrame(this.hide.bind(this));
  652. } else if (scrollTop < this.currentScrollTop && scrollTop > this.headerBounds.bottom) {
  653. if (!this.preventReveal) {
  654. requestAnimationFrame(this.reveal.bind(this));
  655. } else {
  656. window.clearTimeout(this.isScrolling);
  657.  
  658. this.isScrolling = setTimeout(() => {
  659. this.preventReveal = false;
  660. }, 66);
  661.  
  662. requestAnimationFrame(this.hide.bind(this));
  663. }
  664. } else if (scrollTop <= this.headerBounds.top) {
  665. requestAnimationFrame(this.reset.bind(this));
  666. }
  667.  
  668. this.currentScrollTop = scrollTop;
  669. }
  670.  
  671. hide() {
  672. this.header.classList.add('shopify-section-header-hidden', 'shopify-section-header-sticky');
  673. this.closeMenuDisclosure();
  674. this.closeSearchModal();
  675. }
  676.  
  677. reveal() {
  678. this.header.classList.add('shopify-section-header-sticky', 'animate');
  679. this.header.classList.remove('shopify-section-header-hidden');
  680. }
  681.  
  682. reset() {
  683. this.header.classList.remove('shopify-section-header-hidden', 'shopify-section-header-sticky', 'animate');
  684. }
  685.  
  686. closeMenuDisclosure() {
  687. this.disclosures = this.disclosures || this.header.querySelectorAll('header-menu');
  688. this.disclosures.forEach(disclosure => disclosure.close());
  689. }
  690.  
  691. closeSearchModal() {
  692. this.searchModal = this.searchModal || this.header.querySelector('details-modal');
  693. this.searchModal.close(false);
  694. }
  695. }
  696.  
  697. customElements.define('sticky-header', StickyHeader);
  698. {% endjavascript %}
  699.  
  700. <script type="application/ld+json">
  701. {
  702. "@context": "http://schema.org",
  703. "@type": "Organization",
  704. "name": {{ shop.name | json }},
  705. {% if section.settings.logo %}
  706. "logo": {{ section.settings.logo | image_url: width: section.settings.logo.width | prepend: "https:" | json }},
  707. {% endif %}
  708. "sameAs": [
  709. {{ settings.social_twitter_link | json }},
  710. {{ settings.social_facebook_link | json }},
  711. {{ settings.social_pinterest_link | json }},
  712. {{ settings.social_instagram_link | json }},
  713. {{ settings.social_tiktok_link | json }},
  714. {{ settings.social_tumblr_link | json }},
  715. {{ settings.social_snapchat_link | json }},
  716. {{ settings.social_youtube_link | json }},
  717. {{ settings.social_vimeo_link | json }}
  718. ],
  719. "url": {{ request.origin | append: page.url | json }}
  720. }
  721. </script>
  722.  
  723. {%- if request.page_type == 'index' -%}
  724. {% assign potential_action_target = request.origin | append: routes.search_url | append: "?q={search_term_string}" %}
  725. <script type="application/ld+json">
  726. {
  727. "@context": "http://schema.org",
  728. "@type": "WebSite",
  729. "name": {{ shop.name | json }},
  730. "potentialAction": {
  731. "@type": "SearchAction",
  732. "target": {{ potential_action_target | json }},
  733. "query-input": "required name=search_term_string"
  734. },
  735. "url": {{ request.origin | append: page.url | json }}
  736. }
  737. </script>
  738. {%- endif -%}
  739.  
  740. {% schema %}
  741. {
  742. "name": "t:sections.header.name",
  743. "class": "section-header",
  744. "settings": [
  745. {
  746. "type": "select",
  747. "id": "color_scheme",
  748. "options": [
  749. {
  750. "value": "accent-1",
  751. "label": "t:sections.all.colors.accent_1.label"
  752. },
  753. {
  754. "value": "accent-2",
  755. "label": "t:sections.all.colors.accent_2.label"
  756. },
  757. {
  758. "value": "background-1",
  759. "label": "t:sections.all.colors.background_1.label"
  760. },
  761. {
  762. "value": "background-2",
  763. "label": "t:sections.all.colors.background_2.label"
  764. },
  765. {
  766. "value": "inverse",
  767. "label": "t:sections.all.colors.inverse.label"
  768. }
  769. ],
  770. "default": "background-1",
  771. "label": "t:sections.all.colors.label"
  772. },
  773. {
  774. "type": "image_picker",
  775. "id": "logo",
  776. "label": "t:sections.header.settings.logo.label"
  777. },
  778. {
  779. "type": "range",
  780. "id": "logo_width",
  781. "min": 50,
  782. "max": 500,
  783. "step": 10,
  784. "default": 100,
  785. "unit": "t:sections.header.settings.logo_width.unit",
  786. "label": "t:sections.header.settings.logo_width.label"
  787. },
  788. {
  789. "type": "select",
  790. "id": "logo_position",
  791. "options": [
  792. {
  793. "value": "middle-left",
  794. "label": "t:sections.header.settings.logo_position.options__1.label"
  795. },
  796. {
  797. "value": "top-left",
  798. "label": "t:sections.header.settings.logo_position.options__2.label"
  799. },
  800. {
  801. "value": "top-center",
  802. "label": "t:sections.header.settings.logo_position.options__3.label"
  803. }
  804. ],
  805. "default": "middle-left",
  806. "label": "t:sections.header.settings.logo_position.label",
  807. "info": "t:sections.header.settings.logo_position.info"
  808. },
  809. {
  810. "type": "link_list",
  811. "id": "menu",
  812. "default": "main-menu",
  813. "label": "t:sections.header.settings.menu.label"
  814. },
  815. {
  816. "type": "select",
  817. "id": "menu_type_desktop",
  818. "options": [
  819. {
  820. "value": "dropdown",
  821. "label": "t:sections.header.settings.menu_type_desktop.options__1.label"
  822. },
  823. {
  824. "value": "mega",
  825. "label": "t:sections.header.settings.menu_type_desktop.options__2.label"
  826. }
  827. ],
  828. "default": "dropdown",
  829. "label": "t:sections.header.settings.menu_type_desktop.label",
  830. "info": "t:sections.header.settings.menu_type_desktop.info"
  831. },
  832. {
  833. "type": "checkbox",
  834. "id": "show_line_separator",
  835. "default": true,
  836. "label": "t:sections.header.settings.show_line_separator.label"
  837. },
  838. {
  839. "type": "checkbox",
  840. "id": "enable_sticky_header",
  841. "default": true,
  842. "label": "t:sections.header.settings.enable_sticky_header.label",
  843. "info": "t:sections.header.settings.enable_sticky_header.info"
  844. },
  845. {
  846. "type": "header",
  847. "content": "t:sections.all.spacing"
  848. },
  849. {
  850. "type": "range",
  851. "id": "margin_bottom",
  852. "min": 0,
  853. "max": 100,
  854. "step": 4,
  855. "unit": "px",
  856. "label": "t:sections.header.settings.margin_bottom.label",
  857. "default": 0
  858. },
  859. {
  860. "type": "header",
  861. "content": "t:sections.all.padding.section_padding_heading"
  862. },
  863. {
  864. "type": "range",
  865. "id": "padding_top",
  866. "min": 0,
  867. "max": 36,
  868. "step": 4,
  869. "unit": "px",
  870. "label": "t:sections.all.padding.padding_top",
  871. "default": 20
  872. },
  873. {
  874. "type": "range",
  875. "id": "padding_bottom",
  876. "min": 0,
  877. "max": 36,
  878. "step": 4,
  879. "unit": "px",
  880. "label": "t:sections.all.padding.padding_bottom",
  881. "default": 20
  882. }
  883. ]
  884. }
  885. {% endschema %}
  886.  
Advertisement
Add Comment
Please, Sign In to add comment