Compare commits

..

8 Commits

Author SHA1 Message Date
5a171f0f0f Fix styling for new ingredient table 2025-08-14 11:08:25 +12:00
88f6628ee0 Change ratio and text size of step ingredient list 2025-08-14 11:08:25 +12:00
c92c754f5f Changed formatting to have title on left column at all times 2025-08-14 11:08:25 +12:00
672191cc5b fix edge-case layout bug 2025-08-14 11:08:25 +12:00
e487637600 Added basic new recipe page 2025-08-14 11:08:25 +12:00
d191c04bbf i keep getting distracted bruh 2025-08-14 11:08:25 +12:00
8cf8f50ff9 Add underline feedback for top bar 2025-08-14 11:08:25 +12:00
26cab10c14 [PIE-22] Add checklist for ingredients (!10)
Each row in the table can be clicked/tapped to be crossed off to complete
Co-authored-by: june <self@breadone.net>
Co-committed-by: june <self@breadone.net>
2025-08-13 23:55:11 +12:00

View File

@ -19,7 +19,7 @@ const tableView = true
)} )}
{tableView && ( {tableView && (
<table class={`table-auto text-left bg-[#2a2b2c] rounded-lg ${className} w-full`}> <table class={`table-auto text-left bg-[#2a2b2c] rounded-lg ${className}`}>
<thead> <thead>
<tr> <tr>
<th class="px-4 py-2">Quantity</th> <th class="px-4 py-2">Quantity</th>
@ -29,9 +29,9 @@ const tableView = true
</thead> </thead>
<tbody> <tbody>
{ {
ingredients.map(ing => ( ingredients.map((ing, index) => (
<> <>
<tr class="border-t border-gray-600"> <tr class="border-t border-white/10 cursor-pointer hover:bg-white/10 transition-opacity ingredient-row" data-index={index}>
<td class="px-4 py-2">{ing.quantity}</td> <td class="px-4 py-2">{ing.quantity}</td>
<td class="px-4 py-2">{ing.unit}</td> <td class="px-4 py-2">{ing.unit}</td>
<td class="px-4 py-2">{ing.name}</td> <td class="px-4 py-2">{ing.name}</td>
@ -41,4 +41,28 @@ const tableView = true
} }
</tbody> </tbody>
</table> </table>
)} )}
<style>
.ingredient-row.completed {
/* background-color: rgba(0, 0, 0, 0.4) !important; */
opacity: 0.6;
}
.ingredient-row.completed td {
text-decoration: line-through;
color: rgba(255, 255, 255, 0.5);
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
const rows = document.querySelectorAll('.ingredient-row');
rows.forEach(row => {
row.addEventListener('click', function() {
this.classList.toggle('completed');
});
});
});
</script>