- Fix arrow dashboard
    - Fix never played
This commit is contained in:
Misthaa
2024-11-21 13:19:42 +01:00
parent d77872c37a
commit 4e1febb5c3
3 changed files with 16 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 77 KiB

View File

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* main.js :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* By: madegryc <madegryc@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/19 23:08:31 by edbernar #+# #+# */
/* Updated: 2024/11/18 23:53:19 by edbernar ### ########.fr */
/* Updated: 2024/11/21 13:18:52 by madegryc ### ########.fr */
/* */
/* ************************************************************************** */
@ -272,10 +272,12 @@ function buttonDashboard(userInfo)
}
else if (actualPage == 1)
{
const winrate = Math.round((userInfo.nbWin / (userInfo.nbWin + userInfo.nbLoss)) * 100);
let winrate = Math.round((userInfo.nbWin / (userInfo.nbWin + userInfo.nbLoss)) * 100);
if (isNaN(winrate))
winrate = 'Never played';
contentStats.innerHTML = `
<p class="dashboard-line">Winrate<span>${winrate}%</span></p>
<p class="dashboard-line">Winrate<span>${winrate == 'Never played' ? winrate : winrate + '%'}</span></p>
<p class="dashboard-line">Opponent give up rate<span>${userInfo.forfeitRate}%</span></p>
<p class="dashboard-line">Average goal number<span>${userInfo.avgGoals}</span></p>
<p class="dashboard-line">Number of parties (last 30 days)<span>${userInfo.nbGames30Days}</span></p>

View File

@ -267,13 +267,17 @@
}
#profil .dashboard .button-dashboard {
background-color: #aeaeae;
color: white;
border: none;
padding: 10px 20px;
border-radius: 10px;
font-size: 1rem;
color: #020202;
font-size: 2.2rem;
margin: 0;
margin-inline: 30px;
cursor: pointer;
background-color: white;
transform: 0.3s ease;
}
#profil .dashboard .button-dashboard:hover {
transform: scale(1.1);
}
#profil .dashboard .button-dashboard:focus {