summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-06-21 00:41:27 +0500
committerilotterytea <iltsu@alright.party>2025-06-21 00:41:27 +0500
commitfd6f5c28af20cb6c08a2c062e330d1af54e36c87 (patch)
treee2a9e12e5899632bab9248d927d6e8204d1a9b0e /public
parent721c047a069e956001f75c61820ae43da510f5a5 (diff)
upd: file preview design
Diffstat (limited to 'public')
-rw-r--r--public/index.php39
-rw-r--r--public/static/style.css9
2 files changed, 23 insertions, 25 deletions
diff --git a/public/index.php b/public/index.php
index d09aeab..d6ad180 100644
--- a/public/index.php
+++ b/public/index.php
@@ -128,7 +128,8 @@ if (FILE_CATALOG_FANCY_VIEW && $file_id) {
}
if (isset($file['duration'])) {
- array_push($file['resolution'], format_timestamp(new DateTime()->setTimestamp(time() + $file['duration'])));
+ $dur = format_timestamp(new DateTime()->setTimestamp(time() + $file['duration']));
+ array_push($file['resolution'], empty($file['resolution']) ? $dur : "($dur)");
}
if (isset($file['line_count'])) {
@@ -171,26 +172,7 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt');
</noscript>
<?php if ($file): ?>
- <div class="row">
- <?php html_mini_navbar() ?>
- <div class="font-small column grow justify-end align-bottom">
- <div class="row gap-8 grow align-bottom">
- <p title="<?= $file['size'] ?>B"><?= $file['size_formatted'] ?></p>
- <p><?= $file['mime'] ?> &#40;<?= $file['extension'] ?>&#41;</p>
- <?php if (isset($file['resolution'])): ?>
- <p><?= $file['resolution'] ?></p>
- <?php endif; ?>
- </div>
- <div class="row gap-8 grow align-bottom">
- <p>Uploaded <?= format_timestamp($file['uploaded_at']) ?> ago</p>
- </div>
- <div class="row gap-8 grow align-bottom">
- <?php if (FILE_COUNT_VIEWS && isset($file['views'])): ?>
- <p><?= $file['views'] ?> views</p>
- <?php endif; ?>
- </div>
- </div>
- </div>
+ <?php html_mini_navbar() ?>
<?php display_alert() ?>
@@ -208,7 +190,7 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt');
<?php if ($file_exists): ?>
<section class="file-preview-wrapper">
<section class="box">
- <div class="tab row gap-8">
+ <div class="tab row wrap gap-8">
<div class="grow">
<?php if (isset($file['title'])): ?>
<p><i><?= $file['title'] ?></i></p>
@@ -260,7 +242,20 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt');
<p><i>This file cannot be displayed.</i></p>
<?php endif; ?>
</div>
+
</section>
+
+ <div class="font-small row wrap justify-end gap-16 align-bottom">
+ <p title="<?= $file['size'] ?>B"><?= $file['size_formatted'] ?></p>
+ <p><?= $file['mime'] ?> &#40;<?= $file['extension'] ?>&#41;</p>
+ <?php if (isset($file['resolution'])): ?>
+ <p><?= $file['resolution'] ?></p>
+ <?php endif; ?>
+ <p title="<?= $file['uploaded_at'] ?>">Uploaded <?= format_timestamp($file['uploaded_at']) ?> ago</p>
+ <?php if (FILE_COUNT_VIEWS && isset($file['views'])): ?>
+ <p><?= $file['views'] ?> views</p>
+ <?php endif; ?>
+ </div>
</section>
<?php endif; ?>
<?php else: ?>
diff --git a/public/static/style.css b/public/static/style.css
index 1d640a3..d11ca82 100644
--- a/public/static/style.css
+++ b/public/static/style.css
@@ -245,9 +245,8 @@ button[type=submit].fancy:hover {
/** FILES */
.file-preview-wrapper {
display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: center;
+ flex-direction: column;
+ gap: 16px;
}
.file-preview-wrapper>.box {
@@ -314,6 +313,10 @@ button[type=submit].fancy:hover {
flex-grow: 1;
}
+.wrap {
+ flex-wrap: wrap;
+}
+
.grid {
display: grid;
}