- localStorage[propName] = ["highlight","coords"].includes(propName)
- ? event.target.checked
- : event.target.value;
- },
- adjustBoard: function() {
- const boardContainer = document.getElementById("boardContainer");
- if (!boardContainer)
- return; //no board on page
- const k = document.getElementById("myRange").value;
- const movesWidth = (window.innerWidth >= 768 ? 280 : 0);
- const minBoardWidth = 240; //TODO: these 240 and 280 are arbitrary...
- // Value of 0 is board min size; 100 is window.width [- movesWidth]
- const boardSize = minBoardWidth +
- k * (window.innerWidth - (movesWidth+minBoardWidth)) / 100;
- localStorage.setItem("boardSize", boardSize);
- boardContainer.style.width = boardSize + "px";
- document.getElementById("gameContainer").style.width =
- (boardSize + movesWidth) + "px";
+ localStorage[propName] = ["bcolor","sound"].includes(propName)
+ ? event.target.value
+ : event.target.checked;