Skip to content

Commit

Permalink
Added effort to selected meal, replaced price with emojis
Browse files Browse the repository at this point in the history
  • Loading branch information
Nereuxofficial committed Aug 20, 2023
1 parent fdc4556 commit eb7f918
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/frontend/index.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<div id="food-display" class="p-4 bg-gray-100 rounded text-center">
<p class="text-xl" id="food-name-placeholder">Picked Food</p>
<p class="text-lg" id="food-price-placeholder">Price: </p>
<p class="text-md" id="food-effort-placeholder">Effort: </p>
</div>
<button id="select-food" class="mt-4 bg-blue-500 text-white px-6 py-2 rounded hover:bg-blue-600">Select Food</button>
</div>
Expand Down Expand Up @@ -98,8 +99,20 @@
const data = await response.json();
const foodNamePlaceholder = document.getElementById("food-name-placeholder");
const foodPricePlaceholder = document.getElementById("food-price-placeholder");
const foodEffortPlaceholder = document.getElementById("food-effort-placeholder");
foodNamePlaceholder.textContent = data.name;
foodPricePlaceholder.textContent = `Price: ${data.price}`;
// Display price using coin emojis
const priceEmojis = {
"Low": "🪙",
"Medium": "🪙🪙",
"High": "🪙🪙🪙"
};
foodPricePlaceholder.textContent = `Price: ${priceEmojis[data.price]}`;
// Display effort
foodEffortPlaceholder.textContent = `Effort: ${data.effort}`;
} else {
console.error("Failed to fetch data");
Expand Down

0 comments on commit eb7f918

Please sign in to comment.