|
20 | 20 | class="icon-button"
|
21 | 21 | title="reset to default"
|
22 | 22 | on:click|preventDefault={() => {
|
| 23 | + $preferences.darkMode = defaultPreferences.darkMode; |
23 | 24 | $preferences.ambienceVolume = defaultPreferences.ambienceVolume;
|
24 | 25 | $preferences.speechVolume = defaultPreferences.speechVolume;
|
25 | 26 | }}
|
|
28 | 29 | </button>
|
29 | 30 | </div>
|
30 | 31 | <div class="box">
|
| 32 | + <!-- dark mode toggle --> |
| 33 | + <div class="row"> |
| 34 | + <label for="darkMode">dark mode</label> |
| 35 | + <input type="checkbox" title="toggle dark mode" bind:checked={$preferences.darkMode} /> |
| 36 | + </div> |
31 | 37 | <div class="row">
|
32 | 38 | <label for="ambienceVolume">ambience volume</label>
|
33 | 39 | <input
|
|
40 | 46 | bind:value={$preferences.ambienceVolume}
|
41 | 47 | />
|
42 | 48 | </div>
|
43 |
| - |
44 | 49 | <div class="row">
|
45 | 50 | <label for="speechVolume">speech volume</label>
|
46 | 51 | <input
|
|
82 | 87 | display: flex;
|
83 | 88 | flex-direction: column;
|
84 | 89 | gap: 1.5rem;
|
| 90 | + backdrop-filter: blur(6px); |
85 | 91 | }
|
86 | 92 |
|
87 | 93 | .row {
|
88 | 94 | display: flex;
|
89 | 95 | align-items: center;
|
90 |
| - gap: 1rem; |
| 96 | + gap: 2rem; |
| 97 | + justify-content: space-between; |
91 | 98 | }
|
92 | 99 |
|
93 | 100 | label {
|
94 |
| - width: 20rem; |
| 101 | + max-width: 10rem; |
95 | 102 | }
|
96 | 103 |
|
97 | 104 | .slider {
|
98 |
| - width: 100%; |
| 105 | + width: 15rem; |
99 | 106 | background: none;
|
100 | 107 | }
|
101 | 108 |
|
| 109 | + /* customize dark mode toggle */ |
| 110 | + input[type='checkbox'] { |
| 111 | + -webkit-appearance: none; |
| 112 | + -moz-appearance: none; |
| 113 | + appearance: none; |
| 114 | + width: 28px; |
| 115 | + height: 14px; |
| 116 | + border-radius: 1rem; |
| 117 | + background-color: var(--bg-3); |
| 118 | + position: relative; |
| 119 | + cursor: pointer; |
| 120 | + transition: background-color 0.3s; |
| 121 | + } |
| 122 | + input[type='checkbox']:before { |
| 123 | + box-sizing: border-box; |
| 124 | + content: ''; |
| 125 | + position: absolute; |
| 126 | + width: 20px; |
| 127 | + height: 20px; |
| 128 | + border: 2px solid var(--txt); |
| 129 | + background-color: var(--bg-3); |
| 130 | + backdrop-filter: blur(3px); |
| 131 | + border-radius: 50%; |
| 132 | + top: -3px; |
| 133 | + left: -3px; |
| 134 | + transition: left 0.3s; |
| 135 | + } |
| 136 | + input[type='checkbox']:checked { |
| 137 | + background-color: var(--txt); |
| 138 | + } |
| 139 | + input[type='checkbox']:checked:before { |
| 140 | + left: 14px; |
| 141 | + } |
| 142 | +
|
102 | 143 | input[type='range'],
|
103 | 144 | ::-webkit-slider-thumb {
|
104 | 145 | -webkit-appearance: none;
|
105 | 146 | }
|
106 | 147 | ::-moz-range-thumb {
|
107 |
| - width: 1rem; |
108 |
| - height: 1rem; |
| 148 | + box-sizing: border-box; |
| 149 | + width: 20px; |
| 150 | + height: 20px; |
109 | 151 | border: 2px solid var(--txt);
|
110 | 152 | background-color: var(--bg-3);
|
111 | 153 | backdrop-filter: blur(3px);
|
112 | 154 | border-radius: 50%;
|
| 155 | +
|
| 156 | + &:hover { |
| 157 | + cursor: pointer; |
| 158 | + } |
113 | 159 | }
|
114 | 160 | ::-webkit-slider-thumb {
|
115 |
| - width: 1rem; |
116 |
| - height: 1rem; |
| 161 | + box-sizing: border-box; |
| 162 | + width: 20px; |
| 163 | + height: 20px; |
117 | 164 | border: 2px solid var(--txt);
|
118 | 165 | background-color: var(--bg-3);
|
119 | 166 | backdrop-filter: blur(3px);
|
120 | 167 | border-radius: 50%;
|
121 | 168 | margin-top: calc(-0.5rem + 1px);
|
| 169 | +
|
| 170 | + &:hover { |
| 171 | + cursor: pointer; |
| 172 | + } |
122 | 173 | }
|
123 | 174 | ::-moz-range-progress {
|
124 | 175 | background-color: var(--txt);
|
125 |
| - height: 2px; |
| 176 | + height: 4px; |
126 | 177 | border-radius: 2px;
|
| 178 | +
|
| 179 | + &:hover { |
| 180 | + cursor: pointer; |
| 181 | + } |
127 | 182 | }
|
128 | 183 | ::-webkit-slider-runnable-track {
|
129 | 184 | background-color: var(--bg-3);
|
130 |
| - height: 2px; |
| 185 | + height: 4px; |
131 | 186 | border-radius: 2px;
|
| 187 | +
|
| 188 | + &:hover { |
| 189 | + cursor: pointer; |
| 190 | + } |
132 | 191 | }
|
133 | 192 | ::-moz-range-track {
|
134 | 193 | background-color: var(--bg-3);
|
135 |
| - height: 2px; |
| 194 | + height: 4px; |
136 | 195 | border-radius: 2px;
|
| 196 | +
|
| 197 | + &:hover { |
| 198 | + cursor: pointer; |
| 199 | + } |
137 | 200 | }
|
138 | 201 | </style>
|
0 commit comments