From 34ccdb4b9888536fdb6ce71373a7aede304daf5b Mon Sep 17 00:00:00 2001 From: Evelyn Sucitro Date: Wed, 17 Dec 2025 20:51:42 +0700 Subject: [PATCH] Update --- 2048_Button.css | 7 ------- 2048_Floating_Particles.css | 4 +--- Login.php | 28 ++++++++++------------------ 3 files changed, 11 insertions(+), 28 deletions(-) diff --git a/2048_Button.css b/2048_Button.css index 8cc891e..56f13c7 100644 --- a/2048_Button.css +++ b/2048_Button.css @@ -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); diff --git a/2048_Floating_Particles.css b/2048_Floating_Particles.css index e808223..03ea6df 100644 --- a/2048_Floating_Particles.css +++ b/2048_Floating_Particles.css @@ -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); diff --git a/Login.php b/Login.php index 63f4a75..85a4831 100644 --- a/Login.php +++ b/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(); +?> \ No newline at end of file