From e28157de3c39832c8b6912577b0ca4f0939d8739 Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Fri, 16 Sep 2022 16:39:13 +0000 Subject: [PATCH] In progress admin page --- Flyout/.flyout.css.swp | Bin 12288 -> 0 bytes Sniffle/sniffle.css | 21 ++---- account.php | 108 ++++++++++++++++++++++++++++- app/account/account.php | 57 +++++++++++++++ app/app.php | 11 ++- app/image/image.php | 8 +-- assets/icons/arrow-clockwise.svg | 1 + assets/icons/arrows-out-simple.svg | 1 + assets/icons/scan.svg | 1 + css/main.css | 90 ++++++++++++++++++++++-- css/scss/_body.scss | 93 +++++++++++++++++++++++-- image.php | 8 +-- ui/nav.php | 2 +- 13 files changed, 364 insertions(+), 37 deletions(-) delete mode 100644 Flyout/.flyout.css.swp create mode 100644 assets/icons/arrow-clockwise.svg create mode 100644 assets/icons/arrows-out-simple.svg create mode 100644 assets/icons/scan.svg diff --git a/Flyout/.flyout.css.swp b/Flyout/.flyout.css.swp deleted file mode 100644 index c09233443a2d9229763897d8abdfc9703f2d30cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2yN=U96ov;1B(&TFRL~qiNLjQ_>@17GDG^8%bX+SmwkPp`;|ca;y%!-0cn?54 z2NFC1E9emgh>n7ai$MJ2I2*)ek?4?)qfcIY&YU^(&7_ESBLB*Ti*&jj2weMwFt6T6 zM-T20FAob*7-QY*zg?AzJgZ8p^TC#(on={cs;cUwc9?Zsj~nIftaCnFHDlZ9*SB_D zmRly_MmE3({?Wj0vDgiK*ZJ7dBXnT@<$uh>-PiydU;}J`4X^<=zy{a=8~7g$*wHp| z7lm(cieGH*+kUz?k9=bTY=8~00XDz}*Z><~18jf|umLu}2L3|>G7;j)oDe&Ap?LiN zfBO6X!(Jg?f*0T!cnThZ2jD)q2NDp2%it3DvPXzd;3IesHo$Z60BDecbD#yj?H1xI zcnvndb6`OUu7CjS0lUB)_>B7Afw$ld*Z@z!WAF%E2WP=a&;^IU9B}j64)|gNY=8~0 z0XDz}*Z><~18kr+aA$G}qDm(=4M~oz>52B_K&~fat4$u66*_^>y0|k741E9i?*rFG z=LB6fMV6FQrrNs0zEqjwmMqLTPskdQG%8G#sUcmUR4yyZ4aM15QEDpJ-q#qhQxAv1 zy;85?d~ryTDH2t9c-2E8i7rQ(Tn$O*na&J(o~(iwNvLk;DMmnuC-k*4drjx>F&cN`6Mz8MhI0m$rnHT&{ZH^9P8 zcPWaCTW$xEM~n4hP23J;G0^bp_h=-Oq~0`>#oS!;>0}1sbcHREXFFwICb0X<*#b%fX(kfZrnEj!!^DjXSte5c8}?% K1254-c=!&($9%m2 diff --git a/Sniffle/sniffle.css b/Sniffle/sniffle.css index 369fe4c..10b9686 100644 --- a/Sniffle/sniffle.css +++ b/Sniffle/sniffle.css @@ -45,6 +45,8 @@ border-radius: var(--rad); + transition: margin-top 1s cubic-bezier(.19,1,.22,1); + -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; @@ -53,12 +55,10 @@ user-select: none; } .sniffle-notification:hover { - transform: scale(1.05); - cursor: pointer; } -.sniffle-notification:not(:nth-of-type(1), :nth-of-type(2), :nth-of-type(3), :nth-of-type(4), :nth-of-type(5)) { +.sniffle-notification:not(:nth-of-type(1), :nth-of-type(2), :nth-of-type(3), :nth-of-type(4)) { display: none; opacity: 0; } @@ -71,30 +71,23 @@ .sniffle-notification:nth-of-type(2) { z-index: -1; transform: scale(0.95); - margin-top: -5rem; + margin-top: -4.8rem; opacity: 1; transition: transform 1.25s, opacity 0.5s; } .sniffle-notification:nth-of-type(3) { z-index: -2; transform: scale(0.9); - margin-top: -5rem; + margin-top: -4.8rem; opacity: 1; transition: transform 1.5s, opacity 0.75s; } .sniffle-notification:nth-of-type(4) { z-index: -3; transform: scale(0.85); - margin-top: -5rem; - opacity: 1; - transition: transform 1.75s, opacity 1s; -} -.sniffle-notification:nth-of-type(5) { - z-index: -4; - transform: scale(0.80); - margin-top: -5rem; + margin-top: -4.8rem; opacity: 0; - transition: transform 2s, opacity 1.25s; + transition: transform 1.75s, opacity 1s; } /* diff --git a/account.php b/account.php index 2a6f505..1cf3bc7 100644 --- a/account.php +++ b/account.php @@ -30,7 +30,7 @@ Logout is_admin($_SESSION['id'])) { + if ($user_info->is_admin($conn, $_SESSION['id'])) { ?>

Admin controlls

@@ -52,6 +52,12 @@

Logs

+
+

ID

+

User IP

+

Action

+

Time

+

Bans

+
+

ID

+

User IP

+

Reason

+

Lenght

+

Time

+
mins

" . $log_time->format('Y-m-d H:i:s T') . "
" . $diff->time($ban['time']) . "

"; + echo "

" . $log_time->format('Y-m-d H:i:s T') . " | " . $diff->time($ban['time']) . "

"; ?>
+
+

User settings

+
+ + + + + + get_image_info($conn, $_POST['id']); // If user owns image or has the ID of 1 - if ($image_info->image_privilage($image_array['author']) || $_SESSION['id'] == 1) { + if ($image_info->image_privilage($image_array['author']) || $user_info->is_admin($conn, $_SESSION['id'])) { // Delete from table $sql = "DELETE FROM images WHERE id = ?"; if ($stmt = mysqli_prepare($conn, $sql)) { @@ -101,7 +101,7 @@ if (isset($_POST['submit_description'])) { // Get all image info $image_array = $image_info->get_image_info($conn, $_POST['id']); // If user owns image or has the ID of 1 - if ($image_info->image_privilage($image_array['author']) || $_SESSION['id'] == 1) { + if ($image_info->image_privilage($image_array['author']) || $user_info->is_admin($conn, $_SESSION['id'])) { // getting ready forSQL asky asky $sql = "UPDATE images SET alt=? WHERE id=?"; @@ -159,7 +159,7 @@ if (isset($_POST['submit_tags'])) { // Get all image info $image_array = $image_info->get_image_info($conn, $_POST['id']); // If user owns image or has the ID of 1 - if ($image_info->image_privilage($image_array['author']) || $_SESSION['id'] == 1) { + if ($image_info->image_privilage($image_array['author']) || $user_info->is_admin($conn, $_SESSION['id'])) { // Clean input $tags_string = $make_stuff->tags(trim($_POST['input'])); @@ -218,7 +218,7 @@ if (isset($_POST['submit_tags'])) { */ if (isset($_POST['submit_author'])) { // If user has the ID of 1 - if ($user_info->is_admin($_SESSION['id'])) { + if ($user_info->is_admin($conn, $_SESSION['id'])) { // getting ready forSQL asky asky $sql = "UPDATE images SET author=? WHERE id=?"; diff --git a/assets/icons/arrow-clockwise.svg b/assets/icons/arrow-clockwise.svg new file mode 100644 index 0000000..08457f9 --- /dev/null +++ b/assets/icons/arrow-clockwise.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/arrows-out-simple.svg b/assets/icons/arrows-out-simple.svg new file mode 100644 index 0000000..17e103d --- /dev/null +++ b/assets/icons/arrows-out-simple.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/icons/scan.svg b/assets/icons/scan.svg new file mode 100644 index 0000000..fd3f518 --- /dev/null +++ b/assets/icons/scan.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/css/main.css b/css/main.css index 5f3ae54..0ec690c 100644 --- a/css/main.css +++ b/css/main.css @@ -328,6 +328,8 @@ nav .btn { } .preview-button { + width: 1.5rem; + padding: 0; position: absolute; bottom: 0.5rem; right: 0.5rem; @@ -344,6 +346,10 @@ nav .btn { opacity: 0.8; box-shadow: 6px 6px 2px rgba(21, 21, 21, 0.4); } +.preview-button img { + width: 1.5rem; + display: block; +} .preview-button:hover { outline: #E8E3E3 0.2rem solid; color: #E8E3E3; @@ -650,7 +656,7 @@ nav .btn { flex-direction: row; justify-content: space-between; } -.log:nth-child(odd) { +.log:nth-child(even) { background-color: rgba(255, 255, 255, 0.0666666667); } .log > * { @@ -669,6 +675,14 @@ nav .btn { } .log > *:nth-child(4) { width: 40%; + margin: 0; +} + +.log:first-of-type { + background-color: #151515; + position: -webkit-sticky; + position: sticky; + top: 0; } .bans { @@ -690,7 +704,7 @@ nav .btn { flex-direction: row; justify-content: space-between; } -.ban:nth-child(odd) { +.ban:nth-child(even) { background-color: rgba(255, 255, 255, 0.0666666667); } .ban > * { @@ -705,17 +719,83 @@ nav .btn { width: 17%; } .ban > *:nth-child(3) { - width: 38%; + width: 34%; } .ban > *:nth-child(4) { width: 10%; } .ban > *:nth-child(5) { - width: 30%; + width: 34%; + margin: 0; } .perm { - border: 1px #B66467 solid; + border: 3px #B66467 solid; +} + +.ban:first-of-type { + background-color: #151515; + position: -webkit-sticky; + position: sticky; + top: 0; +} + +.user-settings { + width: 100%; + max-height: 21rem; + min-height: auto; + padding: 0; + overflow-y: scroll; + display: flex; + flex-direction: column; + background-color: #151515; + border-radius: calc(0.25rem - (0.5rem + 3px)); +} + +.user { + min-width: 769px; + padding: 0.5rem; + display: flex; + flex-direction: row; + justify-content: space-between; +} +.user:nth-child(even) { + background-color: rgba(255, 255, 255, 0.0666666667); +} +.user > * { + margin: 0 0.5rem 0 0; + padding: 0; + word-wrap: break-word; +} +.user > *:nth-child(1) { + width: 5%; +} +.user > *:nth-child(2) { + width: 15%; +} +.user > *:nth-child(3) { + width: 35%; +} +.user > *:nth-child(4) { + width: 15%; +} +.user > *:nth-child(5) { + width: 15%; +} +.user > *:nth-child(6) { + width: 15%; + margin: 0; +} + +.is-admin { + background-color: #8C977D !important; +} + +.user:first-of-type { + background-color: #151515; + position: -webkit-sticky; + position: sticky; + top: 0; } .signup-root { diff --git a/css/scss/_body.scss b/css/scss/_body.scss index 053d2bf..8ae5521 100644 --- a/css/scss/_body.scss +++ b/css/scss/_body.scss @@ -207,6 +207,10 @@ } .preview-button { + width: 1.5rem; + + padding: 0; + position: absolute; bottom: 0.5rem; right: 0.5rem; @@ -231,6 +235,12 @@ box-shadow: $shadow; + img { + width: 1.5rem; + + display: block; + } + &:hover { outline: $white 0.2rem solid; color: $fg; @@ -369,7 +379,7 @@ justify-content: space-between; - &:nth-child(odd) { + &:nth-child(even) { background-color: #ffffff11; } @@ -389,9 +399,15 @@ } &:nth-child(4) { width: 40%; + margin: 0; } } } +.log:first-of-type { + background-color: $bg; + position: sticky; + top: 0; +} .bans { width: 100%; @@ -415,7 +431,7 @@ justify-content: space-between; - &:nth-child(odd) { + &:nth-child(even) { background-color: #ffffff11; } @@ -431,18 +447,85 @@ width: 17%; } &:nth-child(3) { - width: 38%; + width: 34%; } &:nth-child(4) { width: 10%; } &:nth-child(5) { - width: 30%; + width: 34%; + margin: 0; } } } .perm { - border: 1px $red solid; + border: 3px $red solid; +} +.ban:first-of-type { + background-color: $bg; + position: sticky; + top: 0; +} + +.user-settings { + width: 100%; + max-height: 21rem; min-height: auto; + + padding: 0; + + overflow-y: scroll; + + display: flex; flex-direction: column; + + background-color: $bg; + border-radius: calc($rad - (0.5rem + 3px)); +} +.user { + min-width: 769px; + + padding: 0.5rem; + + display: flex; flex-direction: row; + + justify-content: space-between; + + &:nth-child(even) { + background-color: #ffffff11; + } + + & > * { + margin: 0 0.5rem 0 0; + padding: 0; + word-wrap: break-word; + + &:nth-child(1) { + width: 5%; + } + &:nth-child(2) { + width: 15%; + } + &:nth-child(3) { + width: 35%; + } + &:nth-child(4) { + width: 15%; + } + &:nth-child(5) { + width: 15%; + } + &:nth-child(6) { + width: 15%; + margin: 0; + } + } +} +.is-admin { + background-color: $green !important; +} +.user:first-of-type { + background-color: $bg; + position: sticky; + top: 0; } .signup-root { diff --git a/image.php b/image.php index 0092334..1929a3f 100644 --- a/image.php +++ b/image.php @@ -123,7 +123,7 @@ | Check user privilge |------------------------------------------------------------- */ - if ($image_info->image_privilage($image['author']) || $user_info->is_admin($_SESSION['id'])) { + if ($image_info->image_privilage($image['author']) || $user_info->is_admin($conn, $_SESSION['id'])) { $privilaged = True; } else { $privilaged = False; @@ -132,7 +132,7 @@ if (is_file("images/previews/".$image['imagename'])) { echo "
".$image_alt." - +
"; ?>