Update
This commit is contained in:
parent
4bbb1c2770
commit
34ccdb4b98
@ -1,6 +1,3 @@
|
||||
/* ===========================
|
||||
ICON BUTTONS - Enhanced Color
|
||||
=========================== */
|
||||
.game-over-buttons {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
@ -8,7 +5,6 @@
|
||||
margin-top: 42px;
|
||||
}
|
||||
|
||||
/* Icon Button Base Style */
|
||||
.btn-game-icon {
|
||||
width: clamp(70px, 10vw, 80px);
|
||||
height: clamp(70px, 10vw, 80px);
|
||||
@ -37,7 +33,6 @@
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
/* Shine Effect */
|
||||
.btn-game-icon::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
@ -70,7 +65,6 @@
|
||||
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);
|
||||
@ -99,7 +93,6 @@
|
||||
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);
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
/* Floating Particles from Bottom */
|
||||
.floating-particles {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
z-index: 0; /* Di bawah semua elemen game */
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.floating-particle {
|
||||
@ -36,7 +35,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* Different particle colors */
|
||||
.floating-particle.cyan {
|
||||
background: rgba(0, 234, 255, 0.7);
|
||||
box-shadow: 0 0 20px rgba(0, 234, 255, 0.8);
|
||||
|
||||
28
Login.php
28
Login.php
@ -10,15 +10,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
||||
exit();
|
||||
}
|
||||
|
||||
session_start(); // Mulai session (login state)
|
||||
include 'Connection.php'; // Koneksi database
|
||||
session_start();
|
||||
include 'Connection.php';
|
||||
|
||||
// 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
|
||||
$input = json_decode(file_get_contents('php://input'), true);
|
||||
$username = $input['username'] ?? '';
|
||||
$password = $input['password'] ?? '';
|
||||
|
||||
// Cek Username di Database
|
||||
$stmt = $conn->prepare(
|
||||
"SELECT id, password FROM users WHERE username = ?"
|
||||
);
|
||||
@ -26,7 +24,6 @@ $stmt->bind_param("s", $username);
|
||||
$stmt->execute();
|
||||
$stmt->store_result();
|
||||
|
||||
// Jika Username Tidak Ada
|
||||
if ($stmt->num_rows === 0) {
|
||||
echo json_encode([
|
||||
"success" => false,
|
||||
@ -37,34 +34,29 @@ if ($stmt->num_rows === 0) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Ambil Data User
|
||||
$stmt->bind_result($userId, $hashedPassword); // Ambil id & password hash
|
||||
$stmt->bind_result($userId, $hashedPassword);
|
||||
$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 acak (bukan JWT)
|
||||
"token" => bin2hex(random_bytes(32))
|
||||
]);
|
||||
|
||||
} else {
|
||||
|
||||
// Password salah
|
||||
echo json_encode([
|
||||
"success" => false,
|
||||
"message" => "Incorrect password"
|
||||
]);
|
||||
}
|
||||
|
||||
$stmt->close(); // Tutup statement
|
||||
$conn->close(); // Tutup koneksi DB
|
||||
?>
|
||||
$stmt->close();
|
||||
$conn->close();
|
||||
?>
|
||||
Loading…
x
Reference in New Issue
Block a user