3 input#modalSettings.modal(type="checkbox")
4 div(role="dialog" data-checkbox="modalSettings")
5 .card(@change="updateSettings($event)")
6 label.modal-close(for="modalSettings")
9 label(for="setHints") {{ st.tr["Show possible moves?"] }}
10 input#setHints(type="checkbox" v-model="st.settings.hints")
12 label(for="setHighlight")
13 | {{ st.tr["Highlight last move and checks?"] }}
14 input#setHighlight(type="checkbox" v-model="st.settings.highlight")
16 label(for="setBcolor") {{ st.tr["Board colors"] }}
17 select#setBcolor(v-model="st.settings.bcolor")
18 option(value="lichess") {{ st.tr["brown"] }}
19 option(value="chesscom") {{ st.tr["green"] }}
20 option(value="chesstempo") {{ st.tr["blue"] }}
22 label(for="setSound") {{ st.tr["Play sounds?"] }}
23 select#setSound(v-model="st.settings.sound")
24 option(value="0") {{ st.tr["None"] }}
25 option(value="1") {{ st.tr["New game"] }}
26 option(value="2") {{ st.tr["All"] }}
30 import { store } from "@/store.js";
39 updateSettings: function(event) {
40 const propName = event.target.id
42 .replace(/^\w/, c => c.toLowerCase());
43 let value = ["bcolor", "sound"].includes(propName)
45 : event.target.checked;
46 if (propName == "sound") value = parseInt(value);
47 store.updateSetting(propName, value);
53 <style lang="sass" scoped>
54 [type="checkbox"].modal+div .card