zz-shopify-components 0.32.1-beta.3 → 0.32.1-beta.4

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.32.1-beta.3",
3
+ "version": "0.32.1-beta.4",
4
4
  "description": "Reusable Shopify components for theme projects",
5
5
  "keywords": [
6
6
  "shopify",
@@ -248,7 +248,7 @@
248
248
  const id = tab.dataset.target;
249
249
  const target = document.querySelector(`[data-zz-module-name="${id}"]`);
250
250
  if (!target) return;
251
- const headerHeight = isDesktop ? 50 : 50;
251
+ const headerHeight = isDesktop ? 50 : 100;
252
252
  const rect = target.getBoundingClientRect();
253
253
  const offsetTop = rect.top + window.scrollY - headerHeight;
254
254
  scrollPaginationToCenter();
@@ -41,6 +41,9 @@
41
41
  right: 6px;
42
42
  height: 1px;
43
43
  }
44
+ #shopify-section-{{ section.id }} .custom-pagination {
45
+ padding-right: calc(100% - 20px - 196px);
46
+ }
44
47
  #shopify-section-{{ section.id }} .progress-line {
45
48
  height: 1px;
46
49
  background-color: #FFFFFF;
@@ -143,7 +146,7 @@
143
146
  </div>
144
147
 
145
148
  <!-- Pagination indicator -->
146
- <div class='custom-pagination zz-overflow-scrollbar-hidden tw-px-[20px] lg:tw-px-[80px] tw-z-10 tw-w-full tw-absolute tw-left-0 tw-bottom-[122px] lg:tw-bottom-[20px] tw-flex tw-flex-nowrap tw-overflow-x-auto tw-overflow-y-hidden tw-justify-start lg:tw-justify-center tw-gap-[15px]'>
149
+ <div class='custom-pagination zz-overflow-scrollbar-hidden tw-pl-[20px] lg:tw-px-[80px] tw-z-10 tw-w-full tw-absolute tw-left-0 tw-bottom-[122px] lg:tw-bottom-[20px] tw-flex tw-flex-nowrap tw-overflow-x-auto tw-overflow-y-hidden tw-justify-start lg:tw-justify-center max-lg:tw-gap-[20px] lg:tw-gap-[15px]'>
147
150
  {% for block in swiper_blocks %}
148
151
  <div class="pagination-item tw-cursor-pointer tw-text-white tw-relative tw-rounded-[10px] tw-w-[196px] tw-h-[95px] lg:tw-w-[389px] lg:tw-h-[213px]"
149
152
  {% if section.settings.module_id != blank %} data-track-zz-element="{{ section.settings.module_id }}_change" {% endif %}
@@ -298,12 +301,10 @@
298
301
  const activeBullet = paginationContainer.querySelector('.pagination-item-active');
299
302
 
300
303
  if (activeBullet) {
301
- const containerWidth = paginationContainer.offsetWidth;
302
304
  const bulletLeft = activeBullet.offsetLeft;
303
- const bulletWidth = activeBullet.offsetWidth;
304
305
 
305
- // 计算需要滚动的位置,使当前bullet居中
306
- const scrollPosition = bulletLeft - (containerWidth / 2) + (bulletWidth / 2);
306
+ // 计算需要滚动的位置,使当前bullet左对齐,保留20px左边距
307
+ const scrollPosition = bulletLeft - 20;
307
308
 
308
309
  paginationContainer.scrollTo({
309
310
  left: scrollPosition,