Compare commits

..

3 Commits

Author SHA1 Message Date
7c87342dea
name field expands when overflow 2025-08-14 11:31:09 +12:00
97cc5da5b8
Fix table rows being out of alignment 2025-08-14 11:23:51 +12:00
b9c665860f
Use fixed table widths 2025-08-14 11:19:34 +12:00

View File

@ -11,10 +11,10 @@ const { recipeid } = Astro.params;
---
<script>
let ingredients: {qty: string, unit: string, ing: string}[] = []
let ingredients: {qty: string, unit: string, name: string}[] = []
function addIngredient(q: string, u: string, i: string) {
ingredients.push({qty: q, unit: u, ing: i})
function addIngredient(q: string, u: string, n: string) {
ingredients.push({qty: q, unit: u, name: n})
}
</script>
@ -27,12 +27,13 @@ const { recipeid } = Astro.params;
<!-- <ImageCarousel class="w-full" recipe={re} /> -->
<textarea
id="rec-name"
name="Recipe Name"
name="name"
rows="1"
placeholder="Recipe Name"
class="text-[28pt] font-bold h-12 p-1 leading-none mt-2 bg-white/20 rounded-lg"
style="resize: none;"
placeholder="Name"
class="text-[28pt] font-bold p-1 leading-none mt-2 bg-white/20 rounded-lg resize-none overflow-hidden"
oninput="this.style.height = ''; this.style.height = this.scrollHeight + 'px'"
/>
<!-- if it works :3 -->
<!-- Details -->
<!-- <InfoView re={re} /> -->
@ -40,24 +41,24 @@ const { recipeid } = Astro.params;
<div class="flex flex-row align-middle items-center">
<p class="mt-4 text-[22pt] font-bold 'mt-4'">Ingredients</p>
</div>
<table class={`table-auto text-left bg-[#2a2b2c] rounded-lg w-full`}>
<table class={`table-fixed text-left bg-[#2a2b2c] rounded-lg w-full`}>
<thead>
<tr>
<th class="px-4 py-2">Qty</th>
<th class="px-4 py-2">Unit</th>
<th class="px-4 py-2 w-25">Quantity</th>
<th class="px-4 py-2 w-20">Unit</th>
<th class="px-4 py-2">Ingredient</th>
</tr>
</thead>
<tbody id="ingredient-table" class="w-full border-t px-4 py-2 border-gray-600">
<tr id="ingredient-input" class="">
<td class="px-2 py-1">
<input class="w-full h-10 bg-white/20 rounded-lg px-2 py-2" type="text" placeholder="Amount">
<input id="ing-qty" class="w-full h-11 bg-white/20 rounded-lg px-2 py-2" type="text" placeholder="Qty">
</td>
<td class="px-2 py-1">
<input class="w-full h-10 bg-white/20 rounded-lg px-2 py-2" type="text" placeholder="Unit">
<input id="ing-unit" class="w-full h-11 bg-white/20 rounded-lg px-2 py-2" type="text" placeholder="Unit">
</td>
<td class="px-2 py-1">
<textarea class="w-full h-10 bg-white/20 rounded-lg px-2 py-2 mt-1 resize-none leading-tight" placeholder="Ingredient" rows="1"/>
<textarea id="ing-name" class="w-full h-11 bg-white/20 rounded-lg px-2 py-3 mt-1 resize-none leading-tight" placeholder="Ingredient" rows="1"/>
</td>
</tr>
</tbody>