
0) {
const newIndex = currentIndex - 1;
const img = thumbs[newIndex].querySelector('img');
const fullUrl = img.dataset.fullUrl;
const srcset = img.dataset.srcset;
const alt = img.alt;
const tempImage = new Image();
tempImage.src = fullUrl;
const updateImages = () => {
currentLightboxImage = fullUrl;
currentLightboxSrcset = srcset;
currentLightboxAlt = alt;
currentIndex = newIndex;
requestAnimationFrame(() => {
thumbs[newIndex].click();
});
};
if (tempImage.complete) {
updateImages();
} else {
tempImage.onload = updateImages;
}
}
}
"
@keydown.arrow-right.window="
if (showLightbox) {
const thumbs = document.querySelectorAll('.gallery-thumb');
if (currentIndex < thumbs.length - 1) {
const newIndex = currentIndex + 1;
const img = thumbs[newIndex].querySelector('img');
const fullUrl = img.dataset.fullUrl;
const srcset = img.dataset.srcset;
const alt = img.alt;
const tempImage = new Image();
tempImage.src = fullUrl;
const updateImages = () => {
currentLightboxImage = fullUrl;
currentLightboxSrcset = srcset;
currentLightboxAlt = alt;
currentIndex = newIndex;
requestAnimationFrame(() => {
thumbs[newIndex].click();
});
};
if (tempImage.complete) {
updateImages();
} else {
tempImage.onload = updateImages;
}
}
}
"
@touchstart="
$event.target === $event.currentTarget && $event.preventDefault();
window.touchStartX = $event.touches[0].clientX;
"
@touchmove="
$event.target === $event.currentTarget && $event.preventDefault();
"
@touchend="
$event.target === $event.currentTarget && $event.preventDefault();
if (!window.touchStartX) return;
const touchEndX = $event.changedTouches[0].clientX;
const diff = touchEndX - window.touchStartX;
const threshold = 50; // minimum swipe distance
if (Math.abs(diff) >= threshold) {
const thumbs = document.querySelectorAll('.gallery-thumb');
if (diff > 0 && currentIndex > 0) {
// Swipe right - go to previous
const newIndex = currentIndex - 1;
const img = thumbs[newIndex].querySelector('img');
const fullUrl = img.dataset.fullUrl;
const srcset = img.dataset.srcset;
const alt = img.alt;
const tempImage = new Image();
tempImage.src = fullUrl;
const updateImages = () => {
currentLightboxImage = fullUrl;
currentLightboxSrcset = srcset;
currentLightboxAlt = alt;
currentIndex = newIndex;
requestAnimationFrame(() => {
thumbs[newIndex].click();
});
};
if (tempImage.complete) {
updateImages();
} else {
tempImage.onload = updateImages;
}
} else if (diff < 0 && currentIndex < thumbs.length - 1) {
// Swipe left - go to next
const newIndex = currentIndex + 1;
const img = thumbs[newIndex].querySelector('img');
const fullUrl = img.dataset.fullUrl;
const srcset = img.dataset.srcset;
const alt = img.alt;
const tempImage = new Image();
tempImage.src = fullUrl;
const updateImages = () => {
currentLightboxImage = fullUrl;
currentLightboxSrcset = srcset;
currentLightboxAlt = alt;
currentIndex = newIndex;
requestAnimationFrame(() => {
thumbs[newIndex].click();
});
};
if (tempImage.complete) {
updateImages();
} else {
tempImage.onload = updateImages;
}
}
}
window.touchStartX = null;
"
x-data="{
isFirstImage() {
return currentIndex === 0;
},
isLastImage() {
const thumbs = document.querySelectorAll('.gallery-thumb');
return currentIndex === thumbs.length - 1;
}
}">
{
if (v.image_url) {
mainImage.src = v.image_url;
mainImage.srcset = v.image_srcset || '';
}
mainImage.style.opacity = 1;
}, 150);
}
">
Clavinova CLP725 R Console Digital Piano
NewDigital Piano - Console
Rosewood Clavinova console digital piano with bench
3-Year Store Warranty (In-Home)
100% 2 Years Trade-Up Credit
Matching Bench Included
$74999