From 87dc4d5ff04de805c2eb16e246ca747dd058fe06 Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Mon, 25 Jul 2022 16:13:26 +0100 Subject: [PATCH] Basic account system --- assets/icons/user-circle-plus.svg | 1 + assets/icons/user-circle.svg | 1 + css/account.css | 16 ++++ css/edit.css | 6 +- css/gallery.css | 4 +- css/image.css | 4 + css/login.css | 16 ++++ css/master.css | 10 +++ css/nav.css | 2 +- css/signup.css | 16 ++++ css/upload.css | 6 +- edit.php | 4 +- image.php | 10 +-- index.php | 15 +++- login.php | 115 +++++++++++++++++++++++++++ signup.php | 127 ++++++++++++++++++++++++++++++ ui/conn.php | 2 +- ui/header.php | 10 +++ upload.php | 52 ++++++------ 19 files changed, 371 insertions(+), 46 deletions(-) create mode 100644 assets/icons/user-circle-plus.svg create mode 100644 assets/icons/user-circle.svg create mode 100644 css/account.css create mode 100644 css/login.css create mode 100644 css/signup.css create mode 100644 login.php create mode 100644 signup.php diff --git a/assets/icons/user-circle-plus.svg b/assets/icons/user-circle-plus.svg new file mode 100644 index 0000000..fe4ade7 --- /dev/null +++ b/assets/icons/user-circle-plus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/user-circle.svg b/assets/icons/user-circle.svg new file mode 100644 index 0000000..dcf1619 --- /dev/null +++ b/assets/icons/user-circle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/css/account.css b/css/account.css new file mode 100644 index 0000000..29d5685 --- /dev/null +++ b/css/account.css @@ -0,0 +1,16 @@ +/* + -=-=-= Account =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +*/ +.account-root { + margin: 0 auto 2rem; padding: 0.5rem; + + max-width: 621px; + + background-color: var(--bg); color: var(--fg); + + border: 0.2rem solid var(--green); + outline: 0.5rem solid var(--bg); + + border-radius: var(--rad); + box-shadow: var(--shadow); +} diff --git a/css/edit.css b/css/edit.css index dc1f254..fcede8f 100644 --- a/css/edit.css +++ b/css/edit.css @@ -2,7 +2,9 @@ -=-=-= EDIT =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */ .edit-root { - margin: 0 auto 2rem; padding: 0.5rem;; + margin: 0 auto 2rem; padding: 0.5rem; + + max-width: 621px; background-color: var(--bg); color: var(--fg); @@ -11,6 +13,4 @@ border-radius: var(--rad); box-shadow: var(--shadow); - - max-width: 621px; } diff --git a/css/gallery.css b/css/gallery.css index ed100bd..cdd58d4 100644 --- a/css/gallery.css +++ b/css/gallery.css @@ -20,7 +20,8 @@ .gallery-item { margin: 0.5rem; padding: 0; - max-width: 300px; height: auto; + max-width: 232.5px; max-height: 232.5px; + height: auto; background-color: var(--bg-2); border-radius: var(--rad); @@ -44,6 +45,7 @@ .gallery-image { margin: 0; padding: 0; + /*max-width: 232.5px; max-height: 232.5px;*/ width: 100%; height: 100%; top: 0; bottom: 0; left: 0; right: 0; diff --git a/css/image.css b/css/image.css index f77150d..69587b4 100644 --- a/css/image.css +++ b/css/image.css @@ -28,6 +28,10 @@ top: 50%; left: 50%; transform: translate(-50%, -50%); + /*background-color: var(--bg); + + outline: 0.5rem solid var(--bg);*/ + border-radius: var(--rad); } diff --git a/css/login.css b/css/login.css new file mode 100644 index 0000000..b783b79 --- /dev/null +++ b/css/login.css @@ -0,0 +1,16 @@ +/* + -=-=-= LONGIN =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +*/ +.login-root { + margin: 0 auto 2rem; padding: 0.5rem; + + max-width: 621px; + + background-color: var(--bg); color: var(--fg); + + border: 0.2rem solid var(--green); + outline: 0.5rem solid var(--bg); + + border-radius: var(--rad); + box-shadow: var(--shadow); +} diff --git a/css/master.css b/css/master.css index c52b3b6..ebf9cea 100644 --- a/css/master.css +++ b/css/master.css @@ -6,6 +6,10 @@ @import "edit.css"; @import "upload.css"; +@import "signup.css"; +@import "login.css"; +@import "account.css"; + :root { --bg: #151515df; --bg-1: #242621; @@ -137,6 +141,12 @@ a.btn { .space-top { margin-top: 1rem; } +.space-bottom-large { + margin-bottom: 2rem; +} +.space-top-large { + margin-top: 2rem; +} .svg { margin: 0 0.2rem 0.1rem 0; diff --git a/css/nav.css b/css/nav.css index 4a7fd07..216f05e 100644 --- a/css/nav.css +++ b/css/nav.css @@ -33,7 +33,7 @@ nav hr { width: auto; justify-content: space-between; } -@media (max-width: 569px) { +@media (max-width: 800px) { .nav-name h3, .nav-name { display: none; } diff --git a/css/signup.css b/css/signup.css new file mode 100644 index 0000000..8df0670 --- /dev/null +++ b/css/signup.css @@ -0,0 +1,16 @@ +/* + -=-=-= SIGN UP =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +*/ +.signup-root { + margin: 0 auto 2rem; padding: 0.5rem; + + max-width: 621px; + + background-color: var(--bg); color: var(--fg); + + border: 0.2rem solid var(--green); + outline: 0.5rem solid var(--bg); + + border-radius: var(--rad); + box-shadow: var(--shadow); +} diff --git a/css/upload.css b/css/upload.css index 29929a6..4e487e3 100644 --- a/css/upload.css +++ b/css/upload.css @@ -2,7 +2,9 @@ -=-=-= UPLOAD =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- */ .upload-root { - margin: 0 auto 2rem; padding: 0.5rem;; + margin: 0 auto 2rem; padding: 0.5rem; + + max-width: 621px; background-color: var(--bg); color: var(--fg); @@ -11,6 +13,4 @@ border-radius: var(--rad); box-shadow: var(--shadow); - - max-width: 621px; } diff --git a/edit.php b/edit.php index 401b8f0..5f585b4 100644 --- a/edit.php +++ b/edit.php @@ -3,7 +3,7 @@ - UwU + Gallery @@ -16,7 +16,7 @@

Modify Information

This is a dangerous place to step foot into... tread carefully.

- + Update information"; ?>
diff --git a/image.php b/image.php index fdb352f..43fdad1 100644 --- a/image.php +++ b/image.php @@ -3,7 +3,7 @@ - UwU + Gallery @@ -17,7 +17,7 @@ // Update toast if ($_GET["update"] == "success") { - echo "

Information updated

"; + echo "

Information updated

"; } @@ -30,7 +30,7 @@ // Check if ID of image in URL if (!isset($_GET['id'])) { // No ID toast - echo "

No ID present

"; + echo "

No ID present

"; // Replacement "no image" image and description $image_path = "assets/no_image.png"; @@ -38,7 +38,7 @@ } elseif (empty($image['imagename'])) { // ID not avalible toast - echo "

Could not find image with ID: ".$_GET['id']."

"; + echo "

Could not find image with ID: ".$_GET['id']."

"; // Replacement "no image" image and description $image_path = "assets/no_image.png"; @@ -105,7 +105,7 @@ // If deleted, delete from Table $image_delete_request = "DELETE FROM swag_table WHERE id =".$image['id']; $image_delete = mysqli_query($conn,$image_delete_request); - + if ($image_delete) { // Deleted image header("Location:index.php?del=true&id=".$image['id']); diff --git a/index.php b/index.php index f835999..e3da55b 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ - UwU + Gallery @@ -17,10 +17,21 @@ if ($_GET["del"] == "true") { echo "

Successfully deleted image: ".$_GET['id']."

"; } + + // Account toast + if ($_GET["login"] == "success") { + echo "

You're now logged in!

"; + } ?>
-

Welcome!

+ Welcome ".$_SESSION['username']."!"; + } else { + echo "

Welcome!

"; + } + ?>

*internal screaming*

diff --git a/login.php b/login.php new file mode 100644 index 0000000..bde146b --- /dev/null +++ b/login.php @@ -0,0 +1,115 @@ + + + + + + Login + + + + + + + + +
+

Login

+

This is still being worked on, so I ask you kindly to not try anything, thankies!

+
+ + + +
+ ".$error."

"; + } + if (isset($success)) { + echo "

".$success."

"; + } + ?> +
+ + + + diff --git a/signup.php b/signup.php new file mode 100644 index 0000000..23dda9c --- /dev/null +++ b/signup.php @@ -0,0 +1,127 @@ + + + + + + Sign Up + + + + + + + + +
+

Make account

+

This is still being worked on, so I ask you kindly to not try anything, thankies!

+
+ + + + + ".$error."

"; + } + if (isset($success)) { + echo "

".$success."

"; + } + ?> +
+ Got an account? Login! +
+ + + + diff --git a/ui/conn.php b/ui/conn.php index 79bd767..cda2dac 100644 --- a/ui/conn.php +++ b/ui/conn.php @@ -1,6 +1,6 @@ connect_error) { echo "

Could not connect to database

"; diff --git a/ui/header.php b/ui/header.php index 420dd40..11e0467 100644 --- a/ui/header.php +++ b/ui/header.php @@ -1,3 +1,5 @@ + + diff --git a/upload.php b/upload.php index 9b7e7b0..8dc0e87 100644 --- a/upload.php +++ b/upload.php @@ -3,38 +3,15 @@ - UwU + Upload - - -
-

Upload image

-
- - - -
- - Your Image uploaded successfully!

"; - } elseif ($_GET["r"] == "fail") { - // Upload failed - echo "

F, Upload failed

"; - } elseif ($_GET["r"] == "nofile") { - // No file was present - echo "

No file lol

"; - } - ?> -
- writeImage("images/thumbnails/".$image_basename); - header("Location:upload.php?r=success"); + $success = "Your Image uploaded successfully!"; } else { // Could not move images to folder - header("Location:upload.php?r=fail"); + $error = "F, Upload failed"; } } else { // No image present - header("Location:upload.php?r=nofile"); + $error = "No file lol"; } } ?> +
+

Upload image

+

In this world you have 2 choices, to upload a really cute picture of an animal or fursuit, or something other than those 2 things.

+
+ + + +
+ + ".$error."

"; + } + if (isset($success)) { + echo "

".$success."

"; + } + ?> +
+