This commit is contained in:
sebseb7
2025-11-23 12:18:01 +01:00
parent 68cc98cfd4
commit 22a4b88f58
3 changed files with 94 additions and 7 deletions

View File

@@ -127,6 +127,17 @@
.product-item {
padding: 0.25rem 0;
border-bottom: 1px solid #eee;
display: flex;
align-items: center;
gap: 0.5rem;
}
.product-image {
width: 32px;
height: 32px;
object-fit: cover;
border-radius: 4px;
background: #f0f0f0;
}
.product-item:last-child {
@@ -261,7 +272,21 @@
products.slice(0, 3).forEach(p => {
const li = document.createElement('li');
li.className = 'product-item';
li.textContent = `📦 ${p.cName}`;
// Image
if (p.images && p.images.length > 0) {
const img = document.createElement('img');
img.className = 'product-image';
img.src = `/img/prod/${p.images[0]}.avif`;
img.alt = p.cName;
img.onerror = () => img.style.display = 'none';
li.appendChild(img);
}
const span = document.createElement('span');
span.textContent = p.cName;
li.appendChild(span);
ul.appendChild(li);
});