- document.getElementById("boardSize").value =
- (boardSize * 100) / (window.innerWidth - movesWidth);
- window.addEventListener("resize", this.adjustBoard);
- // TODO: find sometjhing better than next height adjustment...
- // maybe each variant could give its ratio (?!)
- setTimeout( () => { this.adjustBoard("vertical"); }, 1000);
+ const minBoardWidth =
+ (window.innerWidth <= 767 || "ontouchstart" in window) ? 160 : 240;
+ document.getElementById("boardSize").value = (boardSize - minBoardWidth) * 100 / (winBound - minBoardWidth);
+ window.addEventListener("resize", () => this.adjustBoard());