From acde68ac74cef8aa63e4c3b97d719a33c718627c Mon Sep 17 00:00:00 2001
From: Fluffy-Bean
Date: Sat, 23 Jul 2022 08:44:43 +0100
Subject: [PATCH] Clean up :3
---
assets/1.svg | 1 -
assets/bg.svg | 8 +------
assets/bg2.svg | 1 +
assets/footer.svg | 1 -
assets/nav.svg | 1 -
css/gallery.css | 2 +-
css/master.css | 19 +++++++++++----
css/nav.css | 7 ++++++
image.php | 61 ++++++++++++++++++++++-------------------------
index.php | 13 ++++------
ui/conn.php | 8 +++++++
ui/footer.php | 4 ++--
upload.php | 38 ++++++++++++++---------------
13 files changed, 85 insertions(+), 79 deletions(-)
delete mode 100644 assets/1.svg
create mode 100644 assets/bg2.svg
delete mode 100644 assets/footer.svg
delete mode 100644 assets/nav.svg
create mode 100644 ui/conn.php
diff --git a/assets/1.svg b/assets/1.svg
deleted file mode 100644
index 81e1783..0000000
--- a/assets/1.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/bg.svg b/assets/bg.svg
index 6ee2feb..ef17c83 100644
--- a/assets/bg.svg
+++ b/assets/bg.svg
@@ -1,7 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/assets/bg2.svg b/assets/bg2.svg
new file mode 100644
index 0000000..c717e46
--- /dev/null
+++ b/assets/bg2.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/assets/footer.svg b/assets/footer.svg
deleted file mode 100644
index d271bf7..0000000
--- a/assets/footer.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/assets/nav.svg b/assets/nav.svg
deleted file mode 100644
index 420562f..0000000
--- a/assets/nav.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/css/gallery.css b/css/gallery.css
index 1798c18..6eeaf03 100644
--- a/css/gallery.css
+++ b/css/gallery.css
@@ -22,7 +22,7 @@
max-width: 300px; height: 200px;
- background-color: var(--gray);
+ background-color: var(--bg-2);
border-radius: var(--rad);
flex: 1 0 150px;
diff --git a/css/master.css b/css/master.css
index 8f55917..413bc50 100644
--- a/css/master.css
+++ b/css/master.css
@@ -14,6 +14,7 @@
--fg-dark: #151515;
--red: #B66467;
+ --orange: #FF7700;
--green: #8C977D;
--black: #151515;
--white: #E8E3E3;
@@ -29,16 +30,20 @@
html {
margin: 0; padding: 0;
- height: 100vh; width: 100vw;
+ min-height: 100vh; max-width: 100vw;
background-color: var(--bg-2);
+ background-image: url("../assets/bg2.svg");
+
+ background-position: center;
+ background-size: cover;
+ background-repeat: no-repeat;
+ background-attachment: fixed;
}
body {
margin: 0 auto; padding: 1rem;
- min-height: calc(100vh - 1rem);
-
- max-width: 1500px;
+ min-height: calc(100vh - 2rem); max-width: 1500px;
display: flex;
flex-direction: column;
@@ -70,13 +75,17 @@ body {
}
.alert {
- margin: 0; padding: 1rem;
+ margin: 0 auto; padding: 1rem;
width: inherit;
+ text-align: center;
+
display: inline-block;
border-radius: var(--rad);
+
+ outline: 0.5rem solid var(--bg);
}
.alert-high {
background-color: var(--green);
diff --git a/css/nav.css b/css/nav.css
index 53b2853..e858e07 100644
--- a/css/nav.css
+++ b/css/nav.css
@@ -16,3 +16,10 @@ nav {
border-radius: var(--rad);
box-shadow: var(--shadow);
}
+
+nav h3 {
+ margin: 0;
+}
+nav hr {
+ margin: 0.5rem 0.2rem; padding: 0;
+}
diff --git a/image.php b/image.php
index 578f3ae..dd457ea 100644
--- a/image.php
+++ b/image.php
@@ -8,49 +8,44 @@
-
-
Could not connect to database
";
+ include("ui/header.php");
+ include_once("ui/conn.php");
+
+ // Get image ID
+ // Getting all image info from table
+ $get_image = "SELECT * FROM swag_table WHERE id = ".$_GET['id'];
+ $image_results = mysqli_query($conn, $get_image);
+ $image = mysqli_fetch_assoc($image_results);
+
+ if (!isset($_GET['id'])) {
+ echo "No ID present
";
+
+ $image_path = "assets/no_image.png";
+ $image_alt = "No image could be found, sowwy";
+ } elseif (empty($image['imagename'])) {
+ echo "Could not find image with ID: ".$_GET['id']."
";
+
+ $image_path = "assets/no_image.png";
+ $image_alt = "No image could be found, sowwy";
+ } else {
+ $image_path = "images/".$image['imagename'];
+ $image_alt = $image['alt'];
}
?>
- ";
-
- if (!isset($_GET['id'])) {
- echo "cannot obtain image";
- }
- ?>
+ "; ?>
Description
".$image_alt."";
- }else{
+ if (empty($image_alt)) {
echo "
Image uploaded prior to description being added
";
+ }else{
+ echo "
".$image_alt."
";
}
?>
@@ -93,7 +88,7 @@
// Deleted image
header("Location:index.php?del=true&id=".$image['id']);
}
- }else{
+ } else {
// Could not delete from file
echo "
Error: Coult not delete image
";
}
@@ -101,6 +96,6 @@
?>
-
+