settings arrangement

This commit is contained in:
Adrien MALINGREY 2023-04-26 00:06:07 +02:00
parent c774cc25fc
commit de9c72f760
2 changed files with 14 additions and 14 deletions

15
app.js
View File

@ -398,19 +398,20 @@ class Settings {
} }
load() { load() {
for (let input of this.form.getElementsByTagName("input")) { for (let element of settingsForm.elements) {
if (localStorage[input.name]) input.value = localStorage[input.name] if (element.name) {
if (localStorage[element.name]) element.value = localStorage[element.name]
}
} }
if (localStorage["stylesheet"]) stylesheetSelect.value = localStorage["stylesheet"]
document.selectedStyleSheetSet = stylesheetSelect.value document.selectedStyleSheetSet = stylesheetSelect.value
} }
save() { save() {
for (let input of this.form.getElementsByTagName("input")) { for (let element of settingsForm.elements) {
localStorage[input.name] = input.value if (element.name) {
localStorage[element.name] = element.value
}
} }
localStorage["stylesheet"] = stylesheetSelect.value
} }
init() { init() {

View File

@ -96,14 +96,13 @@
</div> </div>
<label for="dasInput" class="col-sm-2 col-form-label" title="Delayed AutoShift : délai initial avant répétition">DAS</label> <label for="dasInput" class="col-sm-2 col-form-label" title="Delayed AutoShift : délai initial avant répétition">DAS</label>
</fieldset> </fieldset>
<fieldset class="row g-2 mb-3 align-items-center text-center"> <fieldset class="row g-2 mb-3 align-items-center text-center justify-content-center">
<legend class="text-start">Feuille de style</legend> <legend class="text-start">Thème</legend>
<label for="stylesheetSelect" class="col-sm-2 col-form-label text-center">Style</label> <div class="col-sm-8">
<div class="col-sm-4">
<select name="stylesheet" id="stylesheetSelect" class="form-select" onclick="document.selectedStyleSheetSet=this.value"> <select name="stylesheet" id="stylesheetSelect" class="form-select" onclick="document.selectedStyleSheetSet=this.value">
<option selected>Classique</option> <option selected>Classique</option>
<option>Électro</option>
<option>Pop</option> <option>Pop</option>
<option>Électro</option>
<option>Rétro</option> <option>Rétro</option>
</select> </select>
</div> </div>
@ -228,8 +227,8 @@
<tr><th>Score</th> <td id="statsModalScoreCell"></td> <th>Niveau</th> <td id="statsModalLevelCell"></td> </tr> <tr><th>Score</th> <td id="statsModalScoreCell"></td> <th>Niveau</th> <td id="statsModalLevelCell"></td> </tr>
<tr><th>Meilleur score</th> <td id="statsModalHighScoreCell"></td> <th>Temps</th> <td id="statsModalTimeCell"></td> </tr> <tr><th>Meilleur score</th> <td id="statsModalHighScoreCell"></td> <th>Temps</th> <td id="statsModalTimeCell"></td> </tr>
<tr><th>Lignes</th> <td id="statsModaltotalClearedLines"></td> <th>Lignes par minutes</th> <td id="statsModaltotalClearedLinesPM"></td> </tr> <tr><th>Lignes</th> <td id="statsModaltotalClearedLines"></td> <th>Lignes par minutes</th> <td id="statsModaltotalClearedLinesPM"></td> </tr>
<tr><th>Quatris</th> <td id="statsModalNbQuatris"></td> <th>Pirouettes</th> <td id="statsModalNbTSpin"></td> </tr> <tr><th>Quatris</th> <td id="statsModalNbQuatris"></td> <th>Plus grand enchaînement</th> <td id="statsModalMaxCombo"></td> </tr>
<tr><th>Plus grand enchaînement</th> <td id="statsModalMaxCombo"></td> <th>Plus grand bout à bout</th> <td id="statsModalMaxB2B"></td> </tr> <tr><th>Pirouettes</th> <td id="statsModalNbTSpin"></td> <th>Plus grand bout à bout</th> <td id="statsModalMaxB2B"></td> </tr>
</table> </table>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">