From 91871645829d29842688d1e519105e4a9a74e06e Mon Sep 17 00:00:00 2001
From: Fluffy-Bean <michal-gdula@protonmail.com>
Date: Wed, 21 Sep 2022 20:39:22 +0000
Subject: [PATCH] Remove pointless error.php and fix image.php

---
 app/server/conn.php |  2 +-
 css/main.css        |  2 ++
 css/scss/_body.scss |  4 ++++
 error.php           | 26 --------------------------
 image.php           |  2 ++
 5 files changed, 9 insertions(+), 27 deletions(-)
 delete mode 100644 error.php

diff --git a/app/server/conn.php b/app/server/conn.php
index e29e090..13f406b 100644
--- a/app/server/conn.php
+++ b/app/server/conn.php
@@ -14,7 +14,7 @@ $conn_database = "gallery";
 try {
 	$conn = @mysqli_connect($conn_ip, $conn_username, $conn_password , $conn_database);
 } catch (Exception $e) {
-	header("location: error.php?e=conn");
+	die("Unable to connect to the database");
 }
 
 session_start();
diff --git a/css/main.css b/css/main.css
index 54450f8..1f997fc 100644
--- a/css/main.css
+++ b/css/main.css
@@ -361,6 +361,7 @@ nav .btn {
 .fullscreen-image button:hover {
   outline: #E8E3E3 0.2rem solid;
   color: #E8E3E3;
+  cursor: pointer;
 }
 
 .image-container {
@@ -419,6 +420,7 @@ nav .btn {
 .preview-button:hover {
   outline: #E8E3E3 0.2rem solid;
   color: #E8E3E3;
+  cursor: pointer;
 }
 
 .image-description {
diff --git a/css/scss/_body.scss b/css/scss/_body.scss
index 7b2d62d..65eb53d 100644
--- a/css/scss/_body.scss
+++ b/css/scss/_body.scss
@@ -243,6 +243,8 @@
         &:hover {
             outline: $white 0.2rem solid;
             color: $fg;
+
+            cursor: pointer;
         }
     }
 }
@@ -323,6 +325,8 @@
     &:hover {
         outline: $white 0.2rem solid;
         color: $fg;
+
+        cursor: pointer;
     }
 }
 
diff --git a/error.php b/error.php
deleted file mode 100644
index 1964066..0000000
--- a/error.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<!DOCTYPE html>
-<html>
-
-<head>
-	<?php require_once __DIR__."/assets/ui/header.php"; ?>
-</head>
-
-<body>
-
-<div></div>
-
-<div class="error-root">
-    <h2>Woops...</h2>
-    <?php
-        if ($_GET["e"] == "conn") {
-            echo "<p>An error occured while connecting to the server. If you're an admin, check the database configuration and/or make sure the database is alive</p>";
-        } else {
-            echo "<p>An error occured! But no description was provided.</p>";
-        }
-    ?>
-</div>
-
-<?php require_once __DIR__."/assets/ui/footer.php"; ?>
-</body>
-
-</html>
\ No newline at end of file
diff --git a/image.php b/image.php
index 1c40dfc..d862b1e 100644
--- a/image.php
+++ b/image.php
@@ -143,6 +143,7 @@
 		<script>
 			function fullScreen() {
 				document.querySelector(".preview-button").style.display = "none";
+				document.querySelector("html").style.overflow = "hidden";
 
 				document.querySelector(".fullscreen-image").style.display = "block";
 				document.querySelector(".fullscreen-image > img").src = "<?php echo $image_path;?>";
@@ -153,6 +154,7 @@
 
 			function closeFullScreen() {
 				document.querySelector(".preview-button").style.display = "block";
+				document.querySelector("html").style.overflow = "auto";
 				
 				document.querySelector(".fullscreen-image").style.opacity = 0;
 				setTimeout(function(){