summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-06-25 00:16:32 +0500
committerilotterytea <iltsu@alright.party>2025-06-25 00:16:32 +0500
commita60c9f70d3a493d63c288a671f32db409c2da929 (patch)
treed83f4a8667573b34ff33187b8a1a36286dd1f65b /public
parent17cdae613d339d31aacabfd232fdd9f67bea6c3a (diff)
upd: pixel thumbnails
Diffstat (limited to 'public')
-rw-r--r--public/catalogue.php14
-rw-r--r--public/index.php4
-rw-r--r--public/static/style.css6
3 files changed, 16 insertions, 8 deletions
diff --git a/public/catalogue.php b/public/catalogue.php
index 764b7d2..817cba2 100644
--- a/public/catalogue.php
+++ b/public/catalogue.php
@@ -81,16 +81,16 @@ unset($f);
<img src="<?= sprintf('%s/%s.webp', FILE_THUMBNAIL_DIRECTORY_PREFIX, $file['id']) ?>"
alt="No thumbnail." loading="lazy">
<?php elseif (str_starts_with($file['mime'], 'audio/')): ?>
- <img src="/static/img/icons/file_audio.png" alt="No thumbnail." loading="lazy" width="64"
- height="64">
+ <img src="/static/img/icons/file_audio.png" alt="No thumbnail." loading="lazy"
+ class="thumbnail stock">
<?php elseif (str_starts_with($file['mime'], 'text/')): ?>
- <img src="/static/img/icons/file_text.png" alt="No thumbnail." loading="lazy" width="64"
- height="64">
+ <img src="/static/img/icons/file_text.png" alt="No thumbnail." loading="lazy"
+ class="thumbnail stock">
<?php elseif ($file['mime'] == 'application/x-shockwave-flash'): ?>
- <img src="/static/img/icons/file_flash.png" alt="No thumbnail." loading="lazy" width="64"
- height="64">
+ <img src="/static/img/icons/file_flash.png" alt="No thumbnail." loading="lazy"
+ class="thumbnail stock">
<?php else: ?>
- <img src="/static/img/icons/file.png" alt="No thumbnail." width="64" height="64">
+ <img src="/static/img/icons/file.png" alt="No thumbnail." class="thumbnail stock">
<?php endif; ?>
</i>
</a>
diff --git a/public/index.php b/public/index.php
index 4d912c3..2e37828 100644
--- a/public/index.php
+++ b/public/index.php
@@ -655,6 +655,7 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt');
<?php if (FILE_THUMBNAILS): ?>
let thumbnailPath = `<?= FILE_THUMBNAIL_DIRECTORY_PREFIX ?>/${file.id}.webp`;
let thumbnailSize = "width: 64px; height: 64px;";
+ let thumbnailClass = "thumbnail stock";
if (file.mime.startsWith('audio/')) {
thumbnailPath = '/static/img/icons/file_audio.png';
} else if (file.mime.startsWith('text/')) {
@@ -665,6 +666,7 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt');
thumbnailPath = '/static/img/icons/file.png';
} else {
thumbnailSize = 'max-width:100%; max-height: 100%;';
+ thumbnailClass = "thumbnail";
}
<?php endif; ?>
@@ -673,7 +675,7 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt');
<?php if (FILE_THUMBNAILS): ?>
<div class="column align-center justify-center grow">
<div class="column justify-center align-center" style="width: 128px; height:128px;">
- <p><i><img src="${thumbnailPath}" alt="No thumbnail." style="${thumbnailSize}" loading="lazy"></i></p>
+ <p><i><img src="${thumbnailPath}" alt="No thumbnail." style="${thumbnailSize}" loading="lazy" class="${thumbnailClass}"></i></p>
</div>
</div>
<?php endif; ?>
diff --git a/public/static/style.css b/public/static/style.css
index 6f86e77..efa1dc2 100644
--- a/public/static/style.css
+++ b/public/static/style.css
@@ -286,6 +286,12 @@ button[type=submit].fancy:hover {
align-self: flex-end;
}
+.thumbnail.stock {
+ width: 64px;
+ height: 64px;
+ image-rendering: pixelated;
+}
+
/** FILE CATALOG (WALL) */
.wall {
display: flex;