From 257a8975067ad8a925ec5a11bfbec7d6946502f1 Mon Sep 17 00:00:00 2001 From: Namonay Date: Mon, 13 May 2024 18:12:23 +0200 Subject: [PATCH] add: tictactoe: mobile support --- frontend/static/js/api/game/tictactoe/TicTacToeGame.js | 10 +++++----- frontend/static/js/views/TicTacToeOnlineView.js | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/static/js/api/game/tictactoe/TicTacToeGame.js b/frontend/static/js/api/game/tictactoe/TicTacToeGame.js index b98416d..26b2751 100644 --- a/frontend/static/js/api/game/tictactoe/TicTacToeGame.js +++ b/frontend/static/js/api/game/tictactoe/TicTacToeGame.js @@ -208,10 +208,10 @@ class TicTacToe { this.context.beginPath(); this.context.strokeStyle = "green"; - this.context.moveTo(targetX + 15, targetY + 15); - this.context.lineTo(targetX + 45, targetY + 45); - this.context.moveTo(targetX + 45, targetY + 15); - this.context.lineTo(targetX + 15, targetY + 45); + this.context.moveTo(targetX + 10, targetY + 10); + this.context.lineTo(targetX + 40, targetY + 40); + this.context.moveTo(targetX + 40, targetY + 10); + this.context.lineTo(targetX + 10, targetY + 40); this.context.stroke(); this.context.closePath(); } @@ -221,7 +221,7 @@ class TicTacToe this.context.strokeStyle = "red"; targetX += this.rectsize / 2; targetY += this.rectsize / 2; - this.context.arc(targetX, targetY, 20, 0, 2 * Math.PI); + this.context.arc(targetX, targetY, 15, 0, 2 * Math.PI); this.context.stroke(); this.context.closePath(); } diff --git a/frontend/static/js/views/TicTacToeOnlineView.js b/frontend/static/js/views/TicTacToeOnlineView.js index 380aff7..5632548 100644 --- a/frontend/static/js/views/TicTacToeOnlineView.js +++ b/frontend/static/js/views/TicTacToeOnlineView.js @@ -10,13 +10,13 @@ export class TicTacToeOnlineView extends AbstractView this.params = params; this.titleKey = titleKey; this.game_id = params.id; - this.height = 560; - this.width = 560; + this.height = 510; + this.width = 510; } async postInit() { - this.Morpion = new TicTacToe(this.height, this.width, 30, 55.5, document.getElementById("Morpion"), this.game_id); + this.Morpion = new TicTacToe(this.height, this.width, 30, 50, document.getElementById("Morpion"), this.game_id); this.Morpion.DrawSuperMorpion(); await this.Morpion.init(); }