diff options
| author | ilotterytea <iltsu@alright.party> | 2025-05-29 04:09:50 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-05-29 04:09:50 +0500 |
| commit | 4accc6b67322ffa27f1843c8d526b4e8d5dd81bf (patch) | |
| tree | 400ae4de6ccb2022bd54b649be42f93f2f604ee8 /lib | |
| parent | d2b23ec0e689ae9d49d21a9299c6010933fedf37 (diff) | |
upd: use GB when showing overall file size
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/partials.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/partials.php b/lib/partials.php index 25c6632..13ea156 100644 --- a/lib/partials.php +++ b/lib/partials.php @@ -6,7 +6,9 @@ function html_big_navbar() echo '' ?> <section class="column justify-center align-center navbar"> <div class="column justify-center grow"> - <h1><img src="/static/img/brand/big.webp" alt="<?= INSTANCE_NAME ?>"></h1> + <a href="/"> + <h1><img src="/static/img/brand/big.webp" alt="<?= INSTANCE_NAME ?>"></h1> + </a> </div> <div class="row justify-center"> @@ -25,7 +27,15 @@ function html_footer() $file_size += filesize($file); } - $file_size /= 1024 * 1024; + $suffix = 'MB'; + $file_size /= 1024 * 1024; // MB + + if ($file_size >= 1024) { + $file_size /= 1024; + $suffix = 'GB'; + } + + $file_size = sprintf('%.2f%s', $file_size, $suffix); echo '' ?> <footer class="column justify-center align-center gap-8"> @@ -42,7 +52,7 @@ function html_footer() </ul> </div> <?php endif; ?> - <p>Serving <?= count($files) ?> files and <?= sprintf("%.2f", $file_size) ?>MB of active content</p> + <p>Serving <?= count($files) ?> files and <?= $file_size ?> of active content</p> </footer> <?php ; }
\ No newline at end of file |
