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