You wont belive it

This commit is contained in:
Michał 2022-08-07 18:28:21 +01:00
parent 8da2aff265
commit ffa8a8e1a3
8 changed files with 73 additions and 49 deletions

View file

@ -20,7 +20,7 @@
max-width: 621px; width: calc(100% - 3.5rem);
max-height: 20rem; height: auto; min-height: 10rem;
position: fixed; z-index: 99999;
position: fixed; z-index: 999999999;
left: 50%; bottom: -15rem;
transform: translateX(-50%) scale(0.5);
@ -42,10 +42,12 @@
display: inline;
box-sizing: border-box;
}
/* Worlds shittest workaround to a problem I have no clue how to fix */
.flyout-actionbox * {
.flyout-actionbox *,
.flyout-actionbox * * {
width: 100%;
}
.flyout-actionbox * * {
.flyout-actionbox * * * {
width: auto;
}

View file

@ -20,7 +20,7 @@ function flyoutShow(header, description, actionbox) {
// Set information in flyout
flyoutHeader.textContent = header;
flyoutDescription.textContent = description;
flyoutActionbox.innerHTML = actionbox;
$(flyoutActionbox).html(actionbox);
// Show the flyout
flyoutRoot.style.display = "flex";

View file

@ -28,6 +28,9 @@
<p>What Do I want this to become in the future? No clue, but I do want this to be usable by others, if its a file they download a docker image they setup on your own web server.</p>
<p>Will it become that any time soon? No, but. I am going to work on this untill it becomes what I want it to be!</p>
<h2 class="space-top-large" id="add-this">Can you add "A" or "B"?</h2>
<p>No.</p>
<h2 class="space-top-large" id="guide">How do I use this!</h2>
<p>First you must obtain the invite code. If you don't have one and are interested in trying this, feel free to DM me on Telegram!</p>
<p>But once you're done doing that, you can start making your account <a class='link' href="https://superdupersecteteuploadtest.fluffybean.gay/account/signup.php">at the signup page here</a>.</p>
@ -40,9 +43,6 @@
<p>To mrHDash...</p>
</div>
<?php
include "ui/top.html";
include "ui/footer.php";
?>
<?php include "ui/footer.php"; ?>
</body>
</html>

View file

@ -24,9 +24,9 @@ if (isset($_POST['submit'])) {
// Attempt to execute the prepared statement
if (mysqli_stmt_execute($stmt)) {
echo "sniffleAdd('Info','Description has been updated successfully! You may need to refresh the page to see the new information.','var(--green)')";
echo "sniffleAdd('Info', 'Description has been updated successfully! You may need to refresh the page to see the new information.', 'var(--green)', ".$root_dir."'assets/icons/check.svg')";
} else {
echo "sniffleAdd('Error','An error occured on the servers','var(--red)')";
echo "sniffleAdd('Error', 'An error occured on the servers', 'var(--red)', ".$root_dir."'assets/icons/check.svg')";
}
}
}

1
assets/icons/check.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" fill="#e8e3e3" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"></rect><polyline points="216 72 104 184 48 128" fill="none" stroke="#e8e3e3" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline></svg>

After

Width:  |  Height:  |  Size: 304 B

1
assets/icons/cross.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="192" height="192" fill="#e8e3e3" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"></rect><line x1="200" y1="56" x2="56" y2="200" stroke="#e8e3e3" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line><line x1="200" y1="200" x2="56" y2="56" stroke="#e8e3e3" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line></svg>

After

Width:  |  Height:  |  Size: 416 B

View file

@ -72,7 +72,7 @@ body {
#back-to-top {
margin: 0; padding: 0.5rem;
position: fixed; z-index: 9999999999;
position: fixed; z-index: 9999999;
right: -2.5rem; bottom: 1rem;
object-position: center;

View file

@ -1,13 +1,3 @@
<?php
function info_check($string){
if (isset($string) && !empty($string)) {
return $string;
} else {
return "No information provided.";
}
}
?>
<!DOCTYPE html>
<html>
<head>
@ -23,6 +13,10 @@ function info_check($string){
<!-- JQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script>
</script>
<!-- Sniffle script! -->
<script src="Sniffle/sniffle.js"></script>
<link rel='stylesheet' href='Sniffle/sniffle.css'>
@ -33,13 +27,25 @@ function info_check($string){
</head>
<body>
<?php
/*
|-------------------------------------------------------------
| Import Required
|-------------------------------------------------------------
| These are common scripts used across all pages of the
| website. At some point I want the whole website to be only
| one index page. But that's going to require many many many
| many rewrites and hours of learning....
|-------------------------------------------------------------
*/
include "ui/required.php";
/*
Get image ID
Image ID should be written in the URL of the page as ?id=69
If ID cannot be obtained, give error. ID going here ^^
|-------------------------------------------------------------
| Get image ID
|-------------------------------------------------------------
| Image ID should be written in the URL of the page as ?id=69
| If ID cannot be obtained, give error. ID going here ^^
|-------------------------------------------------------------
*/
if (isset($_GET['id'])) {
// Get all image info
@ -69,18 +75,22 @@ function info_check($string){
/*
Get all user details
This gets the user info from the image
|-------------------------------------------------------------
| Get all user details
|-------------------------------------------------------------
| This gets the user info from the image
|-------------------------------------------------------------
*/
if (isset($image['author'])) {
$user = get_user_info($conn, $image['author']);
}
/*
Check user privilge
This requires the user to be logged in or an admin
|-------------------------------------------------------------
| Check user privilge
|-------------------------------------------------------------
| This requires the user to be logged in or an admin
|-------------------------------------------------------------
*/
if (image_privilage($image['author']) || is_admin($_SESSION['id'])) {
$privilaged = True;
@ -175,10 +185,12 @@ function info_check($string){
<?php
/*
Check if user is privilaged,
If yes, grant them access to the Danger zone, or "the place that can fuck things up"
Checking is done prior to here
|-------------------------------------------------------------
| Check if user is privilaged,
|-------------------------------------------------------------
| If yes, grant them access to the Danger zone, or "the place that can fuck things up"
| Checking is done prior to here
|-------------------------------------------------------------
*/
if ($privilaged) {
?>
@ -186,6 +198,8 @@ function info_check($string){
<div class='danger-zone flex-down default-window'>
<h2>Danger zone</h2>
<script id="conformationMessage"></script>
<!-- Delete -->
<button id='deleteButton' class='btn alert-low'><img class='svg' src='assets/icons/trash.svg'>Delete image</button>
<script>
@ -201,27 +215,33 @@ function info_check($string){
|-------------------------------------------------------------
| Edit description
|-------------------------------------------------------------
| Most people reading through the code will probably say
| how shit it is. YOU HAVE NO FUCKING CLUE HOW LONG THIS TOOK
| ME TO FIGURE OUT. i hate js.
|-------------------------------------------------------------
-->
<button id='descriptionButton' class='btn alert-low space-top-small'><img class='svg' src='assets/icons/edit.svg'>Edit description</button>
<script>
$('#descriptionButton').click(function(){
var header = "Enter new Description/Alt";
var description = "Whatcha gonna put in there 👀";
var actionBox = "<form id='descriptionConfirm'>\
<input id='descriptionInput' class='btn alert-default space-bottom' type='text' placeholder='Description/Alt for image'>\
<button id='descriptionSubmit' class='btn alert-low' type='submit'><img class='svg' src='assets/icons/edit.svg'>Update information</button>\
</form>\
<div id='descriptionErrorHandling'></div>";
var actionBox = "<form id='descriptionConfirm' action='app/image/edit_description.php' method='POST'>\
<input id='descriptionInput' class='btn alert-default space-bottom' type='text' name='descriptionInput' placeholder='Description/Alt for image'>\
<button id='descriptionSubmit' class='btn alert-low' type='submit' name='descriptionSubmit'><img class='svg' src='assets/icons/edit.svg'>Update information</button>\
</form>";
flyoutShow(header, description, actionBox);
});
$("#descriptionConfirm").submit(function(event) {
event.preventDefault();
var descriptionInput = $("#descriptionInput").val();
var descriptionSubmit = $("#descriptionSubmit").val();
$("#descriptionErrorHandling").load("app/image/edit_description.php", {
id: <?php echo $_GET['id']; ?>,
description: descriptionInput,
submit: descriptionSubmit
$("#descriptionConfirm").submit(function(event) {
event.preventDefault();
var descriptionInput = $("#descriptionInput").val();
var descriptionSubmit = $("#descriptionSubmit").val();
$.post("app/image/edit_description.php", {
id: <?php echo $_GET['id']; ?>,
description: descriptionInput,
submit: descriptionSubmit
}, function(returnData) {
$("#conformationMessage").html(returnData);
});
});
});
</script>