feat: fix ui leaderboard

This commit is contained in:
Matthew Florentino 2025-12-02 10:49:18 +07:00
parent 4e50ae9f5a
commit b5672b2326
2 changed files with 29 additions and 22 deletions

View File

@ -190,14 +190,12 @@
width: 300px; width: 300px;
image-rendering: pixelated; image-rendering: pixelated;
margin: 20px; margin: 20px;
margin-top: 160px;
} }
.container-board .menu { .container-board .menu {
margin: 0 auto; margin: 0 auto;
border-radius: 6px; border-radius: 6px;
width: 400px; width: 400px;
border: 5px solid;
height: 40px; height: 40px;
align-content: center; align-content: center;
} }
@ -231,14 +229,28 @@ td {
} }
.container-board .board table tbody tr { .container-board .board table {
background: #0b0e00bd; background: #0b0e00f3;
} }
.container-board .board table tbody tr:hover { .container-board .board table tbody tr:hover {
background: #c1fc0032; background: #c1fc0032;
} }
.container-board .back {
color: #ffff009a;
text-decoration: none;
font-size: 30px;
position: absolute;
z-index: 99999;
left: 2%;
top: 5%;
}
.container-board .back:hover {
color: yellow;
}
.container-onboard { .container-onboard {
display: flex; display: flex;
width: 100%; width: 100%;

View File

@ -1,7 +1,4 @@
<?php <?php
use LDAP\Result;
session_start(); session_start();
require_once "config/db.php"; require_once "config/db.php";
@ -20,10 +17,6 @@ if ($result_me && mysqli_num_rows($result_me)>0){
$score = $row['score']; $score = $row['score'];
} }
$queryrank = "SELECT COUNT(*) as ranking FROM users WHERE score > $score";
$resultrank = mysqli_query($db, $queryrank);
$rowrank = mysqli_fetch_assoc($resultrank);
$realrank = $rowrank['ranking']+1;
$result = mysqli_query($db, $sql); $result = mysqli_query($db, $sql);
$leaderboard = []; $leaderboard = [];
@ -46,12 +39,10 @@ if($result){
</head> </head>
<body> <body>
<div class="container-board"> <div class="container-board">
<a class="back" href="onboard.php" data-aos="fade-in" data-aos-duration="3000"></a>
<div class="chara"> <div class="chara">
<div class="menu">
<h1 style="text-align: center;"><?php echo $nama; ?></h1>
</div>
<h1 style="text-align: center;"> <?php echo $score; ?> </h1>
<div class="character"> <div class="character">
<h1 style="text-align: center; padding-right: 45px; color: yellow;">Knight</h1>
<img src="/assets/Design/KnightPixLE2-exporgift.gif" alt="knight"> <img src="/assets/Design/KnightPixLE2-exporgift.gif" alt="knight">
</div> </div>
</div> </div>
@ -87,15 +78,19 @@ if($result){
?> ?>
</tbody> </tbody>
<tbody> <tbody>
<?php
$peringkat = 1;
?>
</tbody> </tbody>
</table> </table>
<table > <table>
<tbody > <tbody>
<tr > <tr>
<td style="color: gold; font-weight: bold; border: 5px solid #bbd000;;" ><?php echo $realrank; ?></td> <td><?php echo $peringkat; ?></td>
<td style="color: gold; font-weight: bold; border: 5px solid #bbd000;;"><?php echo $nama; ?></td> <td><?php echo $nama; ?></td>
<td style="color: gold; font-weight: bold; border: 5px solid #bbd000;;"><?php echo $score; ?> PTS</td> <td><?php echo $pemain['score']; ?> PTS</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>