Spaces:
Sleeping
Sleeping
Update static/script.js
Browse files- static/script.js +6 -0
static/script.js
CHANGED
|
@@ -125,6 +125,11 @@ function displayIngredientsList(ingredients) {
|
|
| 125 |
const img = document.createElement('img');
|
| 126 |
img.src = ingredient.image_url || 'https://via.placeholder.com/80'; // Fallback image
|
| 127 |
img.alt = ingredient.name;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
const button = document.createElement('button');
|
| 129 |
button.textContent = 'Add';
|
| 130 |
button.onclick = () => {
|
|
@@ -134,6 +139,7 @@ function displayIngredientsList(ingredients) {
|
|
| 134 |
}
|
| 135 |
};
|
| 136 |
item.appendChild(img);
|
|
|
|
| 137 |
item.appendChild(button);
|
| 138 |
ingredientsList.appendChild(item);
|
| 139 |
});
|
|
|
|
| 125 |
const img = document.createElement('img');
|
| 126 |
img.src = ingredient.image_url || 'https://via.placeholder.com/80'; // Fallback image
|
| 127 |
img.alt = ingredient.name;
|
| 128 |
+
const name = document.createElement('div');
|
| 129 |
+
name.textContent = ingredient.name;
|
| 130 |
+
name.style.textAlign = 'center';
|
| 131 |
+
name.style.marginTop = '5px';
|
| 132 |
+
name.style.fontSize = '12px';
|
| 133 |
const button = document.createElement('button');
|
| 134 |
button.textContent = 'Add';
|
| 135 |
button.onclick = () => {
|
|
|
|
| 139 |
}
|
| 140 |
};
|
| 141 |
item.appendChild(img);
|
| 142 |
+
item.appendChild(name);
|
| 143 |
item.appendChild(button);
|
| 144 |
ingredientsList.appendChild(item);
|
| 145 |
});
|