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 { .game-over-buttons {
display: flex; display: flex;
gap: 16px; gap: 16px;
@ -5,6 +8,7 @@
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);
@ -33,6 +37,7 @@
z-index: 2; z-index: 2;
} }
/* Shine Effect */
.btn-game-icon::before { .btn-game-icon::before {
content: ""; content: "";
position: absolute; position: absolute;
@ -65,6 +70,7 @@
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);
@ -93,6 +99,7 @@
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,9 +1,10 @@
/* 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; z-index: 0; /* Di bawah semua elemen game */
} }
.floating-particle { .floating-particle {
@ -35,6 +36,7 @@
} }
} }
/* 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,13 +10,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
exit(); exit();
} }
session_start(); session_start(); // Mulai session (login state)
include 'Connection.php'; include 'Connection.php'; // Koneksi database
$input = json_decode(file_get_contents('php://input'), true); // Ambil Data Login dari Client
$username = $input['username'] ?? ''; $input = json_decode(file_get_contents('php://input'), true); // Ambil body JSON
$password = $input['password'] ?? ''; $username = $input['username'] ?? ''; // Username dari client
$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 = ?"
); );
@ -24,6 +26,7 @@ $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,
@ -34,29 +37,34 @@ if ($stmt->num_rows === 0) {
exit; exit;
} }
$stmt->bind_result($userId, $hashedPassword); // Ambil Data User
$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" => bin2hex(random_bytes(32)) // Token acak (bukan JWT)
]); ]);
} else { } else {
// Password salah
echo json_encode([ echo json_encode([
"success" => false, "success" => false,
"message" => "Incorrect password" "message" => "Incorrect password"
]); ]);
} }
$stmt->close(); $stmt->close(); // Tutup statement
$conn->close(); $conn->close(); // Tutup koneksi DB
?> ?>