+ },
+ adjustBoard: function() {
+ const boardContainer = document.getElementById("boardContainer");
+ if (!boardContainer)
+ return; //no board on page
+ const k = document.getElementById("myRange").value;
+ const movesWidth = 280; //TODO: constant somewhere...;
+ const minBoardWidth = 240; //TODO: same
+ // Value of 0 is board min size; 100 is screen.width - movesWidth
+ const boardSize = k * (screen.width - (movesWidth+minBoardWidth)) / 100 + minBoardWidth;
+ localStorage.setItem("boardSize", boardSize);
+ boardContainer.style.width = boardSize + "px";
+ document.getElementById("gameContainer").style.width = (boardSize + movesWidth) + "px";