|
1 | 1 | @props(['calendar' => null]) |
2 | 2 |
|
3 | 3 | <div class='row bold-text'> |
4 | | - <div class="col"> |
5 | | - New moon: |
6 | | - </div> |
| 4 | + <div class="col"> |
| 5 | + New moon: |
| 6 | + </div> |
7 | 7 | </div> |
8 | 8 |
|
9 | 9 | <div class='add_inputs moon'> |
10 | | - <div class='row no-gutters'> |
11 | | - <input type='text' |
12 | | - class='form-control name protip mb-1' |
13 | | - data-pt-position="top" |
14 | | - data-pt-title="The moon's name." |
15 | | - id='moon_name_input' |
16 | | - placeholder='Moon name' x-model="name"> |
17 | | - <div class='input-group'> |
| 10 | + <div class='row no-gutters'> |
| 11 | + <input type='text' |
| 12 | + class='form-control name protip mb-1' |
| 13 | + data-pt-position="top" |
| 14 | + data-pt-title="The moon's name." |
| 15 | + id='moon_name_input' |
| 16 | + placeholder='Moon name' x-model="name"> |
| 17 | + <div class='input-group'> |
18 | 18 |
|
19 | | - <input type='number' |
20 | | - class='form-control cycle protip' |
21 | | - data-pt-position="top" |
22 | | - data-pt-title='How many days it takes for this moon go from Full Moon to the next Full Moon.' |
23 | | - min='1' |
24 | | - id='moon_cycle_input' |
25 | | - placeholder='Cycle' x-model="cycle"> |
| 19 | + <input type='number' |
| 20 | + class='form-control cycle protip' |
| 21 | + data-pt-position="top" |
| 22 | + data-pt-title='How many days it takes for this moon go from Full Moon to the next Full Moon.' |
| 23 | + min='1' |
| 24 | + id='moon_cycle_input' |
| 25 | + placeholder='Cycle' x-model="cycle"> |
26 | 26 |
|
27 | | - <input type='number' |
28 | | - class='form-control shift protip' |
29 | | - data-pt-position="top" |
30 | | - data-pt-title='This is how many days the cycle is offset by.' |
31 | | - id='moon_shift_input' |
32 | | - placeholder='Shift' x-model="shift"> |
| 27 | + <input type='number' |
| 28 | + class='form-control shift protip' |
| 29 | + data-pt-position="top" |
| 30 | + data-pt-title='This is how many days the cycle is offset by.' |
| 31 | + id='moon_shift_input' |
| 32 | + placeholder='Shift' x-model="shift"> |
33 | 33 |
|
34 | | - <div class='input-group-append'> |
35 | | - <button type='button' class='btn btn-primary add' @click="addMoon"> |
36 | | - <i class="fa fa-plus"></i> |
37 | | - </button> |
38 | | - </div> |
39 | | - </div> |
40 | | - </div> |
| 34 | + <div class='input-group-append'> |
| 35 | + <button type='button' class='btn btn-primary add' @click="addMoon"> |
| 36 | + <i class="fa fa-plus"></i> |
| 37 | + </button> |
| 38 | + </div> |
| 39 | + </div> |
| 40 | + </div> |
41 | 41 | </div> |
42 | 42 |
|
43 | | -<div> |
44 | | - <template x-for="(moon, index) in moons"> |
45 | | - <div class='sortable-container list-group-item moon_inputs expanded'> |
46 | | - <div class='main-container'> |
47 | | - <div class='name-container'> |
48 | | - <input type='text' class='form-control name-input small-input' x-model.lazy="moon.name"/> |
49 | | - </div> |
50 | | - <div class="remove-spacer"></div> |
51 | | - </div> |
52 | | - <div class='remove-container'> |
53 | | - <div class='remove-container-text'>Are you sure you want to remove this?</div> |
54 | | - <div class='btn_remove btn btn-danger fa fa-trash'></div> |
55 | | - <div class='btn_cancel btn btn-danger fa fa-xmark'></div> |
56 | | - <div class='btn_accept btn btn-success fa fa-check'></div> |
57 | | - </div> |
58 | | - <div class='collapse-container container mb-2'> |
59 | | - <div class='row no-gutters my-1'> |
60 | | - <div class='form-check col-12 py-2 border rounded'> |
61 | | - <input type='checkbox' :id="`${index}_custom_phase_moon`" class='form-check-input' |
62 | | - :checked="moon.custom_phase" @change="customPhaseChanged(moon)"/> |
63 | | - <label :for="`${index}_custom_phase_moon`" class='form-check-label ml-1'> |
64 | | - Custom phase count |
65 | | - </label> |
66 | | - </div> |
67 | | - </div> |
68 | | - <div x-show="!moon.custom_phase"> |
69 | | - <div class='row no-gutters my-1'> |
70 | | - <div class='col-7'>Cycle:</div> |
71 | | - <div class='col-5'>Shift:</div> |
72 | | - </div> |
73 | | - <div class='row no-gutters mb-1'> |
74 | | - <div class='col-7 pr-1'> |
75 | | - <input type='number' min='1' step="any" class='form-control protip' data-pt-position="top" data-pt-title='How many days it takes for this moon go from Full Moon to the next Full Moon.' x-model="moon.cycle"/> |
| 43 | +<div class="list-group"> |
| 44 | + <template x-for="(moon, index) in moons"> |
| 45 | + <div class="list-group-item p-2 first-of-type:rounded-t"> |
| 46 | + <div class='flex items-center w-full gap-x-2' x-show="deleting !== index"> |
| 47 | + <input type='text' class='form-control' x-model.lazy="moon.name"/> |
| 48 | + <button class="btn btn-danger w-10" @click="deleting = index"> |
| 49 | + <i class="fa fa-trash text-lg"></i> |
| 50 | + </button> |
76 | 51 | </div> |
77 | | - <div class='col-5 pl-1'> |
78 | | - <input type='number' step="any" class='form-control protip' data-pt-position="top" data-pt-title='This is how many days the cycle is offset by.' x-model='moon.shift'/> |
| 52 | + |
| 53 | + <div x-show="deleting === index" class="flex items-center w-full gap-x-2.5" x-cloak> |
| 54 | + <button class="btn btn-success w-10 !px-0 text-center" @click="removeMoon(index)"> |
| 55 | + <i class="fa fa-check text-lg"></i> |
| 56 | + </button> |
| 57 | + |
| 58 | + <div class="flex-grow">Are you sure?</div> |
| 59 | + |
| 60 | + <button class="btn btn-danger w-10 !px-0 text-center" @click="deleting = -1"> |
| 61 | + <i class="fa fa-times text-lg"></i> |
| 62 | + </button> |
79 | 63 | </div> |
80 | | - </div> |
81 | | - <div class='row no-gutters mb-1'> |
82 | | - <select class='form-control protip' data-pt-position="top" data-pt-title='This determines the way this moon calculates its phases, as in which way it rounds the phase value to the closest sprite.' x-model='moon.cycle_rounding'> |
83 | | - <option value='floor'>Floor (0.7 becomes 0.0)</option> |
84 | | - <option value='round'>Round (< 0.49 becomes 0.0, 0.5 > becomes 1.0)</option> |
85 | | - <option value='ceil'>Ceiling (0.3 becomes 1.0)</option> |
86 | | - </select> |
87 | | - </div> |
88 | | - </div> |
89 | | - <div class='row no-gutters' x-show="moon.custom_phase"> |
90 | | - <div class='col'> |
91 | | - <div class='my-1'>Custom phase:</div> |
92 | | - <div class='input-group my-1'> |
93 | | - <div class='input-group-prepend'> |
94 | | - <button type='button' class='btn btn-sm btn-danger' @click="shiftCustomCycle(moon, -1)"><</button> |
95 | | - </div> |
96 | | - <input type='text' class='form-control form-control-sm' :value='moon.custom_cycle' @change="customCycleChanged(moon, $event)"/> |
97 | | - <div class='input-group-append'> |
98 | | - <button type='button' class='btn btn-sm btn-success' @click="shiftCustomCycle(moon, 1)">></button> |
99 | | - </div> |
| 64 | + |
| 65 | + <div x-show="deleting !== index"> |
| 66 | + <div class='row no-gutters my-1'> |
| 67 | + <div class='form-check col-12 py-2 border rounded'> |
| 68 | + <input type='checkbox' :id="`${index}_custom_phase_moon`" class='form-check-input' |
| 69 | + :checked="moon.custom_phase" @change="customPhaseChanged(moon)"/> |
| 70 | + <label :for="`${index}_custom_phase_moon`" class='form-check-label ml-1'> |
| 71 | + Custom phase count |
| 72 | + </label> |
| 73 | + </div> |
| 74 | + </div> |
| 75 | + <div x-show="!moon.custom_phase"> |
| 76 | + <div class='row no-gutters my-1'> |
| 77 | + <div class='col-7'>Cycle:</div> |
| 78 | + <div class='col-5'>Shift:</div> |
| 79 | + </div> |
| 80 | + <div class='row no-gutters mb-1'> |
| 81 | + <div class='col-7 pr-1'> |
| 82 | + <input type='number' min='1' step="any" class='form-control protip' data-pt-position="top" |
| 83 | + data-pt-title='How many days it takes for this moon go from Full Moon to the next Full Moon.' |
| 84 | + x-model="moon.cycle"/> |
| 85 | + </div> |
| 86 | + <div class='col-5 pl-1'> |
| 87 | + <input type='number' step="any" class='form-control protip' data-pt-position="top" |
| 88 | + data-pt-title='This is how many days the cycle is offset by.' x-model='moon.shift'/> |
| 89 | + </div> |
| 90 | + </div> |
| 91 | + <div class='row no-gutters mb-1'> |
| 92 | + <select class='form-control protip' data-pt-position="top" |
| 93 | + data-pt-title='This determines the way this moon calculates its phases, as in which way it rounds the phase value to the closest sprite.' |
| 94 | + x-model='moon.cycle_rounding'> |
| 95 | + <option value='floor'>Floor (0.7 becomes 0.0)</option> |
| 96 | + <option value='round'>Round (< 0.49 becomes 0.0, 0.5 > becomes 1.0)</option> |
| 97 | + <option value='ceil'>Ceiling (0.3 becomes 1.0)</option> |
| 98 | + </select> |
| 99 | + </div> |
| 100 | + </div> |
| 101 | + <div class='row no-gutters' x-show="moon.custom_phase"> |
| 102 | + <div class='col'> |
| 103 | + <div class='my-1'>Custom phase:</div> |
| 104 | + <div class='input-group my-1'> |
| 105 | + <div class='input-group-prepend'> |
| 106 | + <button type='button' class='btn btn-sm btn-danger' @click="shiftCustomCycle(moon, -1)"> |
| 107 | + < |
| 108 | + </button> |
| 109 | + </div> |
| 110 | + <input type='text' class='form-control form-control-sm' :value='moon.custom_cycle' |
| 111 | + @change="customCycleChanged(moon, $event)"/> |
| 112 | + <div class='input-group-append'> |
| 113 | + <button type='button' class='btn btn-sm btn-success' @click="shiftCustomCycle(moon, 1)"> |
| 114 | + > |
| 115 | + </button> |
| 116 | + </div> |
| 117 | + </div> |
| 118 | + <div class='italics-text small-text my-1' :class="{ 'invalid': !!getCustomCycleErrorMsg(moon) }" |
| 119 | + :error_msg="getCustomCycleErrorMsg(moon)" x-text="getCustomCycleMessage(moon)"></div> |
| 120 | + </div> |
| 121 | + </div> |
| 122 | + <div class='row no-gutters my-2'> |
| 123 | + <div class='col'> |
| 124 | + <div class='separator'></div> |
| 125 | + </div> |
| 126 | + </div> |
| 127 | + <div class='row no-gutters mt-1'> |
| 128 | + <div class='col-6'>Moon color:</div> |
| 129 | + <div class='col-6'>Shadow color:</div> |
| 130 | + </div> |
| 131 | + <div class='row no-gutters mb-1'> |
| 132 | + <div class='col-6 pr-1'> |
| 133 | + <input type='color' x-model.lazy='moon.color'/> |
| 134 | + </div> |
| 135 | + <div class='col-6 pl-1'> |
| 136 | + <input type='color' x-model.lazy='moon.shadow_color'/> |
| 137 | + </div> |
| 138 | + </div> |
| 139 | + <div class='row no-gutters my-1'> |
| 140 | + <div class='form-check col-12 py-2 border rounded'> |
| 141 | + <input type='checkbox' :id='`${index}_hidden_moon`' class='form-check-input' |
| 142 | + x-model='moon.hidden'/> |
| 143 | + <label :for='`${index}_hidden_moon`' class='form-check-label ml-1'> |
| 144 | + Hide from guest viewers |
| 145 | + </label> |
| 146 | + </div> |
| 147 | + </div> |
100 | 148 | </div> |
101 | | - <div class='italics-text small-text my-1' :class="{ 'invalid': !!getCustomCycleErrorMsg(moon) }" |
102 | | - :error_msg="getCustomCycleErrorMsg(moon)" x-text="getCustomCycleMessage(moon)"></div> |
103 | | - </div> |
104 | | - </div> |
105 | | - <div class='row no-gutters my-2'> |
106 | | - <div class='col'> |
107 | | - <div class='separator'></div> |
108 | | - </div> |
109 | 149 | </div> |
110 | | - <div class='row no-gutters mt-1'> |
111 | | - <div class='col-6'>Moon color:</div> |
112 | | - <div class='col-6'>Shadow color:</div> |
113 | | - </div> |
114 | | - <div class='row no-gutters mb-1'> |
115 | | - <div class='col-6 pr-1'> |
116 | | - <input type='color' x-model.lazy='moon.color'/> |
117 | | - </div> |
118 | | - <div class='col-6 pl-1'> |
119 | | - <input type='color' x-model.lazy='moon.shadow_color'/> |
120 | | - </div> |
121 | | - </div> |
122 | | - <div class='row no-gutters my-1'> |
123 | | - <div class='form-check col-12 py-2 border rounded'> |
124 | | - <input type='checkbox' :id='`${index}_hidden_moon`' class='form-check-input' x-model='moon.hidden'/> |
125 | | - <label :for='`${index}_hidden_moon`' class='form-check-label ml-1'> |
126 | | - Hide from guest viewers |
127 | | - </label> |
128 | | - </div> |
129 | | - </div> |
130 | | - </div> |
131 | | - </div> |
132 | | - </template> |
| 150 | + </template> |
133 | 151 | </div> |
0 commit comments