Code cleanup in progress

This commit is contained in:
Michał Gdula 2022-09-21 13:02:38 +00:00
parent 6de757215f
commit 5a591c59bc
13 changed files with 339 additions and 348 deletions

View file

@ -1,3 +1,5 @@
<?php require_once __DIR__."/ui/required.php"; ?>
<!DOCTYPE html>
<html>
@ -5,12 +7,8 @@
<?php require_once __DIR__."/ui/header.php"; ?>
</head>
<body>
<?php
require_once __DIR__."/ui/required.php";
require_once __DIR__."/ui/nav.php";
?>
<?php require_once __DIR__."/ui/nav.php"; ?>
<div class="about-root">
<h1><?php echo $user_settings['website_name']; ?></h1>

View file

@ -1,3 +1,5 @@
<?php require_once __DIR__."/ui/required.php"; ?>
<!DOCTYPE html>
<html>
@ -7,7 +9,6 @@
<body>
<?php
require_once __DIR__."/ui/required.php";
require_once __DIR__."/ui/nav.php";
use App\Account;

View file

@ -1,25 +0,0 @@
<script>
console.log(". . /|/| . . . . . . .\n\
.. /0 0 \\ . . . . . ..\n\
(III% . \\________, . .\n\
.. .\\_, .%###%/ \\'\\,..\n\
. . . .||#####| |'\\ \\.\n\
.. . . ||. . .|/. .\\V.\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . cc/ . .cc/ . . .");
</script>

View file

@ -26,7 +26,7 @@
"The world will not be destroyed by those who do evil, but by those who watch them and do nothing."
],
"license":"GPL 3.0",
"version": "22.09.20",
"version": "22.09.21",
"user_name": "Michal",
"is_testing": "true",
"upload_max": "20"

View file

@ -10,11 +10,3 @@
*/
$user_import = file_get_contents(__DIR__."/manifest.json");
$user_settings = json_decode($user_import, true);
foreach ($user_settings->data as $website) {
foreach ($website->debug as $debug) {
}
}
$debug = $user_settings["website"]["debug"];

View file

@ -217,7 +217,8 @@ nav .btn {
margin: 0.25rem;
padding: 0;
height: auto;
max-width: calc(33.33% - 0.5rem);
max-width: calc(20% - 0.5rem);
min-width: calc(20% - 0.5rem);
background-color: #151515;
border-radius: -0.25rem;
position: relative;
@ -236,6 +237,18 @@ nav .btn {
padding-bottom: 100%;
}
@media (max-width: 800px) {
.gallery-item {
max-width: calc(25% - 0.5rem);
min-width: calc(25% - 0.5rem);
}
}
@media (max-width: 550px) {
.gallery-item {
max-width: calc(33.33% - 0.5rem);
min-width: calc(33.33% - 0.5rem);
}
}
.gallery-image {
margin: 0;
padding: 0;

View file

@ -64,7 +64,8 @@
padding: 0;
height: auto;
max-width: calc(33.33% - 0.5rem);
max-width: calc(20% - 0.5rem);
min-width: calc(20% - 0.5rem);
background-color: $bg;
border-radius: calc($rad - 0.5rem);
@ -91,6 +92,19 @@
}
}
@media (max-width: 800px) {
.gallery-item {
max-width: calc(25% - 0.5rem);
min-width: calc(25% - 0.5rem);
}
}
@media (max-width: 550px) {
.gallery-item {
max-width: calc(33.33% - 0.5rem);
min-width: calc(33.33% - 0.5rem);
}
}
.gallery-image {
margin: 0;
padding: 0;

View file

@ -1,3 +1,5 @@
<?php require_once __DIR__."/ui/required.php"; ?>
<!DOCTYPE html>
<html>
@ -5,20 +7,8 @@
<?php require_once __DIR__."/ui/header.php"; ?>
</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....
|-------------------------------------------------------------
*/
require_once __DIR__."/ui/required.php";
require_once __DIR__."/ui/nav.php";
use App\Account;

View file

@ -1,3 +1,5 @@
<?php require_once __DIR__."/ui/required.php"; ?>
<!DOCTYPE html>
<html>
@ -6,8 +8,7 @@
</head>
<body>
<?php
require_once __DIR__."/ui/required.php";
<?php
require_once __DIR__."/ui/nav.php";
if ($_GET['del']) {
@ -17,7 +18,7 @@
</script>
<?php
}
?>
?>
<div class="info-text">
<?php

View file

@ -1,3 +1,5 @@
<?php require_once __DIR__."/ui/required.php"; ?>
<!DOCTYPE html>
<html>
@ -5,10 +7,8 @@
<?php require_once __DIR__."/ui/header.php"; ?>
</head>
<body>
<?php
require_once __DIR__."/ui/required.php";
require_once __DIR__."/ui/nav.php";
use App\Account;

View file

@ -1,4 +1,5 @@
<?php
use App\Account;
$loggedin = new Account();
@ -26,3 +27,79 @@ $loggedin = new Account();
?>
</div>
</nav>
<script>
console.log(". . /|/| . . . . . . .\n\
.. /0 0 \\ . . . . . ..\n\
(III% . \\________, . .\n\
.. .\\_, .%###%/ \\'\\,..\n\
. . . .||#####| |'\\ \\.\n\
.. . . ||. . .|/. .\\V.\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . .|| . . || . . .\n\
.. . . ||. . .||. . ..\n\
. . . cc/ . .cc/ . . .");
</script>
<!--
Used by Sniffle to add Notifications
Div can be displayed all time as it has no width or height initself
-->
<div id='sniffle' class='sniffle'></div>
<!--
Div for information flyouts
Controlled by Flyout.js
-->
<div id='flyoutDim' class='flyout-dim'></div>
<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>
<!--
Back to top button
Used to quickly get back up to the top of the page,
At some point will be removed as the UI metures and
everything can always be accessed
-->
<a id="back-to-top" href="#">
<img src="assets/icons/caret-up.svg">
</a>
<script>
button = document.getElementById("back-to-top");
window.onscroll = function() {
scrollFunction()
};
function scrollFunction() {
if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 20) {
button.style.right = "1rem";
} else {
button.style.right = "-2.5rem";
}
}
</script>
<!--
Required so main objects are centered when NAV
is in mobile view
-->
<div class="nav-mobile"></div>

View file

@ -1,56 +1,6 @@
<!--
Used by Sniffle to add Notifications
Div can be displayed all time as it has no width or height initself
-->
<div id='sniffle' class='sniffle'></div>
<!--
Div for information flyouts
Controlled by Flyout.js
-->
<div id='flyoutDim' class='flyout-dim'></div>
<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>
<!--
Back to top button
Used to quickly get back up to the top of the page,
At some point will be removed as the UI metures and
everything can always be accessed
-->
<a id="back-to-top" href="#">
<img src="assets/icons/caret-up.svg">
</a>
<script>
button = document.getElementById("back-to-top");
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 20) {
button.style.right = "1rem";
} else {
button.style.right = "-2.5rem";
}
}
</script>
<!--
Required so main objects are centered when NAV
is in mobile view
-->
<div class="nav-mobile"></div>
<?php
/*
User defined settings
*/
require_once dirname(__DIR__)."/app/server/conn.php";
require_once dirname(__DIR__)."/app/app.php";
require_once dirname(__DIR__)."/app/settings/settings.php";
ini_set('post_max_size', $user_settings['upload_max']."M");
@ -60,22 +10,4 @@ if ($user_settings['is_testing'] == "true") {
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ERROR | E_PARSE | E_NOTICE);
?>
<script>
sniffleAdd('Notice', 'This website is currently in a testing state', 'var(--red)', 'assets/icons/cross.svg');
</script>
<?php
}
/*
Connect to the server
*/
require_once dirname(__DIR__)."/app/server/conn.php";
require_once dirname(__DIR__)."/app/server/secrete.php";
/*
Classes
*/
require_once dirname(__DIR__)."/app/app.php";
?>

View file

@ -1,12 +1,43 @@
<?php require_once __DIR__."/ui/required.php"; ?>
<!DOCTYPE html>
<html>
<head>
<?php require_once __DIR__."/ui/header.php"; ?>
</head>
<body>
<?php
require_once __DIR__."/ui/nav.php";
use App\Account;
$user_info = new Account();
// Check if user is logged in
if (!$user_info->is_loggedin()) {
?>
<script>
sniffleAdd('Who are you!', 'You must be loggedin to upload things, sowwy!', 'var(--red)', 'assets/icons/cross.svg');
</script>
<?php
}
?>
<div class="upload-root">
<h2>Upload image</h2>
<p>In this world you have 2 choices, to upload a really cute picture of an animal or fursuit, or something other than those 2 things.</p>
<br>
<form id="uploadSubmit" class="flex-down between" method="POST" enctype="multipart/form-data">
<input id="image" class="btn btn-neutral" type="file" placeholder="select image UwU">
<textarea id="alt" class="btn btn-neutral" placeholder="Description/Alt for image" rows="3"></textarea>
<textarea id="tags" class="btn btn-neutral" placeholder="Tags, seperated by white-space" rows="3"></textarea>
<br>
<button id="submit" class="btn btn-good" type="submit"><img class="svg" src="assets/icons/upload.svg">Upload Image</button>
</form>
</div>
<!-- Upload Script -->
<script>
$(document).ready(function() {
$("#uploadSubmit").submit(function(event) {
event.preventDefault();
// Check if image avalible
@ -49,40 +80,7 @@
sniffleAdd('Gwha!', 'Pls provide image', 'var(--red)', 'assets/icons/file-search.svg');
}
});
});
</script>
</head>
<body>
<?php
require_once __DIR__."/ui/required.php";
require_once __DIR__."/ui/nav.php";
use App\Account;
$user_info = new Account();
// Check if user is logged in
if (!$user_info->is_loggedin()) {
?>
<script>
sniffleAdd('Who are you!', 'You must be loggedin to upload things, sowwy!', 'var(--red)', 'assets/icons/cross.svg');
</script>
<?php
}
?>
<div class="upload-root">
<h2>Upload image</h2>
<p>In this world you have 2 choices, to upload a really cute picture of an animal or fursuit, or something other than those 2 things.</p>
<br>
<form id="uploadSubmit" class="flex-down between" method="POST" enctype="multipart/form-data">
<input id="image" class="btn btn-neutral" type="file" placeholder="select image UwU">
<textarea id="alt" class="btn btn-neutral" placeholder="Description/Alt for image" rows="3"></textarea>
<textarea id="tags" class="btn btn-neutral" placeholder="Tags, seperated by white-space" rows="3"></textarea>
<br>
<button id="submit" class="btn btn-good" type="submit"><img class="svg" src="assets/icons/upload.svg">Upload Image</button>
</form>
</div>
<?php require_once __DIR__."/ui/footer.php"; ?>
</body>