|
23 | 23 | </label> |
24 | 24 | <select id="grid-type" class="w-full" bind:value={grid.type}> |
25 | 25 | <option value="none">No grid</option> |
26 | | - <option value="full">Full grid (Grid lines and outer border)</option> |
27 | | - <option value="lines">Grid lines only</option> |
28 | | - <option value="border">Outer border only</option> |
| 26 | + <option value="full">Full grid (Border and grid lines)</option> |
| 27 | + <option value="lines">Only grid lines</option> |
| 28 | + <option value="border">Only outer border</option> |
| 29 | + <option value="invisible">Invisible grid</option> |
29 | 30 | </select> |
30 | 31 | </FormField> |
31 | 32 |
|
32 | | - <FormField> |
33 | | - <label for="grid-color"> |
34 | | - <MaterialSymbolsColorsRounded class="size-4" /> |
35 | | - Grid color |
36 | | - </label> |
37 | | - <div |
38 | | - class="dark:bg-input/30 border-input grid place-items-center rounded-md border bg-transparent p-1" |
39 | | - > |
40 | | - <input id="grid-color" class="w-full" type="color" bind:value={grid.color} /> |
41 | | - </div> |
42 | | - </FormField> |
43 | | - |
44 | | - <FormField> |
45 | | - <label for="grid-lines-size"> |
46 | | - <MaterialSymbolsLineWeightRounded class="size-4" /> |
47 | | - Grid lines size |
48 | | - </label> |
49 | | - <InputWithUnit unit="px" disabled={grid.type === 'none'}> |
50 | | - <input |
51 | | - id="grid-lines-size" |
52 | | - type="text" |
53 | | - inputMode="numeric" |
54 | | - pattern="[0-9]*" |
55 | | - title="Use 1 or a bigger integer number of pixels" |
56 | | - bind:value={grid.lines.size} |
57 | | - disabled={grid.type === 'none'} |
58 | | - /> |
59 | | - </InputWithUnit> |
60 | | - </FormField> |
| 33 | + {#if grid.type !== 'none'} |
| 34 | + <FormField> |
| 35 | + <label for="grid-color"> |
| 36 | + <MaterialSymbolsColorsRounded class="size-4" /> |
| 37 | + Grid color |
| 38 | + </label> |
| 39 | + <div |
| 40 | + class="dark:bg-input/30 border-input grid place-items-center rounded-md border bg-transparent p-1" |
| 41 | + > |
| 42 | + <input id="grid-color" class="w-full" type="color" bind:value={grid.color} /> |
| 43 | + </div> |
| 44 | + </FormField> |
61 | 45 |
|
62 | | - <FormField> |
63 | | - <label for="grid-cell-shape"> |
64 | | - <MaterialSymbolsCropRounded class="size-4" /> |
65 | | - Grid cell shape |
66 | | - </label> |
67 | | - <select id="grid-cell-shape" class="w-full" bind:value={grid.cell.shape}> |
68 | | - <option value="square">Square (Same width and height)</option> |
69 | | - <option value="rectangle">Rectangle (Different width and height)</option> |
70 | | - </select> |
71 | | - </FormField> |
| 46 | + {#if grid.type !== 'invisible'} |
| 47 | + <FormField> |
| 48 | + <label for="grid-lines-size"> |
| 49 | + <MaterialSymbolsLineWeightRounded class="size-4" /> |
| 50 | + {#if grid.type === 'full'} |
| 51 | + Grid border and lines size |
| 52 | + {:else if grid.type === 'lines'} |
| 53 | + Grid lines size |
| 54 | + {:else if grid.type === 'border'} |
| 55 | + Grid border size |
| 56 | + {/if} |
| 57 | + </label> |
| 58 | + <InputWithUnit unit="px"> |
| 59 | + <input |
| 60 | + id="grid-lines-size" |
| 61 | + type="text" |
| 62 | + inputMode="numeric" |
| 63 | + pattern="[0-9]*" |
| 64 | + title="Use 1 or a bigger integer number of pixels" |
| 65 | + bind:value={grid.lines.size} |
| 66 | + /> |
| 67 | + </InputWithUnit> |
| 68 | + </FormField> |
| 69 | + {/if} |
72 | 70 |
|
73 | | - <FormField> |
74 | | - <label for="grid-cell-width"> |
75 | | - <MaterialSymbolsExpandRounded class="size-4 rotate-90" /> |
76 | | - Grid cell width |
77 | | - </label> |
78 | | - <InputWithUnit unit="px"> |
79 | | - <input |
80 | | - id="grid-cell-width" |
81 | | - type="text" |
82 | | - inputMode="numeric" |
83 | | - pattern="[0-9]*" |
84 | | - title="Use 1 or a bigger integer number of pixels" |
85 | | - bind:value={grid.cell.width} |
86 | | - /> |
87 | | - </InputWithUnit> |
88 | | - </FormField> |
| 71 | + <FormField> |
| 72 | + <label for="grid-cell-shape"> |
| 73 | + <MaterialSymbolsCropRounded class="size-4" /> |
| 74 | + Grid cell shape |
| 75 | + </label> |
| 76 | + <select id="grid-cell-shape" class="w-full" bind:value={grid.cell.shape}> |
| 77 | + <option value="square">Square (Same width and height)</option> |
| 78 | + <option value="rectangle">Rectangle (Different width and height)</option> |
| 79 | + </select> |
| 80 | + </FormField> |
89 | 81 |
|
90 | | - <FormField> |
91 | | - <label for="grid-cell-height"> |
92 | | - <MaterialSymbolsExpandRounded class="size-4" /> |
93 | | - Grid cell height |
94 | | - </label> |
95 | | - {#if grid.cell.shape === 'rectangle'} |
| 82 | + <FormField> |
| 83 | + <label for="grid-cell-width"> |
| 84 | + <MaterialSymbolsExpandRounded class="size-4 rotate-90" /> |
| 85 | + Grid cell width |
| 86 | + </label> |
96 | 87 | <InputWithUnit unit="px"> |
97 | 88 | <input |
98 | | - id="grid-cell-height" |
| 89 | + id="grid-cell-width" |
99 | 90 | type="text" |
100 | 91 | inputMode="numeric" |
101 | 92 | pattern="[0-9]*" |
102 | 93 | title="Use 1 or a bigger integer number of pixels" |
103 | | - bind:value={grid.cell.height} |
| 94 | + bind:value={grid.cell.width} |
104 | 95 | /> |
105 | 96 | </InputWithUnit> |
106 | | - {:else} |
107 | | - <InputWithUnit unit="px" disabled> |
108 | | - <input id="grid-cell-height" type="text" value={grid.cell.width} disabled /> |
109 | | - </InputWithUnit> |
110 | | - {/if} |
111 | | - </FormField> |
| 97 | + </FormField> |
112 | 98 |
|
113 | | - <FormField> |
114 | | - <label for="grid-cell-scale"> |
115 | | - <MaterialSymbolsBackToTabRounded class="size-4 -scale-x-100" /> |
116 | | - Grid cell scale |
117 | | - </label> |
118 | | - <InputWithUnit unit="x"> |
119 | | - <input |
120 | | - id="grid-cell-scale" |
121 | | - type="text" |
122 | | - inputMode="numeric" |
123 | | - pattern="[0-9]*" |
124 | | - title="Use 1 or a bigger integer number for scaling" |
125 | | - bind:value={grid.cell.scale} |
126 | | - /> |
127 | | - </InputWithUnit> |
128 | | - </FormField> |
| 99 | + <FormField> |
| 100 | + <label for="grid-cell-height"> |
| 101 | + <MaterialSymbolsExpandRounded class="size-4" /> |
| 102 | + Grid cell height |
| 103 | + </label> |
| 104 | + {#if grid.cell.shape === 'rectangle'} |
| 105 | + <InputWithUnit unit="px"> |
| 106 | + <input |
| 107 | + id="grid-cell-height" |
| 108 | + type="text" |
| 109 | + inputMode="numeric" |
| 110 | + pattern="[0-9]*" |
| 111 | + title="Use 1 or a bigger integer number of pixels" |
| 112 | + bind:value={grid.cell.height} |
| 113 | + /> |
| 114 | + </InputWithUnit> |
| 115 | + {:else} |
| 116 | + <InputWithUnit unit="px" disabled> |
| 117 | + <input id="grid-cell-height" type="text" value={grid.cell.width} disabled /> |
| 118 | + </InputWithUnit> |
| 119 | + {/if} |
| 120 | + </FormField> |
129 | 121 |
|
130 | | - <FormField> |
131 | | - <label for="grid-cell-corner-radius"> |
132 | | - <MaterialSymbolsRoundedCornerRounded class="size-4" /> |
133 | | - Grid cell corner radius |
134 | | - </label> |
135 | | - <InputWithUnit unit="px"> |
136 | | - <input |
137 | | - id="grid-cell-corner-radius" |
138 | | - type="text" |
139 | | - inputMode="numeric" |
140 | | - pattern="[0-9]*" |
141 | | - title="Use 0 or a bigger integer number of pixels" |
142 | | - bind:value={grid.cell.cornerRadius} |
143 | | - /> |
144 | | - </InputWithUnit> |
145 | | - </FormField> |
| 122 | + <FormField> |
| 123 | + <label for="grid-cell-scale"> |
| 124 | + <MaterialSymbolsBackToTabRounded class="size-4 -scale-x-100" /> |
| 125 | + Grid cell scale |
| 126 | + </label> |
| 127 | + <InputWithUnit unit="x"> |
| 128 | + <input |
| 129 | + id="grid-cell-scale" |
| 130 | + type="text" |
| 131 | + inputMode="numeric" |
| 132 | + pattern="[0-9]*" |
| 133 | + title="Use 1 or a bigger integer number for scaling" |
| 134 | + bind:value={grid.cell.scale} |
| 135 | + /> |
| 136 | + </InputWithUnit> |
| 137 | + </FormField> |
| 138 | + |
| 139 | + <FormField> |
| 140 | + <label for="grid-cell-corner-radius"> |
| 141 | + <MaterialSymbolsRoundedCornerRounded class="size-4" /> |
| 142 | + Grid cell corner radius |
| 143 | + </label> |
| 144 | + <InputWithUnit unit="px"> |
| 145 | + <input |
| 146 | + id="grid-cell-corner-radius" |
| 147 | + type="text" |
| 148 | + inputMode="numeric" |
| 149 | + pattern="[0-9]*" |
| 150 | + title="Use 0 or a bigger integer number of pixels" |
| 151 | + bind:value={grid.cell.cornerRadius} |
| 152 | + /> |
| 153 | + </InputWithUnit> |
| 154 | + </FormField> |
| 155 | + {/if} |
146 | 156 | </OptsCard> |
0 commit comments