Ajusting Sass and compressing profile pictures

This commit is contained in:
Michał 2022-09-22 21:19:26 +00:00
parent bc7dfb481a
commit 37b1f94575
4 changed files with 28 additions and 17 deletions

View file

@ -4,7 +4,9 @@ include dirname(__DIR__)."/server/conn.php";
include dirname(__DIR__)."/app.php";
use App\Account;
use App\Make;
$make_stuff = new Make();
$user_info = new Account();
$user_ip = $user_info->get_ip();
@ -790,6 +792,14 @@ if (isset($_POST['pfp_submit'])) {
// Move file to server
if (move_uploaded_file($_FILES['image']['tmp_name'], $image_path)) {
if ($make_stuff->thumbnail($image_path, $image_path, 300) != "success") {
?>
<script>
sniffleAdd('Gwha!', 'We hit a small roadbump while compressing your profile picture', 'var(--black)', 'assets/icons/bug.svg');
</script>
<?php
}
$sql = "UPDATE users SET pfp_path = '$image_newname' WHERE id=".$_SESSION['id'];
if (mysqli_query($conn, $sql)) {

View file

@ -748,8 +748,8 @@ nav .btn {
}
.pfp-upload > img {
margin-left: 0.5rem;
width: 7.8rem;
height: 7.8rem;
width: 7.813rem;
height: 7.813rem;
-o-object-fit: cover;
object-fit: cover;
border-radius: -0.3rem;
@ -769,6 +769,8 @@ nav .btn {
}
.pfp-upload > img {
margin: 0 auto 1rem;
width: 10rem;
height: 10rem;
}
}
.account-root {
@ -778,7 +780,7 @@ nav .btn {
background-color: #151515;
color: #E8E3E3;
border-radius: 0.4rem;
border: 0.2rem solid #8C977D;
border: 0.2rem solid #B66467;
box-shadow: 6px 6px 2px rgba(21, 21, 21, 0.4);
}
.account-root > * {
@ -859,7 +861,7 @@ nav .btn {
}
.log {
min-width: 769px;
min-width: 850px;
padding: 0.5rem;
display: flex;
flex-direction: row;
@ -906,7 +908,7 @@ nav .btn {
}
.ban {
min-width: 769px;
min-width: 900px;
padding: 0.5rem;
display: flex;
flex-direction: row;
@ -960,7 +962,7 @@ nav .btn {
}
.user {
min-width: 769px;
min-width: 950px;
padding: 0.5rem;
display: flex;
flex-direction: row;

View file

@ -500,8 +500,8 @@
& > img {
margin-left: 0.5rem;
width: 7.8rem;
height: 7.8rem;
width: 7.813rem;
height: 7.813rem;
object-fit: cover;
@ -524,12 +524,15 @@
& > img {
margin: 0 auto 1rem;
width: 10rem;
height: 10rem;
}
}
}
.account-root {
@include defaultDecoration($page-accent);
@include defaultDecoration($red);
@include defaultFont();
}
.admin-root {
@ -566,7 +569,7 @@
border-radius: calc($rad - 0.7rem);
}
.log {
min-width: 769px;
min-width: 850px;
padding: 0.5rem;
@ -618,7 +621,7 @@
border-radius: calc($rad - 0.7rem);
}
.ban {
min-width: 769px;
min-width: 900px;
padding: 0.5rem;
@ -676,7 +679,7 @@
border-radius: calc($rad - 0.7rem);
}
.user {
min-width: 769px;
min-width: 950px;
padding: 0.5rem;

View file

@ -18,11 +18,7 @@
$diff = new Diff();
if (!isset($_GET['user']) || empty($_GET['user'])) {
?>
<script>
sniffleAdd("Success", "Error", "var(--green)", "assets/icons/trash.svg");
</script>
<?php
header("Location: index.php");
} elseif (isset($_GET['user'])) {
$user = $user_info->get_user_info($conn, $_GET['user']);