Fixing broken looking UI when no images present

This commit is contained in:
Michał Gdula 2022-09-29 11:27:44 +00:00
parent 8cb2fea9cd
commit afdaab4e13
4 changed files with 68 additions and 48 deletions

View file

@ -182,6 +182,10 @@
<?php
if (empty($group['image_list']) && $_GET['mode'] != "edit" && !empty($_GET['id'])) {
echo "<div class='info-text defaultFonts'>
<h1>Nothing here!</h1>
<p>There are no images in the group, add some!</p>
</div>";
echo "<div id='gallery' class='gallery-root defaultDecoration' style='display: none;'>";
} else {
echo "<div id='gallery' class='gallery-root defaultDecoration' >";

View file

@ -101,7 +101,7 @@
?>
<style>
.image-container, .fullscreen-image {
background-color: <?php echo $image_colour; ?>55 !important;
background-color: <?php echo $image_colour; ?>33 !important;
}
</style>
<?php

View file

@ -46,7 +46,13 @@
}
?>
<div class="info-text defaultFonts">
<?php
// Reading images from table
$image_request = mysqli_query($conn, "SELECT * FROM images ORDER BY id DESC");
if (!empty($image_request)) {
?>
<div class="info-text defaultFonts">
<?php
// Set time for message
$time = date("H");
@ -72,12 +78,10 @@
$welcome_message = $user_settings['welcome_msg'];
echo "<p>".$welcome_message[array_rand($welcome_message, 1)]."</p>";
?>
</div>
<div class="gallery-root defaultDecoration">
</div>
<?php
// Reading images from table
$image_request = mysqli_query($conn, "SELECT * FROM images ORDER BY id DESC");
echo "<div class='gallery-root defaultDecoration'>";
while ($image = mysqli_fetch_array($image_request)) {
// Getting thumbnail
@ -99,8 +103,15 @@
</div>";
}
}
echo "</div>";
} else {
echo "<div class='info-text defaultFonts'>
<h1>Nothing here!</h1>
<p>There are no images in the gallery, upload some!</p>
</div>";
}
?>
</div>
<?php require_once __DIR__."/assets/ui/footer.php"; ?>
</body>

View file

@ -44,6 +44,11 @@
.profile-root {
background-image: linear-gradient(to right, <?php echo $pfp_colour; ?>, var(--bg-3), var(--bg-3)) !important;
}
@media (max-width: 669px) {
.profile-root {
background-image: linear-gradient(to bottom, <?php echo $pfp_colour; ?>, var(--bg-3)) !important;
}
}
</style>
<?php
} else {