mirror of
https://github.com/Fluffy-Bean/image-gallery.git
synced 2025-01-28 08:58:24 +00:00
Merge pull request #2 from Fluffy-Bean/beta
General fixes + nsfw tag blur
This commit is contained in:
commit
831317bd17
|
@ -21,7 +21,7 @@
|
|||
margin: 0; padding: 0.5rem;
|
||||
|
||||
max-width: 621px; width: calc(100% - 3.5rem);
|
||||
max-height: 20rem; height: auto; min-height: 10rem;
|
||||
height: auto; min-height: 10rem;
|
||||
|
||||
position: fixed; z-index: 9999;
|
||||
left: 50%; bottom: -15rem;
|
||||
|
@ -41,9 +41,15 @@
|
|||
}
|
||||
|
||||
.flyout-header {
|
||||
margin: 0 0 0.5rem 0;
|
||||
font-size: 20px;
|
||||
font-family: "Lexend Deca", sans-serif;
|
||||
}
|
||||
.flyout-description {
|
||||
margin: 0 0 0.5rem 0;
|
||||
max-height: 8rem;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.flyout-actionbox {
|
||||
display: inline;
|
||||
|
|
|
@ -25,7 +25,7 @@ function flyoutShow(header, description, actionbox) {
|
|||
$(flyoutActionbox).html(actionbox);
|
||||
|
||||
// Show the flyout
|
||||
flyoutRoot.style.display = "flex";
|
||||
flyoutRoot.style.display = "block";
|
||||
// Show the dim
|
||||
flyoutDim.style.display = "block";
|
||||
setTimeout(function(){
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
For now it's hard-coded, shouldn't be an issue as most people wont be changing this often anyway
|
||||
*/
|
||||
// Setting up connection variables
|
||||
$conn_ip = "localhost";
|
||||
$conn_ip = "192.168.0.79:3306";
|
||||
$conn_username = "uwu";
|
||||
$conn_password = "fennec621";
|
||||
$conn_database = "swag";
|
||||
$conn_database = "gallery";
|
||||
|
||||
$conn = mysqli_connect($conn_ip, $conn_username, $conn_password , $conn_database);
|
||||
if ($conn->connect_error) {
|
||||
|
|
|
@ -185,6 +185,7 @@ nav .btn {
|
|||
background-color: #151515;
|
||||
border-radius: -0.5rem;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
flex: 1 0 150px;
|
||||
transition: transform 0.15s cubic-bezier(0.19, 1, 0.22, 1);
|
||||
}
|
||||
|
@ -216,6 +217,10 @@ nav .btn {
|
|||
border-radius: -0.5rem;
|
||||
}
|
||||
|
||||
.nsfw-blur {
|
||||
filter: blur(10px);
|
||||
}
|
||||
|
||||
/*
|
||||
|-------------------------------------------------------------
|
||||
| IMAGE
|
||||
|
@ -349,6 +354,9 @@ nav .btn {
|
|||
border-radius: 0rem;
|
||||
font-family: "Secular One", sans-serif;
|
||||
}
|
||||
.tag::before {
|
||||
content: "# ";
|
||||
}
|
||||
|
||||
.danger-zone {
|
||||
margin-bottom: 1rem;
|
||||
|
|
|
@ -55,6 +55,8 @@
|
|||
|
||||
position: relative;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
flex: 1 0 150px;
|
||||
|
||||
transition: transform 0.15s cubic-bezier(.19, 1, .22, 1);
|
||||
|
@ -93,6 +95,9 @@
|
|||
border-radius: calc($rad - 0.5rem);
|
||||
}
|
||||
|
||||
.nsfw-blur {
|
||||
filter: blur(10px);
|
||||
}
|
||||
/*
|
||||
|-------------------------------------------------------------
|
||||
| IMAGE
|
||||
|
@ -168,6 +173,9 @@
|
|||
border-radius: $rad;
|
||||
|
||||
font-family: $font-body;
|
||||
&::before {
|
||||
content: '# ';
|
||||
}
|
||||
}
|
||||
|
||||
// DANGER ZONE
|
||||
|
|
|
@ -219,7 +219,11 @@
|
|||
if (isset($image['tags']) && !empty($image['tags'])) {
|
||||
$image_tags_array = explode(" ", $image['tags']);
|
||||
foreach ($image_tags_array as $tag) {
|
||||
echo "<p class='tag btn-good'><img class='svg' src='assets/icons/tag.svg'>".$tag."</p>";
|
||||
if ($tag == "nsfw") {
|
||||
echo "<p id='tag' class='tag btn-bad'>".$tag."</p>";
|
||||
} else {
|
||||
echo "<p id='tag' class='tag btn-good'>".$tag."</p>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<p>No tags present</p>";
|
||||
|
|
15
index.php
15
index.php
|
@ -28,18 +28,14 @@
|
|||
<!-- Flyout script! -->
|
||||
<script src="Flyout/flyout.js"></script>
|
||||
<link rel='stylesheet' href='Flyout/flyout.css'>
|
||||
|
||||
<?php include "ui/required.php"; ?>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
include "ui/required.php";
|
||||
include "ui/nav.php";
|
||||
?>
|
||||
|
||||
|
||||
<script>
|
||||
//sniffleAdd("Warning", "The website is currently being worked on, some functionality has been restored, but tread carefully as errors may occur", "var(--red)", "<?php echo $root_dir ?>assets/icons/warning.svg");
|
||||
|
||||
if (params.del == "true") {
|
||||
sniffleAdd("Image Deleted", "Successfully deleted image: <?php echo $_GET['id']; ?>", "var(--green)", "<?php echo $root_dir ?>assets/icons/trash.svg");
|
||||
}
|
||||
|
@ -110,9 +106,16 @@ include "ui/nav.php";
|
|||
$image_path = "images/".$image['imagename'];
|
||||
}
|
||||
|
||||
// Check for NSFW tag
|
||||
if (str_contains($image['tags'], "nsfw")) {
|
||||
$image_nsfw = "nsfw-blur";
|
||||
} else {
|
||||
$image_nsfw = "";
|
||||
}
|
||||
|
||||
// Image loading
|
||||
echo "<div class='gallery-item'>";
|
||||
echo "<a href='image.php?id=".$image['id']."'><img class='gallery-image' 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>";
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -1,4 +1,12 @@
|
|||
<?php
|
||||
/*
|
||||
Used for testing, do not use this in production
|
||||
*/
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ERROR | E_PARSE | E_NOTICE);;
|
||||
|
||||
|
||||
/*
|
||||
Start session
|
||||
|
||||
|
@ -64,11 +72,13 @@ include $root_dir."app/server/secrete.php";
|
|||
Controlled by Flyout.js
|
||||
-->
|
||||
<div id='flyoutDim' class='flyout-dim'></div>
|
||||
<div id='flyoutRoot' class='flyout flex-down'>
|
||||
<p id='flyoutHeader' class='flyout-header space-bottom'>Header</p>
|
||||
<p id='flyoutDescription' class='flyout-description space-bottom'>Description</p>
|
||||
<div id='flyoutActionbox' class='flyout-actionbox space-bottom-small'></div>
|
||||
<button onclick='flyoutClose()' class='btn alert-default'>Close</button>
|
||||
<div id='flyoutRoot' class='flyout'>
|
||||
<p id='flyoutHeader' class='flyout-header'>Header</p>
|
||||
<br>
|
||||
<p id='flyoutDescription' class='flyout-description'>Description</p>
|
||||
<br>
|
||||
<div id='flyoutActionbox' class='flyout-actionbox'></div>
|
||||
<button onclick='flyoutClose()' class='btn btn-neutral'>Close</button>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
|
|
Loading…
Reference in a new issue