From d6fdd6fbc7aba956883fa019308cc59a473b450c Mon Sep 17 00:00:00 2001 From: Kum1ta Date: Sun, 13 Oct 2024 13:49:43 +0200 Subject: [PATCH] Site - fix responsive for bar/gaol selector in lobby page --- .../nginx/static/javascript/lobbyPage/3d.js | 15 +++++++++++++-- .../javascript/tournamentPage/TournamentPage.js | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docker-compose/requirements/nginx/static/javascript/lobbyPage/3d.js b/docker-compose/requirements/nginx/static/javascript/lobbyPage/3d.js index c9aa939..12a711b 100644 --- a/docker-compose/requirements/nginx/static/javascript/lobbyPage/3d.js +++ b/docker-compose/requirements/nginx/static/javascript/lobbyPage/3d.js @@ -6,7 +6,7 @@ /* By: edbernar { + const pos = div.getBoundingClientRect(); + this.renderer.setSize(pos.width - 10, pos.height - 10); + this.camera.aspect = (pos.width - 10) / (pos.height - 10); + this.camera.updateProjectionMatrix(); + }); } hideSkinSelector(event) @@ -214,7 +220,12 @@ class goalSelecter this.renderer.setAnimationLoop(this.#loop.bind(this)); div.removeEventListener('click', this.boundshowGoals); div.addEventListener('click', this.boundshowGoals); - console.warn("gerer le resize pour les bar et goal selector"); + window.addEventListener('resize', () => { + const pos = div.getBoundingClientRect(); + this.renderer.setSize(pos.width - 10, pos.height - 10); + this.camera.aspect = (pos.width - 10) / (pos.height - 10); + this.camera.updateProjectionMatrix(); + }); } showGoals() diff --git a/docker-compose/requirements/nginx/static/javascript/tournamentPage/TournamentPage.js b/docker-compose/requirements/nginx/static/javascript/tournamentPage/TournamentPage.js index b95eac0..b725f2b 100644 --- a/docker-compose/requirements/nginx/static/javascript/tournamentPage/TournamentPage.js +++ b/docker-compose/requirements/nginx/static/javascript/tournamentPage/TournamentPage.js @@ -6,7 +6,7 @@ /* By: edbernar