फिटेन मेटाक्स टेप 50 मार्क [टेपिंग सप्लाई]
0) { const variantImage = document.getElementById('variant-image'); const variantImageContainer = document.getElementById('variant-image-container'); const variantJsonScript = document.querySelector('variant-radios script'); if (variantJsonScript && variantJsonScript.textContent.trim() !== '') { try { const variantJson = JSON.parse(variantJsonScript.textContent.trim()); function updateVariantImage(variantId) { const selectedVariant = variantJson.find(v => v.id === parseInt(variantId)); if (selectedVariant && selectedVariant.featured_image) { variantImage.src = selectedVariant.featured_image.src; variantImageContainer.classList.add('visible'); // ← このように変更 } else { variantImageContainer.classList.remove('visible'); // ← このように変更 } } variantRadios.forEach(radio => { radio.addEventListener('change', (event) => { const selectedVariantId = event.target.getAttribute('data-variant-id'); updateVariantImage(selectedVariantId); }); }); } catch (e) { console.error("Error parsing variant JSON:", e); } } } // --- Keen Slider Initialization --- if (typeof KeenSlider !== 'undefined') { function ThumbnailPlugin(main) { return (slider) => { function removeActive() { slider.slides.forEach((s) => s.classList.remove("active")) } function addActive(idx) { slider.slides[idx].classList.add("active") } function addClickEvents() { slider.slides.forEach((slide, idx) => { slide.addEventListener("click", () => { main.moveToIdx(idx) }) }) } slider.on("created", () => { addActive(slider.track.details.rel); addClickEvents(); main.on("animationStarted", (main) => { removeActive(); const next = main.animator.targetIdx || 0; addActive(main.track.absToRel(next)); slider.moveToIdx(Math.min(slider.track.details.maxIdx, next)); }); }); } } const mainSliderEl = document.getElementById('my-keen-slider'); const thumbSliderEl = document.getElementById('thumbnails'); if (mainSliderEl) { let mainSlider; if (thumbSliderEl) { mainSlider = new KeenSlider(mainSliderEl); const thumbnailSlider = new KeenSlider(thumbSliderEl, { initial: 0, slides: { perView: 5, spacing: 10 }, }, [ThumbnailPlugin(mainSlider)]); } else { mainSlider = new KeenSlider(mainSliderEl); } } } else { console.log("KeenSlider library not found. Sliders will not be initialized."); } // --- Short Description "Read More" Click --- const shortDescription = document.querySelector('.product-single__shortdes'); const fullDescription = document.getElementById('proTabs1'); if (shortDescription && fullDescription) { shortDescription.addEventListener('click', function() { fullDescription.scrollIntoView({ behavior: 'smooth' }); fullDescription.classList.add('highlight'); setTimeout(() => { fullDescription.classList.remove('highlight'); }, 1500); }); } // --- Quantity Selector Logic --- const mainQtyInput = document.getElementById('Quantity'); const stickyQtyInput = document.getElementById('StickyQuantity'); document.querySelectorAll('.quantity-selector-box').forEach(box => { const input = box.querySelector('.quantity-input'); const minusBtn = box.querySelector('.quantity-button.minus'); const plusBtn = box.querySelector('.quantity-button.plus'); if(input && minusBtn && plusBtn) { minusBtn.addEventListener('click', () => { let currentValue = parseInt(input.value); if (currentValue > 1) { input.value = currentValue - 1; syncQuantities(input); } }); plusBtn.addEventListener('click', () => { let currentValue = parseInt(input.value); input.value = currentValue + 1; syncQuantities(input); }); input.addEventListener('change', () => syncQuantities(input)); } }); function syncQuantities(changedInput) { const newValue = changedInput.value; if (mainQtyInput && stickyQtyInput) { if (changedInput.id === 'Quantity') { stickyQtyInput.value = newValue; } else { mainQtyInput.value = newValue; } } } // --- Sticky Bar Logic --- const stickyBar = document.getElementById('sticky-add-to-cart-bar'); const originalAddToCartWrapper = document.querySelector('.action-wrapper'); const mobileNav = document.getElementById('stickymenu_bottom_mobile'); const stickyAddToCartButton = document.getElementById('StickyAddToCart'); const mainAddToCartButton = document.getElementById('AddToCart'); if (stickyAddToCartButton && mainAddToCartButton) { stickyAddToCartButton.addEventListener('click', function() { mainAddToCartButton.click(); }); } function adjustStickyBarPosition() { if (window.innerWidth <= 767 && mobileNav && stickyBar) { const mobileNavHeight = mobileNav.offsetHeight; stickyBar.style.bottom = `${mobileNavHeight}px`; } else if (stickyBar) { stickyBar.style.bottom = '0px'; } } if (stickyBar && originalAddToCartWrapper) { const observer = new IntersectionObserver( ([entry]) => { if (entry.isIntersecting) { stickyBar.classList.remove('visible'); } else { stickyBar.classList.add('visible'); } }, { rootMargin: "0px 0px 0px 0px", threshold: 0 } ); observer.observe(originalAddToCartWrapper); } // Initial adjustment on load adjustStickyBarPosition(); window.addEventListener('resize', adjustStickyBarPosition); window.addEventListener('resize', adjustStickyBarPosition); const stickyButton = document.getElementById('StickyAddToCart'); const stickyButtonSpan = document.getElementById('StickyAddToCartText'); if (stickyButton && stickyButtonSpan) { const observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.attributeName === 'disabled' && stickyButton.hasAttribute('disabled')) { setTimeout(function() { if (stickyButton.hasAttribute('disabled')) { stickyButton.removeAttribute('disabled'); stickyButton.style.pointerEvents = 'auto'; stickyButton.classList.remove('btn--loader-active'); const addToCartText = "कार्ट में जोड़ें"; stickyButtonSpan.textContent = addToCartText || 'Add to cart'; } }, 1500); // 1.5秒 } }); }); observer.observe(stickyButton, { attributes: true }); } }); function openPaymentsPopup() { const modal = document.getElementById('payments-modal'); modal.style.display = 'flex'; setTimeout(() => { // Allow display change to register before adding class modal.classList.add('visible'); }, 10); } function closePaymentsPopup() { const modal = document.getElementById('payments-modal'); modal.classList.remove('visible'); modal.addEventListener('transitionend', function(e) { if (e.propertyName === 'opacity' && !modal.classList.contains('visible')) { modal.style.display = 'none'; } }, { once: true }); } document.addEventListener('click', function(e) { if (e.target.id === 'payments-modal') { closePaymentsPopup(); } });
- AED د.إ
- AUD $
- BAM КМ
- BBD $
- BDT ৳
- BGN лв.
- BRL R$
- BWP P
- BZD $
- CAD $
- CHF CHF
- CNY ¥
- CRC ₡
- CZK Kč
- DJF Fdj
- DKK kr.
- DZD د.ج
- EGP ج.م
- ETB Br
- EUR €
- GBP £
- GNF Fr
- HKD $
- HNL L
- HUF Ft
- IDR Rp
- ILS ₪
- INR ₹
- ISK kr
- JMD $
- JPY ¥
- KHR ៛
- KMF Fr
- KRW ₩
- KZT ₸
- LAK ₭
- LBP ل.ل
- LKR ₨
- MAD د.م.
- MKD ден
- MMK K
- MNT ₮
- MOP P
- MUR ₨
- MXN $
- MYR RM
- NGN ₦
- NPR Rs.
- NZD $
- PEN S/
- PGK K
- PHP ₱
- PKR ₨
- PLN zł
- PYG ₲
- QAR ر.ق
- RON Lei
- RSD РСД
- RWF FRw
- SAR ر.س
- SBD $
- SEK kr
- SGD $
- SHP £
- THB ฿
- TJS ЅМ
- TRY ₺
- TTD $
- TWD $
- UAH ₴
- UGX USh
- USD $
- UYU $U
- UZS so'm
- VND ₫
- VUV Vt
- WST T
- XAF CFA
- XCD $
- XOF Fr
- YER ﷼
- AED د.إ
- AUD $
- BAM КМ
- BBD $
- BDT ৳
- BGN лв.
- BRL R$
- BWP P
- BZD $
- CAD $
- CHF CHF
- CNY ¥
- CRC ₡
- CZK Kč
- DJF Fdj
- DKK kr.
- DZD د.ج
- EGP ج.م
- ETB Br
- EUR €
- GBP £
- GNF Fr
- HKD $
- HNL L
- HUF Ft
- IDR Rp
- ILS ₪
- INR ₹
- ISK kr
- JMD $
- JPY ¥
- KHR ៛
- KMF Fr
- KRW ₩
- KZT ₸
- LAK ₭
- LBP ل.ل
- LKR ₨
- MAD د.م.
- MKD ден
- MMK K
- MNT ₮
- MOP P
- MUR ₨
- MXN $
- MYR RM
- NGN ₦
- NPR Rs.
- NZD $
- PEN S/
- PGK K
- PHP ₱
- PKR ₨
- PLN zł
- PYG ₲
- QAR ر.ق
- RON Lei
- RSD РСД
- RWF FRw
- SAR ر.س
- SBD $
- SEK kr
- SGD $
- SHP £
- THB ฿
- TJS ЅМ
- TRY ₺
- TTD $
- TWD $
- UAH ₴
- UGX USh
- USD $
- UYU $U
- UZS so'm
- VND ₫
- VUV Vt
- WST T
- XAF CFA
- XCD $
- XOF Fr
- YER ﷼