From c5e5d2f0fc2e5d23d2d0f9d849c7aa0978689bb8 Mon Sep 17 00:00:00 2001 From: Yustina Date: Mon, 24 Nov 2025 14:10:14 +0700 Subject: [PATCH 1/8] fear:revisi login --- login.html | 94 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 66 insertions(+), 28 deletions(-) diff --git a/login.html b/login.html index 2320925..d8ac1d7 100644 --- a/login.html +++ b/login.html @@ -1,34 +1,72 @@ - - - - - - - Halaman Login - - - -
-

Masuk ke Akun Anda

-

Masukkan email dan kata sandi.

+ + + + + + Login Page + + + +
-
-
- - -
+ +
+
+
+
+
+ + +
- + + + + + + + \ No newline at end of file From eec9d78c1aa78d54dbd6420d43cd3b72a706a161 Mon Sep 17 00:00:00 2001 From: Yustina Date: Mon, 24 Nov 2025 14:13:18 +0700 Subject: [PATCH 2/8] fear:login_css --- login.css | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/login.css b/login.css index e69de29..f9b7151 100644 --- a/login.css +++ b/login.css @@ -0,0 +1,94 @@ +body { + font-family: Arial, sans-serif; + background: #f7f6ff; +} + +/* Background animation */ +.bg-animated .bg-circle { + position: absolute; + border-radius: 50%; + filter: blur(60px); + animation: float 6s infinite ease-in-out; +} +.one { top: 20%; left: 10%; width: 180px; height: 180px; background: rgba(255,255,255,0.1); } +.two { bottom: 15%; right: 10%; width: 250px; height: 250px; background: rgba(255,192,203,0.2); animation-delay: 1s; } +.three { top: 50%; left: 50%; width: 160px; height: 160px; background: rgba(200,120,255,0.2); animation-delay: 2s; } + +@keyframes float { + 0%, 100% { transform: translateY(0); } + 50% { transform: translateY(-20px); } +} + +/* Card */ +.login-card { + background: rgba(255,255,255,0.6); + backdrop-filter: blur(15px); + padding: 30px; + max-width: 400px; + width: 100%; + border-radius: 20px; + box-shadow: 0 10px 40px rgba(0,0,0,0.1); + position: relative; + z-index: 10; +} + +/* Icon */ +.icon-wrapper { display: flex; justify-content: center; margin-bottom: 20px; } +.icon-circle { + background: linear-gradient(45deg, purple, hotpink); + padding: 20px; + border-radius: 50%; +} +.login-icon { width: 40px; height: 40px; } + +/* Text */ +.header-text { text-align: center; margin-bottom: 20px; } +.header-text h2 { background: -webkit-linear-gradient(purple, hotpink); + +/* Input */ +input { + width: 100%; + padding: 12px; + margin-bottom: 15px; + border-radius: 10px; + border: 2px solid #ddd; + background: #fafafa; +} + +/* Button */ +.btn-login { + width: 100%; + padding: 12px; + background: linear-gradient(to right, purple, hotpink); + color: white; + border-radius: 12px; + border: none; + cursor: pointer; +} + +/* Error */ +.error { + background: #ffe5e5; + border: 1px solid #ffb2b2; + color: #b00000; + padding: 10px; + border-radius: 10px; + margin-bottom: 10px; + display: none; +} + +/* Demo Box */ +.demo-box { + background: #eef3ff; + padding: 15px; + margin-top: 20px; + border-radius: 15px; + border: 1px solid #d8e0ff; +} +.demo-item { + background: white; + padding: 10px; + margin-top: 10px; + border-radius: 10px; +} +} \ No newline at end of file From 4030decced6baacda5bc11df3fdd33b7e43740c2 Mon Sep 17 00:00:00 2001 From: Yustina Date: Mon, 24 Nov 2025 14:15:36 +0700 Subject: [PATCH 3/8] fear:login_js --- login.js | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 login.js diff --git a/login.js b/login.js new file mode 100644 index 0000000..3b43ed3 --- /dev/null +++ b/login.js @@ -0,0 +1,45 @@ +document.getElementById("loginForm").addEventListener("submit", function(e) { + e.preventDefault(); + + const username = document.getElementById("username").value.trim(); + const password = document.getElementById("password").value.trim(); + const errorBox = document.getElementById("errorBox"); + + errorBox.style.display = "none"; + errorBox.innerText = ""; + + if (!username || !password) { + showError("Username dan password harus diisi"); + return; + } + + if (password.length < 6) { + showError("Password minimal 6 karakter"); + return; + } + + const usersData = localStorage.getItem("users"); + const users = usersData ? JSON.parse(usersData) : []; + + const user = users.find(u => u.username === username); + + if (!user) { + showError("Username tidak ditemukan"); + return; + } + + if (user.password !== password) { + showError("Password salah"); + return; + } + + // Login success + localStorage.setItem("loggedInUser", JSON.stringify(user)); + window.location.href = "mainboard.html"; +}); + +function showError(msg) { + const errorBox = document.getElementById("errorBox"); + errorBox.innerText = msg; + errorBox.style.display = "block"; +} From 7469c53a90de31f142caa0796f62d1cfb414057b Mon Sep 17 00:00:00 2001 From: Yustina Date: Mon, 24 Nov 2025 14:17:20 +0700 Subject: [PATCH 4/8] fear:revisi_login_php --- login.php | 66 ++++++++++++++++++++----------------------------------- 1 file changed, 24 insertions(+), 42 deletions(-) diff --git a/login.php b/login.php index 4832e8c..f181bb7 100644 --- a/login.php +++ b/login.php @@ -1,45 +1,27 @@ ";//kalo di file yang sama - echo "lastname:".$row['lastname']."
"; - } - else echo "Username/password salah"; -} -?> - - -
- Username:
- Password:
- -
- - \ No newline at end of file +$username = $_POST['username']; +$password = $_POST['password']; + +$query = mysqli_query($conn, "SELECT * FROM users WHERE username='$username'"); +$user = mysqli_fetch_assoc($query); + +if (!$user) { + echo json_encode(["status" => "error", "msg" => "Username tidak ditemukan"]); + exit; +} + +if ($user["password"] !== $password) { + echo json_encode(["status" => "error", "msg" => "Password salah"]); + exit; +} + +echo json_encode([ + "status" => "success", + "id" => $user["id"], + "username" => $user["username"], + "email" => $user["email"], + "role" => $user["role"] +]); +?> \ No newline at end of file From 5afb406b3c8021b36b508269cfc6bc8c20ffbee0 Mon Sep 17 00:00:00 2001 From: Yustina Date: Mon, 24 Nov 2025 14:29:33 +0700 Subject: [PATCH 5/8] fear:registe_html --- .vscode/launch.json | 14 ++++ register.css | 163 ++++++++++++++++++++++++++++++++++++++++++++ register.html | 54 +++++++++++++++ 3 files changed, 231 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 register.css create mode 100644 register.html diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..5c2d388 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "Open login.html", + "file": "d:\\SR GIASHINTA\\GAME UAS KEL 2\\Kelompok02-Memory-Card\\login.html" + } + ] +} \ No newline at end of file diff --git a/register.css b/register.css new file mode 100644 index 0000000..4525b5d --- /dev/null +++ b/register.css @@ -0,0 +1,163 @@ +body { + margin: 0; + font-family: Arial, sans-serif; + background: #f7f7ff; +} + +.page { + height: 100vh; + display: flex; + justify-content: center; + align-items: center; + position: relative; +} + +/* Background Animasi */ +.bg-1, .bg-2, .bg-3 { + position: absolute; + border-radius: 50%; + filter: blur(70px); + opacity: 0.4; +} + +.bg-1 { + width: 300px; height: 300px; + background: rgba(255,255,255,0.3); + top: 10%; left: 10%; + animation: glow 4s infinite alternate; +} + +.bg-2 { + width: 400px; height: 400px; + background: rgba(255,120,200,0.3); + bottom: 10%; right: 10%; + animation: float 6s infinite; +} + +.bg-3 { + width: 250px; height: 250px; + background: rgba(200,100,255,0.3); + top: 50%; left: 50%; + transform: translate(-50%, -50%); + animation: glow 5s infinite alternate; +} + +@keyframes glow { + 0% { opacity: 0.2; } + 100% { opacity: 0.55; } +} + +@keyframes float { + 0% { transform: translateY(0); } + 50% { transform: translateY(-20px); } + 100% { transform: translateY(0); } +} + +/* Container */ +.container { + background: rgba(255,255,255,0.7); + backdrop-filter: blur(10px); + padding: 40px; + border-radius: 25px; + width: 350px; + z-index: 10; + box-shadow: 0 10px 28px rgba(0,0,0,0.2); +} + +/* Icon */ +.icon-wrapper { + display: flex; + justify-content: center; + margin-bottom: 20px; +} + +.icon-bg { + width: 90px; height: 90px; + background: linear-gradient(45deg, purple, hotpink); + border-radius: 50%; + filter: blur(12px); + position: absolute; + animation: glow 3s infinite alternate; +} + +.icon { + background: linear-gradient(45deg, purple, hotpink); + border-radius: 50%; + width: 70px; height: 70px; + display: flex; + justify-content: center; + align-items: center; + position: relative; +} + +/* Text */ +.title { + text-align: center; + font-size: 22px; + margin-bottom: 10px; + background: linear-gradient(45deg, purple, hotpink); + color: transparent; +} + +.subtitle { + text-align: center; + color: gray; + margin-bottom: 20px; +} + +/* Form */ +label { + font-size: 14px; + color: #444; +} + +input { + width: 100%; + padding: 12px; + border-radius: 12px; + border: 2px solid #ccc; + background: #fafafa; + margin-bottom: 15px; +} + +input:focus { + outline: none; + border-color: purple; +} + +#errorBox { + color: red; + background: #ffe5e5; + padding: 10px; + border-radius: 10px; + margin-bottom: 10px; + display: none; +} + +/* Button */ +.btn { + width: 100%; + background: linear-gradient(45deg, purple, hotpink); + color: white; + padding: 14px; + border: none; + border-radius: 15px; + font-size: 16px; + cursor: pointer; + transition: 0.2s; +} + +.btn:hover { + transform: scale(1.02); + box-shadow: 0 4px 15px rgba(0,0,0,0.3); +} + +.login-link { + text-align: center; + margin-top: 15px; +} + +.login-link a { + color: purple; + text-decoration: underline; +} diff --git a/register.html b/register.html new file mode 100644 index 0000000..cd3e754 --- /dev/null +++ b/register.html @@ -0,0 +1,54 @@ + + + + + + Register Akun + + + + +
+ +
+
+
+ +
+
+
+
+ +
+
+ +

Buat Akun Baru ✨

+

Daftar untuk bermain Memory Card Game

+ +
+ + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + From 01da6b9330046e1e391e92cd833b3a2c39becf56 Mon Sep 17 00:00:00 2001 From: Yustina Date: Mon, 24 Nov 2025 14:32:29 +0700 Subject: [PATCH 6/8] fear:register_html --- .vscode/launch.json | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 5c2d388..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "type": "chrome", - "request": "launch", - "name": "Open login.html", - "file": "d:\\SR GIASHINTA\\GAME UAS KEL 2\\Kelompok02-Memory-Card\\login.html" - } - ] -} \ No newline at end of file From 6ab1585f40f136b1b5e204c23a2e45dcb4b913a6 Mon Sep 17 00:00:00 2001 From: Yustina Date: Mon, 24 Nov 2025 14:35:15 +0700 Subject: [PATCH 7/8] fear:register_js --- register.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 register.js diff --git a/register.js b/register.js new file mode 100644 index 0000000..e69de29 From 034e71546358d1709edc3df62da8342c7a9fa647 Mon Sep 17 00:00:00 2001 From: Yustina Date: Mon, 24 Nov 2025 14:36:47 +0700 Subject: [PATCH 8/8] fear:register_php --- register.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 register.php diff --git a/register.php b/register.php new file mode 100644 index 0000000..3b20473 --- /dev/null +++ b/register.php @@ -0,0 +1,50 @@ + time(), + "username" => $username, + "email" => $email, + "password" => $password, + "role" => "player" + ]; + + file_put_contents($file, json_encode($users, JSON_PRETTY_PRINT)); + echo "success"; +} +?>