mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2024-12-29 10:56:12 +00:00
General cleanup... again
This commit is contained in:
parent
9dc911ea4c
commit
6a6fac8c66
|
@ -49,6 +49,9 @@
|
||||||
margin: 0 0 0.5rem 0;
|
margin: 0 0 0.5rem 0;
|
||||||
max-height: 8rem;
|
max-height: 8rem;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
||||||
|
font-family: 'Secular One',
|
||||||
|
sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
.flyout-actionbox {
|
.flyout-actionbox {
|
||||||
|
|
|
@ -32,11 +32,11 @@ if (isset($_POST['submit'])) {
|
||||||
$image_thumbnail->resizeImage(300,null,null,1,null);
|
$image_thumbnail->resizeImage(300,null,null,1,null);
|
||||||
$image_thumbnail->writeImage($thumb_dir.$image_basename);
|
$image_thumbnail->writeImage($thumb_dir.$image_basename);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo "
|
?>
|
||||||
<script>
|
<script>
|
||||||
sniffleAdd('Gwha!', 'We hit a small roadbump during making of the thumbail. We will continue anyway!', 'var(--black)', '".$root_dir."assets/icons/bug.svg');
|
sniffleAdd('Gwha!', 'We hit a small roadbump during making of the thumbail. We will continue anyway!', 'var(--black)', '".$root_dir."assets/icons/bug.svg');
|
||||||
</script>
|
</script>
|
||||||
";
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare sql for destruction and filtering the sus
|
// Prepare sql for destruction and filtering the sus
|
||||||
|
@ -53,38 +53,38 @@ if (isset($_POST['submit'])) {
|
||||||
|
|
||||||
// Attempt to execute the prepared statement
|
// Attempt to execute the prepared statement
|
||||||
if (mysqli_stmt_execute($stmt)) {
|
if (mysqli_stmt_execute($stmt)) {
|
||||||
echo "
|
?>
|
||||||
<script>
|
<script>
|
||||||
sniffleAdd(':3', 'Your Image uploaded successfully!', 'var(--green)', '".$root_dir."assets/icons/check.svg');
|
sniffleAdd(':3', 'Your Image uploaded successfully!', 'var(--green)', '".$root_dir."assets/icons/check.svg');
|
||||||
</script>
|
</script>
|
||||||
";
|
<?php
|
||||||
} else {
|
} else {
|
||||||
echo "
|
?>
|
||||||
<script>
|
<script>
|
||||||
sniffleAdd(':c', 'Something went fuckywucky, please try later', 'var(--red)', '".$root_dir."assets/icons/cross.svg');
|
sniffleAdd(':c', 'Something went fuckywucky, please try later', 'var(--red)', '".$root_dir."assets/icons/cross.svg');
|
||||||
</script>
|
</script>
|
||||||
";
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "
|
?>
|
||||||
<script>
|
<script>
|
||||||
sniffleAdd('Hmmff', 'Something happened when moving the file to the server. This may just been a 1-off so try again', 'var(--red)', '".$root_dir."assets/icons/bug.svg');
|
sniffleAdd('Hmmff', 'Something happened when moving the file to the server. This may just been a 1-off so try again', 'var(--red)', '".$root_dir."assets/icons/bug.svg');
|
||||||
</script>
|
</script>
|
||||||
";
|
<?php
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "
|
?>
|
||||||
<script>
|
<script>
|
||||||
sniffleAdd('Woopsie', 'The file type you are trying to upload is not supported. Supported files include: JPEG, JPG, PNG and WEBP', 'var(--red)', '".$root_dir."assets/icons/cross.svg');
|
sniffleAdd('Woopsie', 'The file type you are trying to upload is not supported. Supported files include: JPEG, JPG, PNG and WEBP', 'var(--red)', '".$root_dir."assets/icons/cross.svg');
|
||||||
</script>
|
</script>
|
||||||
";
|
<?php
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "
|
?>
|
||||||
<script>
|
<script>
|
||||||
sniffleAdd('Denied!!!', 'As you are not loggedin, your upload has been stopped, L', 'var(--red)', '".$root_dir."assets/icons/cross.svg');
|
sniffleAdd('Denied!!!', 'As you are not loggedin, your upload has been stopped, L', 'var(--red)', '".$root_dir."assets/icons/cross.svg');
|
||||||
</script>
|
</script>
|
||||||
";
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1
assets/icons/warning_red.svg
Normal file
1
assets/icons/warning_red.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" fill="#b66467" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"></rect><line x1="128" y1="104" x2="128" y2="144" fill="none" stroke="#b66467" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line><path d="M114.2,40l-88,152A16,16,0,0,0,40,216H216a16,16,0,0,0,13.8-24l-88-152A15.9,15.9,0,0,0,114.2,40Z" fill="none" stroke="#b66467" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path><circle cx="128" cy="180" r="12"></circle></svg>
|
After Width: | Height: | Size: 549 B |
32
css/main.css
32
css/main.css
|
@ -221,6 +221,38 @@ nav .btn {
|
||||||
filter: blur(10px);
|
filter: blur(10px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nsfw-warning {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 5;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
text-decoration: none;
|
||||||
|
font-family: "Secular One", sans-serif;
|
||||||
|
}
|
||||||
|
.nsfw-warning span {
|
||||||
|
color: #B66467;
|
||||||
|
text-align: center;
|
||||||
|
text-shadow: 0 0 2px #151515;
|
||||||
|
}
|
||||||
|
.nsfw-warning img {
|
||||||
|
margin: 0.25rem;
|
||||||
|
width: 2rem;
|
||||||
|
height: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 500px) {
|
||||||
|
.nsfw-warning span {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
|-------------------------------------------------------------
|
|-------------------------------------------------------------
|
||||||
| IMAGE
|
| IMAGE
|
||||||
|
|
|
@ -98,6 +98,46 @@
|
||||||
.nsfw-blur {
|
.nsfw-blur {
|
||||||
filter: blur(10px);
|
filter: blur(10px);
|
||||||
}
|
}
|
||||||
|
.nsfw-warning {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
z-index: 5;
|
||||||
|
|
||||||
|
display: flex; flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
text-decoration: none;
|
||||||
|
font-family: $font-body;
|
||||||
|
|
||||||
|
span {
|
||||||
|
color: $red;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
text-shadow: 0 0 2px $black;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
margin: 0.25rem;
|
||||||
|
|
||||||
|
width: 2rem;
|
||||||
|
height: 2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 500px) {
|
||||||
|
.nsfw-warning {
|
||||||
|
span {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
|-------------------------------------------------------------
|
|-------------------------------------------------------------
|
||||||
| IMAGE
|
| IMAGE
|
||||||
|
|
|
@ -109,12 +109,15 @@ include "ui/nav.php";
|
||||||
// Check for NSFW tag
|
// Check for NSFW tag
|
||||||
if (str_contains($image['tags'], "nsfw")) {
|
if (str_contains($image['tags'], "nsfw")) {
|
||||||
$image_nsfw = "nsfw-blur";
|
$image_nsfw = "nsfw-blur";
|
||||||
|
$nsfw_warning = "<a href='image.php?id=".$image['id']."' class='nsfw-warning'><img class='svg' src='assets/icons/warning_red.svg'><span>This image contains NSFW material</span></a>";
|
||||||
} else {
|
} else {
|
||||||
$image_nsfw = "";
|
$image_nsfw = "";
|
||||||
|
$nsfw_warning = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Image loading
|
// Image loading
|
||||||
echo "<div class='gallery-item'>";
|
echo "<div class='gallery-item'>";
|
||||||
|
echo $nsfw_warning;
|
||||||
echo "<a href='image.php?id=".$image['id']."'><img class='gallery-image ".$image_nsfw."' loading='lazy' src='".$image_path."' id='".$image['id']."'></a>";
|
echo "<a href='image.php?id=".$image['id']."'><img class='gallery-image ".$image_nsfw."' loading='lazy' src='".$image_path."' id='".$image['id']."'></a>";
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue