6 392
edições
Sem resumo de edição Etiqueta: Reversão manual |
Sem resumo de edição |
||
Linha 64: | Linha 64: | ||
function showImageInfo(imageName) { | function showImageInfo(imageName) { | ||
const imageInfo = imageList[imageName]; | const imageInfo = imageList[imageName]; | ||
let imagesHtml = | let imagesHtml = ` | ||
<div class="image-item"> | <div class="image-item"> | ||
<img src="${imageInfo.imageUrl}" alt="${imageName}"> | <img src="${imageInfo.imageUrl}" alt="${imageName}"> | ||
</div> | </div> | ||
<div class="variations-container"> | <div class="variations-container"> | ||
; | `; | ||
imageInfo.variations.forEach((variation, index) => { | imageInfo.variations.forEach((variation, index) => { | ||
imagesHtml += | imagesHtml += ` | ||
<div class="variation-item"> | <div class="variation-item"> | ||
<img src="${variation.additionalImages[0].url}" alt="Variation Image" class="variation-image" data-variation-index="${index}" style="width: ${variation.additionalImages[0].width}px;"> | <img src="${variation.additionalImages[0].url}" alt="Variation Image" class="variation-image" data-variation-index="${index}" style="width: ${variation.additionalImages[0].width}px;"> | ||
Linha 82: | Linha 82: | ||
</div> | </div> | ||
</div> | </div> | ||
; | `; | ||
}); | }); | ||
imagesHtml += | imagesHtml += `</div>`; | ||
imageContainer.innerHTML = imagesHtml; | imageContainer.innerHTML = imagesHtml; | ||
Linha 102: | Linha 102: | ||
const variationImage = button.previousElementSibling; // Atualiza a imagem da variação | const variationImage = button.previousElementSibling; // Atualiza a imagem da variação | ||
variationImage.src = variation.additionalImages[currentImageIndex].url; | variationImage.src = variation.additionalImages[currentImageIndex].url; | ||
variationImage.style.width = ${variation.additionalImages[currentImageIndex].width}px; | variationImage.style.width = `${variation.additionalImages[currentImageIndex].width}px`; | ||
}); | }); | ||
}); | }); |