This commit is contained in:
Evelyn Sucitro 2025-12-17 20:51:42 +07:00
parent 4bbb1c2770
commit 34ccdb4b98
3 changed files with 11 additions and 28 deletions

View File

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

View File

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

View File

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