option(value="0") {{ st.tr["None"] }}
option(value="1") {{ st.tr["New game"] }}
option(value="2") {{ st.tr["All"] }}
+ fieldset
+ .slidecontainer
+ input#myRange.slider(type="range" min="20" max="100" value="60"
+ @input="adjustBoard")
</template>
<script>
return {
st: store.state,
};
+ },
+ mounted: function() {
+ const boardSize = localStorage.getItem("boardSize");
+ if (!!boardSize)
+ document.getElementById("myRange").value = Math.floor(boardSize / 10);
},
methods: {
updateSettings: function(event) {
localStorage[propName] = ["highlight","coords"].includes(propName)
? event.target.checked
: event.target.value;
+ },
+ adjustBoard: function() {
+ const board = document.querySelector(".game");
+ if (!board)
+ return; //no board on page
+ const multiplier = document.getElementById("myRange").value;
+ const boardSize = 10 * multiplier;
+ localStorage.setItem("boardSize", boardSize);
+ board.style.width = boardSize + "px";
},
},
};