Compare commits

..

No commits in common. "a06013cd191f52d0811bd72065cd2346f991eb37" and "787a11921edbe8ba8adbe73bab4da1a5131599d3" have entirely different histories.

3 changed files with 28 additions and 11 deletions

View File

@ -1,3 +1,6 @@
/* ===========================
ICON BUTTONS - Enhanced Color
=========================== */
.game-over-buttons {
display: flex;
gap: 16px;
@ -5,6 +8,7 @@
margin-top: 42px;
}
/* Icon Button Base Style */
.btn-game-icon {
width: clamp(70px, 10vw, 80px);
height: clamp(70px, 10vw, 80px);
@ -33,6 +37,7 @@
z-index: 2;
}
/* Shine Effect */
.btn-game-icon::before {
content: "";
position: absolute;
@ -65,6 +70,7 @@
inset 0 2px 8px rgba(0, 0, 0, 0.3);
}
/* Restart Button - EMERALD GREEN */
.btn-restart-game {
background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
border-color: rgba(16, 185, 129, 0.6);
@ -93,6 +99,7 @@
color: #34d399;
}
/* Home Button - SKY BLUE */
.btn-home-game {
background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(2, 132, 199, 0.2));
border-color: rgba(14, 165, 233, 0.6);

View File

@ -1,9 +1,10 @@
/* Floating Particles from Bottom */
.floating-particles {
position: fixed;
inset: 0;
overflow: hidden;
pointer-events: none;
z-index: 0;
z-index: 0; /* Di bawah semua elemen game */
}
.floating-particle {
@ -35,6 +36,7 @@
}
}
/* Different particle colors */
.floating-particle.cyan {
background: rgba(0, 234, 255, 0.7);
box-shadow: 0 0 20px rgba(0, 234, 255, 0.8);

View File

@ -10,13 +10,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
exit();
}
session_start();
include 'Connection.php';
session_start(); // Mulai session (login state)
include 'Connection.php'; // Koneksi database
$input = json_decode(file_get_contents('php://input'), true);
$username = $input['username'] ?? '';
$password = $input['password'] ?? '';
// Ambil Data Login dari Client
$input = json_decode(file_get_contents('php://input'), true); // Ambil body JSON
$username = $input['username'] ?? ''; // Username dari client
$password = $input['password'] ?? ''; // Password dari client
// Cek Username di Database
$stmt = $conn->prepare(
"SELECT id, password FROM users WHERE username = ?"
);
@ -24,6 +26,7 @@ $stmt->bind_param("s", $username);
$stmt->execute();
$stmt->store_result();
// Jika Username Tidak Ada
if ($stmt->num_rows === 0) {
echo json_encode([
"success" => false,
@ -34,29 +37,34 @@ if ($stmt->num_rows === 0) {
exit;
}
$stmt->bind_result($userId, $hashedPassword);
// Ambil Data User
$stmt->bind_result($userId, $hashedPassword); // Ambil id & password hash
$stmt->fetch();
// Cek Password
if (password_verify($password, $hashedPassword)) {
// Simpan data login ke session
$_SESSION['user_id'] = $userId;
$_SESSION['username'] = $username;
// Kirim respon login sukses
echo json_encode([
"success" => true,
"message" => "Login successful",
"username" => $username,
"token" => bin2hex(random_bytes(32))
"token" => bin2hex(random_bytes(32)) // Token acak (bukan JWT)
]);
} else {
// Password salah
echo json_encode([
"success" => false,
"message" => "Incorrect password"
]);
}
$stmt->close();
$conn->close();
$stmt->close(); // Tutup statement
$conn->close(); // Tutup koneksi DB
?>