diff --git a/.gitignore b/.gitignore index dfce3fa..e28a543 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,7 @@ # Dont include user generated content in github repo images/ conf/ - -# CSS map, I don't think its needed for upload... I think? *.map +# Dont include PHPStorm project files .idea/ \ No newline at end of file diff --git a/account.php b/account.php index 20091e7..3e9af78 100644 --- a/account.php +++ b/account.php @@ -262,9 +262,9 @@ if ($user['id'] == 1) { ?> - - - + + + @@ -385,8 +385,8 @@ get_results(); - if (empty($check_sanity) || !isset($check_sanity)) { - echo "

No errors! Lookin' good

"; + if (empty($check_sanity)) { + echo "

No errors! Lookin' good :3

"; } else { ?> ", $result); - echo "

".$result."

"; - } elseif (str_contains($result, "Warning")) { - $result = str_replace("Warning:", "", $result); - echo "

".$result."

"; + if ($result['type'] == 'critical') { + echo "

+ + ".$result['message']." +

"; + } elseif ($result['type'] == 'warning') { + echo "

+ + ".$result['message']." +

"; + } else { + echo "

+ + ".$result['message']." +

"; } } + + echo "
"; } ?> diff --git a/app/app.php b/app/app.php index e1a159a..70e5ea3 100644 --- a/app/app.php +++ b/app/app.php @@ -403,16 +403,16 @@ class Sanity { $results = array(); if (!is_file(__DIR__."/../usr/conf/manifest.json")) { - $results[] = "Critical: manifest.json is missing"; + $results[] = array('type'=>'critical', 'message'=>'manifest.json is missing'); } else { $manifest = json_decode(file_get_contents(__DIR__."/../usr/conf/manifest.json"), true); if (empty($manifest['user_name']) || $manifest['user_name'] == "[your name]") { - $results[] = "Warning: manifest.json is missing your name"; + $results[] = array('type'=>'warning', 'message'=>'manifest.json is missing your name'); } if ($manifest['upload']['rename_on_upload']) { if (empty($manifest['upload']['rename_to'])) { - $results[] = "Critical: manifest.json doesnt know what to rename your files to"; + $results[] = array('type'=>'critical', 'message'=>'manifest.json doesnt know what to rename your files to'); } else { $rename_to = $manifest['upload']['rename_to']; $rename_rate = 0; @@ -426,15 +426,15 @@ class Sanity { if (str_contains($rename_to, '{{username}}') || str_contains($rename_to, '{{userid}}')) $rename_rate += 1; if ($rename_rate < 2) { - $results[] = "Critical: You will encounter errors when uploading images due to filenames, update your manifest.json"; + $results[] = array('type'=>'critical', 'message'=>'You will encounter errors when uploading images due to filenames, update your manifest.json'); } elseif ($rename_rate < 5 && $rename_rate > 2) { - $results[] = "Warning: You may encounter errors when uploading images due to filenames, concider update your manifest.json"; + $results[] = array('type'=>'warning', 'message'=>'You may encounter errors when uploading images due to filenames, concider modifying your manifest.json'); } } } if ($manifest['is_testing']) { - $results[] = "Warning: You are currently in testing mode, errors will be displayed to the user"; + $results[] = array('type'=>'warning', 'message'=>'You are currently in testing mode, errors will be displayed to the user'); } } @@ -446,16 +446,16 @@ class Sanity { $results = array(); if (!is_dir("usr/images")) { - $results[] = "Critical: You need to setup an images folder, follow the guide on the GitHub repo"; + $results[] = array('type'=>'critical', 'message'=>'You need to setup an images folder, follow the guide on the GitHub repo'); } if (!is_dir("usr/images/pfp")) { - $results[] = "Critical: You need to setup an pfp folder, follow the guide on the GitHub repo"; + $results[] = array('type'=>'critical', 'message'=>'You need to setup an pfp folder, follow the guide on the GitHub repo'); } if (!is_dir("usr/images/previews")) { - $results[] = "Critical: You need to setup an previews folder, follow the guide on the GitHub repo"; + $results[] = array('type'=>'critical', 'message'=>'You need to setup an previews folder, follow the guide on the GitHub repo'); } if (!is_dir("usr/images/thumbnails")) { - $results[] = "Critical: You need to setup an thumbnails folder, follow the guide on the GitHub repo"; + $results[] = array('type'=>'critical', 'message'=>'You need to setup an thumbnails folder, follow the guide on the GitHub repo'); } return $results; @@ -476,13 +476,13 @@ class Sanity { $app_repo = json_decode($result, true); if ($app_local['version'] < $app_repo['version']) { - $results[] = "Critical: You are not running the latest version of the app v".$app_repo['version'].""; + $results[] = array('type'=>'critical', 'message'=>'You are not running the latest version of the app v'.$app_repo['version']); } elseif ($app_local['version'] > $app_repo['version']) { - $results[] = "Warning: You are running a version of the app that is newer than the latest release v".$app_repo['version'].""; + $results[] = array('type'=>'critical', 'message'=>'You are running a version of the app that is newer than the latest release v'.$app_repo['version']); } if (PHP_VERSION_ID < 80000) { - $results[] = "Critical: Your current version of PHP is ".PHP_VERSION.". The reccomended version is 8.0.0 or higher"; + $results[] = array('type'=>'warning', 'message'=>'Your current version of PHP is '.PHP_VERSION.' The reccomended version is 8.0.0 or higher'); } return $results; diff --git a/app/image/group.php b/app/image/group.php index b797037..f6b23dc 100644 --- a/app/image/group.php +++ b/app/image/group.php @@ -124,7 +124,7 @@ if (isset($_POST['title_submit'])) { |------------------------------------------------------------- */ if (isset($_POST['new_group_submit'])) { - if ($user_info->is_loggedin()) { + if ($user_info->is_loggedin($conn)) { $group_name = "New Group"; $sql = "INSERT INTO groups (group_name, author, image_list) VALUES('$group_name', '".$_SESSION['id']."', '')"; diff --git a/assets/icons/wrench.svg b/assets/icons/wrench.svg new file mode 100644 index 0000000..8534939 --- /dev/null +++ b/assets/icons/wrench.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/css/main.css b/css/main.css index ff878b9..0af3777 100644 --- a/css/main.css +++ b/css/main.css @@ -215,53 +215,22 @@ nav .btn { margin-bottom: 1rem; } -.gallery-order { - margin-bottom: 1rem; - display: flex; - flex-direction: row; -} -.gallery-order h1, -.gallery-order h2, -.gallery-order h3, -.gallery-order h4, -.gallery-order h5 { - font-family: "Lexend Deca", sans-serif; - text-rendering: optimizeLegibility; -} -.gallery-order p, -.gallery-order a, -.gallery-order button, -.gallery-order input { - font-family: "Secular One", sans-serif; - text-rendering: optimizeLegibility; -} -.gallery-order > * { - margin-right: 0.5rem; -} -.gallery-order > *:last-child { - margin-right: 0; -} - .gallery-root { margin-bottom: 1rem; - padding: 0.25rem; - display: flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: none; + padding: 0.5rem; + gap: 0.5rem; + display: grid; + grid-template-columns: auto auto auto auto auto; } .gallery-item { - margin: 0.25rem; + margin: 0; padding: 0; height: auto; - max-width: calc(20% - 0.5rem); - min-width: calc(20% - 0.5rem); background-color: #151515; border-radius: 3px; position: relative; overflow: hidden; - flex: 1 0 150px; transition: transform 0.15s cubic-bezier(0.19, 1, 0.22, 1); } .gallery-item:hover { @@ -279,15 +248,13 @@ nav .btn { } @media (max-width: 800px) { - .gallery-item { - max-width: calc(25% - 0.5rem); - min-width: calc(25% - 0.5rem); + .gallery-root { + grid-template-columns: auto auto auto auto; } } @media (max-width: 550px) { - .gallery-item { - max-width: calc(33.33% - 0.5rem); - min-width: calc(33.33% - 0.5rem); + .gallery-root { + grid-template-columns: auto auto auto; } } .gallery-image { @@ -609,11 +576,9 @@ nav .btn { } .group-make { - margin: 0.25rem; + margin: 0; padding: 0; height: auto; - max-width: calc(20% - 0.5rem); - min-width: calc(20% - 0.5rem); border-radius: 3px; position: relative; overflow: hidden; @@ -1121,6 +1086,41 @@ a.btn { background-image: linear-gradient(to top, #111111, #121212); } +/* + |------------------------------------------------------------- + | ALERTS + |------------------------------------------------------------- +*/ +.alert { + padding: 0.75rem; + width: 100%; + display: block; + box-sizing: border-box; + font-size: 16px; + font-weight: 500; + font-family: "Secular One", sans-serif; + text-decoration: none; + border-left: 0.2rem solid #E8E3E3; + background-color: #151515; + background-repeat: no-repeat; + border-radius: 3px; +} + +.alert-bad { + border-color: #B66467; + background-image: linear-gradient(to right, rgba(182, 100, 103, 0.3), rgba(21, 21, 21, 0)); +} + +.alert-warning { + border-color: #D8A657; + background-image: linear-gradient(to right, rgba(216, 166, 87, 0.3), rgba(21, 21, 21, 0)); +} + +.alert-good { + border-color: #8C977D; + background-image: linear-gradient(to right, rgba(140, 151, 125, 0.3), rgba(21, 21, 21, 0)); +} + /* |------------------------------------------------------------- | FORM SIZING diff --git a/css/main.scss b/css/main.scss index 799cb7d..bd7f300 100644 --- a/css/main.scss +++ b/css/main.scss @@ -146,6 +146,49 @@ a.btn { } +/* + |------------------------------------------------------------- + | ALERTS + |------------------------------------------------------------- +*/ +.alert { + padding: 0.75rem; + + width: 100%; + + display: block; + box-sizing: border-box; + + font-size: 16px; + font-weight: 500; + font-family: $font-body; + + text-decoration: none; + + border-left: $border-thickness solid $fg; + background-color: $bg; + background-repeat: no-repeat; + + @if calc($rad - 0.5rem) > 0 { + border-radius: calc($rad - 0.3rem); + } @else { + border-radius: 3px; + } +} + +.alert-bad { + border-color: $warning; + background-image: linear-gradient(to right, rgba($warning, 0.3), rgba($bg, 0)); +} +.alert-warning { + border-color: $alert; + background-image: linear-gradient(to right, rgba($alert, 0.3), rgba($bg, 0)); +} +.alert-good { + border-color: $page-accent; + background-image: linear-gradient(to right, rgba($page-accent, 0.3), rgba($bg, 0)); +} + /* |------------------------------------------------------------- | FORM SIZING diff --git a/css/scss/_body.scss b/css/scss/_body.scss index bb27111..2726c49 100644 --- a/css/scss/_body.scss +++ b/css/scss/_body.scss @@ -40,36 +40,20 @@ } } -.gallery-order { - @include defaultFont(); - - margin-bottom: 1rem; - - display: flex; - flex-direction: row; - - & > * { - margin-right: 0.5rem; - } - & > *:last-child { - margin-right: 0; - } -} - .gallery-root { margin-bottom: 1rem; - padding: 0.25rem; + padding: 0.5rem; + gap: 0.5rem; - @include flexLeft(none); + display: grid; + grid-template-columns: auto auto auto auto auto; } .gallery-item { - margin: 0.25rem; + margin: 0; padding: 0; height: auto; - max-width: calc(20% - 0.5rem); - min-width: calc(20% - 0.5rem); background-color: $bg; @if calc($rad - 0.5rem) > 0 { @@ -79,11 +63,8 @@ } position: relative; - overflow: hidden; - flex: 1 0 150px; - transition: transform 0.15s cubic-bezier(.19, 1, .22, 1); &:hover { @@ -105,15 +86,13 @@ } @media (max-width: 800px) { - .gallery-item { - max-width: calc(25% - 0.5rem); - min-width: calc(25% - 0.5rem); + .gallery-root { + grid-template-columns: auto auto auto auto; } } @media (max-width: 550px) { - .gallery-item { - max-width: calc(33.33% - 0.5rem); - min-width: calc(33.33% - 0.5rem); + .gallery-root { + grid-template-columns: auto auto auto; } } @@ -544,12 +523,10 @@ } .group-make { - margin: 0.25rem; + margin: 0; padding: 0; height: auto; - max-width: calc(20% - 0.5rem); - min-width: calc(20% - 0.5rem); @if calc($rad - 0.5rem) > 0 { border-radius: calc($rad - 0.5rem); @@ -968,6 +945,7 @@ } .is-admin { border-left: $border; + //background-image: linear-gradient(to right, rgba($page-accent, 0.3), rgba($page-accent, 0)); } .user:first-of-type { background-color: $bg; diff --git a/group.php b/group.php index 6fbb2de..ca1cf64 100644 --- a/group.php +++ b/group.php @@ -254,7 +254,7 @@ "; - } elseif (empty($image_list)) { + } elseif (empty($image_list[0])) { echo "

Nothing here!

There are no images in the group, add some!