Spaces:
Sleeping
Sleeping
Update static/script.js
Browse files- static/script.js +9 -1
static/script.js
CHANGED
|
@@ -117,6 +117,12 @@ function displayIngredientsList(ingredients) {
|
|
| 117 |
name.style.textAlign = 'center';
|
| 118 |
name.style.marginTop = '5px';
|
| 119 |
name.style.fontSize = '12px';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
const button = document.createElement('button');
|
| 121 |
button.textContent = 'Add';
|
| 122 |
button.onclick = () => {
|
|
@@ -125,8 +131,10 @@ function displayIngredientsList(ingredients) {
|
|
| 125 |
displaySelectedIngredients();
|
| 126 |
}
|
| 127 |
};
|
|
|
|
| 128 |
item.appendChild(img);
|
| 129 |
item.appendChild(name);
|
|
|
|
| 130 |
item.appendChild(button);
|
| 131 |
ingredientsList.appendChild(item);
|
| 132 |
});
|
|
@@ -239,4 +247,4 @@ document.getElementById('userInput').addEventListener('keypress', function(e) {
|
|
| 239 |
}
|
| 240 |
});
|
| 241 |
|
| 242 |
-
console.log('Script loaded successfully');
|
|
|
|
| 117 |
name.style.textAlign = 'center';
|
| 118 |
name.style.marginTop = '5px';
|
| 119 |
name.style.fontSize = '12px';
|
| 120 |
+
const description = document.createElement('div');
|
| 121 |
+
description.textContent = ingredient.description; // Display the description
|
| 122 |
+
description.style.fontSize = '10px';
|
| 123 |
+
description.style.color = '#666';
|
| 124 |
+
description.style.marginTop = '5px';
|
| 125 |
+
|
| 126 |
const button = document.createElement('button');
|
| 127 |
button.textContent = 'Add';
|
| 128 |
button.onclick = () => {
|
|
|
|
| 131 |
displaySelectedIngredients();
|
| 132 |
}
|
| 133 |
};
|
| 134 |
+
|
| 135 |
item.appendChild(img);
|
| 136 |
item.appendChild(name);
|
| 137 |
+
item.appendChild(description); // Add description below name
|
| 138 |
item.appendChild(button);
|
| 139 |
ingredientsList.appendChild(item);
|
| 140 |
});
|
|
|
|
| 247 |
}
|
| 248 |
});
|
| 249 |
|
| 250 |
+
console.log('Script loaded successfully');
|