Suede watch strap - Harpy Leather
Suede watch strap
Showing all 2 results
thêm dây đh
// Map preview image theo mặt đồng hồ + dây đeo
const previewMap = {
gray: {
barenai: 'https://harpyleather.com/wp-content/uploads/2020/05/barenai-strap-with-mat-dong-ho-1.png',
buttero: 'https://harpyleather.com/wp-content/uploads/2020/05/flat-buttero-strap-with-mat-dong-ho-1.png'
},
blue: {
barenai: 'https://harpyleather.com/wp-content/uploads/2020/05/barenai-strap-with-mat-dong-ho-2.png',
buttero: 'https://harpyleather.com/wp-content/uploads/2020/05/flat-buttero-strap-with-mat-dong-ho-2.png'
}
};
let selectedWatch = null;
let selectedStrap = null;
function updatePreview() {
const img = document.getElementById('preview');
const hint = document.getElementById('hint');
if (selectedWatch && selectedStrap) {
const previewUrl = previewMap[selectedWatch]?.[selectedStrap] || '';
if (previewUrl) {
img.src = previewUrl;
img.style.display = 'block';
hint.style.display = 'none';
}
} else {
img.style.display = 'none';
hint.style.display = 'block';
}
}
// Sự kiện chọn mặt đồng hồ
document.querySelectorAll('.thumb.watch').forEach(el => {
el.addEventListener('click', function() {
document.querySelectorAll('.thumb.watch').forEach(i => i.classList.remove('selected'));
this.classList.add('selected');
selectedWatch = this.dataset.watch;
updatePreview();
});
});
// Sự kiện chọn dây đeo
document.querySelectorAll('.thumb.strap').forEach(el => {
el.addEventListener('click', function() {
document.querySelectorAll('.thumb.strap').forEach(i => i.classList.remove('selected'));
this.classList.add('selected');
selectedStrap = this.dataset.strap;
updatePreview();
});
});