We offer to exchange, refund or credit online purchases returned within 14 days. More info here.
jq(document).ready(function() {
jq('.div_CS .direction-nav .prev, .div_CS .direction-nav .next').on('click', function() {
const container = this.closest('.textrow.div_CS');
const direction = this.classList.value;
if (!container) return;
const track = container.querySelector('.swatch-image-wrapper');
if (!track) return;
const containerWidth = container.offsetWidth;
const trackWidth = track.scrollWidth;
const maxScroll = trackWidth - containerWidth;
if (maxScroll <= 0) return;
let currentX = 0;
const matrix = window.getComputedStyle(track).transform;
if (matrix && matrix !== 'none') {
const values = matrix.split('(')[1].split(')')[0].split(',');
currentX = parseFloat(values[4] || values[12] || 0);
}
const step = containerWidth * 0.6;
let targetX = currentX;
if (direction === 'next') {
targetX -= step;
if (Math.abs(targetX) > maxScroll) {
targetX = -maxScroll;
container.classList.add('no-next');
}
} else if (direction === 'prev') {
targetX += step;
container.classList.remove('no-next');
if (targetX > 0) {
targetX = 0;
}
}
track.style.transition = 'transform 0.3s ease-out';
track.style.transform = `translate3d(${targetX}px, 0px, 0px)`;
});
});