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