zz-shopify-components 0.25.1-beta.0 → 0.25.1-beta.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zz-shopify-components",
3
- "version": "0.25.1-beta.0",
3
+ "version": "0.25.1-beta.2",
4
4
  "description": "Reusable Shopify components for theme projects",
5
5
  "keywords": [
6
6
  "shopify",
@@ -14,9 +14,16 @@
14
14
  widths: '3000, 4000, 5000'
15
15
  }}
16
16
  {% for block in accessories_points %}
17
+ {% assign accessories_point_variant = block.settings.accessories_product.selected_or_first_available_variant %}
18
+ {% for v in block.settings.accessories_product.variants %}
19
+ {% if v.metafields.custom.acc_point.value %}
20
+ {% assign accessories_point_variant = v %}
21
+ {% break %}
22
+ {% endif %}
23
+ {% endfor %}
17
24
  {% if block.settings.swiper_index == accessories_points_index %}
18
25
  <div
19
- onclick='window.accessoriesPointClickHandler(event, {{ block.settings.accessories_product.selected_or_first_available_variant.id }})'
26
+ onclick='window.accessoriesPointClickHandler(event, {{ accessories_point_variant.id }})'
20
27
  data-point-swiper-index='{{ block.settings.swiper_index }}'
21
28
  class='product-accessories-point-item tw-absolute tw-rounded-full tw-backdrop-blur-[20px] tw-gap-[12px] tw-flex tw-items-center tw-justify-center tw-bg-[rgba(255,255,255,0.8)] lg:tw-py-[6px] tw-py-[4px] lg:tw-pl-[8px] tw-pl-[4px] tw-pr-[20px] tw-z-50 tw-cursor-pointer'
22
29
  style='left: {{ block.settings.point_x }}%; top: {{ block.settings.point_y }}%;'
@@ -27,7 +34,7 @@
27
34
  viewBox='0 0 36 36'
28
35
  fill='none'
29
36
  xmlns='http://www.w3.org/2000/svg'
30
- class="tw-block buy-icon tw-w-[36px] tw-h-[36px]"
37
+ class='tw-block buy-icon tw-w-[36px] tw-h-[36px]'
31
38
  >
32
39
  <rect width="36" height="36" rx="18" fill="#FC6C0F"/>
33
40
  <path d="M8 10H9.51521C10.2098 10 10.8135 10.4769 10.9744 11.1526L11.4143 13M11.4143 13L13.3341 21.0632C13.5486 21.9642 14.3536 22.6 15.2797 22.6H23.786C24.7278 22.6 25.542 21.943 25.7409 21.0225L26.9511 15.4225C27.2204 14.1765 26.2709 13 24.9962 13H11.4143Z" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -43,7 +50,7 @@
43
50
  viewBox='0 0 30 30'
44
51
  fill='none'
45
52
  xmlns='http://www.w3.org/2000/svg'
46
- class="tw-hidden buy-done-icon tw-w-[36px] tw-h-[36px]"
53
+ class='tw-hidden buy-done-icon tw-w-[36px] tw-h-[36px]'
47
54
  >
48
55
  <rect width="30" height="30" rx="15" fill="#FC6C0F"/>
49
56
  <rect x="1" y="1" width="28" height="28" rx="14" stroke="white" stroke-opacity="0.3" stroke-width="2"/>
@@ -54,12 +61,12 @@
54
61
  <div class='lg:tw-text-[16px] tw-text-[12px] tw-leading-[1.2] tw-font-bold'>
55
62
  {{
56
63
  block.settings.accessories_title
57
- | default: block.settings.accessories_product.selected_or_first_available_variant.title
64
+ | default: accessories_point_variant.title
58
65
  }}
59
66
  </div>
60
67
  <div class='lg:tw-text-[14px] tw-text-[12px] tw-leading-[1.5] tw-font-medium'>
61
68
  {{
62
- block.settings.accessories_product.selected_or_first_available_variant.price
69
+ accessories_point_variant.price
63
70
  | money_without_trailing_zeros
64
71
  }}
65
72
  </div>
@@ -72,10 +79,10 @@
72
79
  </div>
73
80
  <div class='swiper-pagination'></div>
74
81
  <div class='product-accessories-swiper-button-prev'>
75
- {% render 'zz-prev-next-btn', type: 'prev', color_type: 'dark' %}
82
+ {% render 'zz-prev-next-blur-icon', type: 'prev' %}
76
83
  </div>
77
84
  <div class='product-accessories-swiper-button-next'>
78
- {% render 'zz-prev-next-btn', type: 'next', color_type: 'dark' %}
85
+ {% render 'zz-prev-next-blur-icon', type: 'next' %}
79
86
  </div>
80
87
  </div>
81
88
 
@@ -104,6 +111,10 @@
104
111
  zz-accessories-preview-swiper {
105
112
  display: block;
106
113
  }
114
+ zz-accessories-preview-swiper .product-accessories-swiper-button-prev path,
115
+ zz-accessories-preview-swiper .product-accessories-swiper-button-next path {
116
+ fill: white;
117
+ }
107
118
  .product-accessories-swiper-container .swiper-pagination {
108
119
  --swiper-pagination-color: black;
109
120
  --swiper-pagination-bottom: 10px;
@@ -31,7 +31,7 @@
31
31
  </div>
32
32
 
33
33
  <div class=' tw-absolute tw-bottom-[20px] tw-left-1/2 tw-transform tw-translate-x-[-50%] tw-z-10 tw-w-[80%] '>
34
- <div class='swiper product-swiper-list-thumbs tw-opacity-0'>
34
+ <div class='swiper product-swiper-list-thumbs tw-opacity-0 tw-invisible'>
35
35
  <div class='swiper-wrapper tw-flex tw-justify-center'>
36
36
  {% for image in product_images %}
37
37
  <div class='swiper-slide !tw-w-auto tw-opacity-30'>
@@ -164,7 +164,7 @@
164
164
  const wrap = document.createElement('div');
165
165
  wrap.className = ' tw-absolute tw-bottom-[20px] tw-left-1/2 tw-transform tw-translate-x-[-50%] tw-z-10 tw-w-[80%] ';
166
166
  const thumbs = document.createElement('div');
167
- thumbs.className = 'swiper product-swiper-list-thumbs tw-opacity-0';
167
+ thumbs.className = 'swiper product-swiper-list-thumbs tw-opacity-0 tw-invisible';
168
168
  thumbs.innerHTML = `<div class="swiper-wrapper tw-flex tw-justify-center"></div>`;
169
169
  wrap.appendChild(thumbs);
170
170
  this.appendChild(wrap);
@@ -179,9 +179,10 @@
179
179
  if (typeof Swiper === 'undefined') return;
180
180
  // Thumbs
181
181
  this._thumbs = new Swiper(this._thumbsEl, {
182
- slidesPerView: 5,
182
+ slidesPerView: 3,
183
183
  spaceBetween: 8,
184
184
  watchSlidesProgress: true,
185
+
185
186
  slideToClickedSlide: true,
186
187
  breakpoints: {
187
188
  0: { slidesPerView: 4, spaceBetween: 6 },
@@ -193,7 +194,7 @@
193
194
  const initialCount = this._listEl.querySelectorAll('.swiper-slide').length;
194
195
  this._swiper = new Swiper(this._listEl, {
195
196
  loop: true,
196
- effect: 'slide',
197
+ effect: 'fade',
197
198
  loopedSlides: initialCount,
198
199
  slidesPerView: 1,
199
200
  spaceBetween: 10,
@@ -207,6 +208,8 @@
207
208
  },
208
209
  thumbs: { swiper: this._thumbs }
209
210
  });
211
+
212
+ this._thumbsEl.classList.remove('tw-invisible');
210
213
  }
211
214
 
212
215
  _destroySwipers() {