|
11 | 11 | <div class="flex"> |
12 | 12 | <label |
13 | 13 | for="addFeat" |
14 | | - class="btn btn-primary border border-black text-xl mb-8 w-full max-w-sm mx-auto" |
| 14 | + class="mx-auto mb-8 btn-primary w-full max-w-sm cursor-pointer px-6 py-3 text-center text-lg shadow-md transition-all hover:shadow-lg sm:text-xl" |
15 | 15 | >Ny prestation</label |
16 | 16 | > |
17 | 17 | </div> |
18 | | -<input type="checkbox" id="addFeat" class="modal-toggle" /> |
19 | | -<div class="modal modal-bottom sm:modal-middle"> |
20 | | - <div class="modal-box flex"> |
21 | | - <div class="mx-auto"> |
22 | | - <h3 class="font-bold text-xl">Ny prestation</h3> |
23 | | - <form |
24 | | - on:submit={() => (loading = true)} |
25 | | - method="POST" |
26 | | - id="add-form" |
27 | | - enctype="multipart/form-data" |
28 | | - action={formActionPath} |
29 | | - > |
30 | | - <Input |
31 | | - name="points" |
32 | | - type="number" |
33 | | - label="Poäng" |
34 | | - required={true} |
35 | | - min={0} |
36 | | - max={15} |
37 | | - step="0.01" |
38 | | - altLabel="0-15, 0 om osäker" |
39 | | - /> |
40 | 18 |
|
41 | | - <div class="form-control w-full max-w-xs"> |
42 | | - <label class="label" for="location"> |
43 | | - <span class="label-text">Plats</span> |
44 | | - <span class="label-text-alt">Specialkrogar märkta med *</span> |
45 | | - </label> |
46 | | - <select name="location" required bind:value={locationId} class="select select-bordered"> |
47 | | - <option disabled selected value="">Välj plats</option> |
48 | | - {#each $locations as location} |
49 | | - <option value={location.id}>{location.name}</option> |
50 | | - {/each} |
51 | | - </select> |
52 | | - </div> |
| 19 | +<!-- Add Feat Modal --> |
| 20 | +<input type="checkbox" id="addFeat" class="peer hidden" /> |
| 21 | +<div |
| 22 | + class="pointer-events-none fixed inset-0 z-50 flex items-center justify-center bg-stone-900/50 p-4 opacity-0 backdrop-blur-sm transition-opacity duration-200 peer-checked:pointer-events-auto peer-checked:opacity-100" |
| 23 | +> |
| 24 | + <label for="addFeat" class="absolute inset-0 cursor-default"></label> |
| 25 | + <div |
| 26 | + class="relative mx-auto max-h-[90vh] w-full max-w-lg scale-95 transform overflow-y-auto rounded-xl bg-white p-6 shadow-xl transition-transform duration-200 peer-checked:scale-100 sm:p-8" |
| 27 | + > |
| 28 | + <h3 class="mb-6 font-serif text-2xl font-bold text-brand-900">Ny prestation</h3> |
| 29 | + <form |
| 30 | + on:submit={() => (loading = true)} |
| 31 | + method="POST" |
| 32 | + id="add-form" |
| 33 | + enctype="multipart/form-data" |
| 34 | + action={formActionPath} |
| 35 | + class="space-y-5" |
| 36 | + > |
| 37 | + <Input |
| 38 | + name="points" |
| 39 | + type="number" |
| 40 | + label="Poäng" |
| 41 | + required={true} |
| 42 | + min={0} |
| 43 | + max={15} |
| 44 | + step="0.01" |
| 45 | + altLabel="0-15, 0 om osäker" |
| 46 | + /> |
53 | 47 |
|
54 | | - <div class="form-control w-full max-w-xs"> |
55 | | - <label class="label" for="proofs"> |
56 | | - <span class="label-text">Välj bildbevis</span> |
57 | | - </label> |
58 | | - <input |
59 | | - type="file" |
60 | | - name="proofs" |
61 | | - required |
62 | | - multiple |
63 | | - class="file-input file-input-secondary file-input-sm file-input-bordered w-full max-w-xs" |
64 | | - /> |
| 48 | + <div class="w-full"> |
| 49 | + <div class="mb-1 flex items-end justify-between"> |
| 50 | + <label class="block text-sm font-medium text-stone-700" for="location"> Plats </label> |
| 51 | + <span class="text-xs text-stone-500">Specialkrogar märkta med *</span> |
65 | 52 | </div> |
| 53 | + <select name="location" required bind:value={locationId} class="input-field"> |
| 54 | + <option disabled selected value="">Välj plats</option> |
| 55 | + {#each $locations as location} |
| 56 | + <option value={location.id}>{location.name}</option> |
| 57 | + {/each} |
| 58 | + </select> |
| 59 | + </div> |
66 | 60 |
|
67 | | - <Input name="teamComment" type="text" label="Kommentar" altLabel="" /> |
68 | | - <input hidden value={$event?.id} name="event" /> |
69 | | - <input hidden value={locationName} name="locationName" /> |
70 | | - <div class="flex gap-3 mt-3"> |
71 | | - <button class="btn btn-primary"> |
72 | | - <Loading {loading}>Spara</Loading> |
73 | | - </button> |
74 | | - <label for="addFeat" class="btn">Stäng</label> |
75 | | - </div> |
76 | | - </form> |
77 | | - </div> |
| 61 | + <div class="w-full"> |
| 62 | + <label class="mb-2 block text-sm font-medium text-stone-700" for="proofs"> |
| 63 | + Välj bildbevis |
| 64 | + </label> |
| 65 | + <input |
| 66 | + type="file" |
| 67 | + name="proofs" |
| 68 | + id="proofs" |
| 69 | + required |
| 70 | + multiple |
| 71 | + class="block w-full rounded-md border |
| 72 | + border-stone-300 p-1 text-sm |
| 73 | + text-stone-500 transition-colors |
| 74 | + file:mr-4 file:rounded-md |
| 75 | + file:border-0 file:bg-brand-50 |
| 76 | + file:px-4 file:py-2 file:text-sm file:font-semibold file:text-brand-700 hover:file:bg-brand-100" |
| 77 | + /> |
| 78 | + </div> |
| 79 | + |
| 80 | + <Input name="teamComment" type="text" label="Kommentar" altLabel="" /> |
| 81 | + <input hidden value={$event?.id} name="event" /> |
| 82 | + <input hidden value={locationName} name="locationName" /> |
| 83 | + |
| 84 | + <div class="mt-6 flex gap-3 border-t border-stone-100 pt-6"> |
| 85 | + <button class="btn-primary flex-1"> |
| 86 | + <Loading {loading}>Spara</Loading> |
| 87 | + </button> |
| 88 | + <label for="addFeat" class="btn-secondary flex-1 cursor-pointer text-center">Stäng</label> |
| 89 | + </div> |
| 90 | + </form> |
78 | 91 | </div> |
79 | 92 | </div> |
0 commit comments