- fix responsive for bar/gaol selector in lobby page
This commit is contained in:
Kum1ta
2024-10-13 13:49:43 +02:00
parent bb23e5d81a
commit d6fdd6fbc7
2 changed files with 15 additions and 3 deletions

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/13 13:59:46 by edbernar #+# #+# */
/* Updated: 2024/10/12 17:15:26 by edbernar ### ########.fr */
/* Updated: 2024/10/13 13:44:43 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */
@ -90,6 +90,12 @@ class barSelecter
popup.removeEventListener('click', this.hideSkinSelector);
popup.addEventListener('click', this.hideSkinSelector);
});
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();
});
}
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()

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/01 13:42:29 by edbernar #+# #+# */
/* Updated: 2024/10/10 12:57:56 by edbernar ### ########.fr */
/* Updated: 2024/10/12 23:26:19 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */
@ -123,6 +123,7 @@ class TournamentPage
while (i < playerNb.length - 1)
{
playerList['player' + playerNb[i]] = playerList['player' + playerNb[i + 1]];
playerList['player' + playerNb[i]].id--;
document.getElementById('user-' + playerNb[i]).innerText = playerList['player' + playerNb[i]].username;
document.getElementById('pfp-' + playerNb[i]).style.backgroundImage = `url(${playerList['player' + playerNb[i]].pfp})`;
i++;