- add elo on profile page
This commit is contained in:
Kum1ta
2024-10-29 00:04:08 +01:00
parent 20c603b02e
commit 0184706c3a
2 changed files with 4 additions and 2 deletions

View File

@ -7,7 +7,7 @@
<div class="profile-image"></div> <div class="profile-image"></div>
<div class="profile-info"> <div class="profile-info">
<h2>Username <span class="online-status"></span></h2> <h2>Username <span class="online-status"></span></h2>
<p>150 Elo</p> <p id="player-elo">??? Elo</p>
</div> </div>
<div class="rightButtonDiv"> <div class="rightButtonDiv">
<img id="github" src="/static/img/profilPage/github.png"> <img id="github" src="/static/img/profilPage/github.png">

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */ /* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/19 23:08:31 by edbernar #+# #+# */ /* Created: 2024/09/19 23:08:31 by edbernar #+# #+# */
/* Updated: 2024/10/06 23:50:01 by edbernar ### ########.fr */ /* Updated: 2024/10/28 22:56:32 by edbernar ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -30,6 +30,7 @@ class ProfilPage
const inviteButton = document.getElementById('invite'); const inviteButton = document.getElementById('invite');
const crossProfil = document.getElementById('cross-profil'); const crossProfil = document.getElementById('cross-profil');
let ctx = document.getElementById('stats').getContext('2d'); let ctx = document.getElementById('stats').getContext('2d');
const elo = document.getElementById('player-elo');
let editPenPfpBg = null; let editPenPfpBg = null;
let inputPfp = null; let inputPfp = null;
let editPenBanner = null; let editPenBanner = null;
@ -73,6 +74,7 @@ class ProfilPage
banner.style.backgroundImage = `url("${userInfo.banner}")` banner.style.backgroundImage = `url("${userInfo.banner}")`
banner.style.backgroundSize = "cover"; banner.style.backgroundSize = "cover";
banner.style.backgroundRepeat = "no-repeat"; banner.style.backgroundRepeat = "no-repeat";
elo.innerHTML = `Elo: ${userInfo.elo}`;
externButtons(userInfo); externButtons(userInfo);
createGraph(ctx, {win: userInfo.nbWin, lose: userInfo.nbLoss}); createGraph(ctx, {win: userInfo.nbWin, lose: userInfo.nbLoss});
showHistory(userInfo); showHistory(userInfo);