/** Shopify CDN: Minification failed
Line 328:5 Transforming const to the configured target environment ("es5") is not supported yet
Line 336:6 Transforming const to the configured target environment ("es5") is not supported yet
**/
jQuery(document).ready(function(){
var vw = 0;
var timervwo = setInterval(function(){
jQuery('body').addClass('chescad');
var ur = window.location.href;
if(ur.includes('/collection') && !ur.includes('/product') || jQuery('body').hasClass('template-index')){
var q = 0;
var timerq = setInterval(function(){
if(jQuery('.quickview-button').length) {
var prod = jQuery('.products-grid .product-item');
for(var i = 0; i < prod.length; i++){
var lnk = prod.eq(i).find('a.product-grid-image').attr('href');
prod.eq(i).find('.product-image').eq(0).after(jQuery('
`));
}
});
jQuery(document).ready(function(){
document.querySelectorAll('ul#more-view-carousel a')[0].click()
});
const swipeContainer = document.querySelector('.col-xs-5.product-img-box');
// Add touchstart and touchend event listeners to the swipe container
swipeContainer.addEventListener('touchstart', function(e) {
touchStartX = e.changedTouches[0].pageX;
});
swipeContainer.addEventListener('touchend', function(e) {
touchEndX = e.changedTouches[0].pageX;
// Calculate the difference between touch start and touch end positions
const deltaX = touchEndX - touchStartX;
// You can define a threshold for swipe detection, for example, 50 pixels
if (Math.abs(deltaX) > 50) {
if (deltaX > 0) {
prevImage()
} else {
nextImage()
}
}
});
nextImage();
function nextImage(){
var $activeItem = $('ul#more-view-carousel li a.active');
// Find the next item
var $nextItem = $activeItem.closest('.owl-item').next();
// If there is a next item, activate it and deactivate the current one
if ($nextItem.length > 0) {
console.log('test');
$nextItem.find('a').eq(0).click();
$('.arrow.left').show();
if ($nextItem.is(':last-child')) {
$('.arrow.right').hide();
}
}
}
function prevImage(){
// Find the currently active item
var $activeItem = $('ul#more-view-carousel li a.active');
// Find the previous item
var $prevItem = $activeItem.closest('.owl-item').prev();
// If there is a previous item, activate it and deactivate the current one
if ($prevItem.length > 0) {
$prevItem.find('a').eq(0).click();
// Hide/show arrows as needed
$('.arrow.right').show();
if ($prevItem.is(':first-child')) {
$('.arrow.left').hide();
}
}
}
$('.arrow.left').hide();
$('ul#more-view-carousel li a').eq(0).click();
// Click event for the right arrow
$('.arrow.right').on('click', function() {
nextImage()
});
// Click event for the left arrow
$('.arrow.left').on('click', function() {
prevImage()
});
}
});
}