diff options
| author | ilotterytea <iltsu@alright.party> | 2025-06-22 18:07:59 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-06-22 18:07:59 +0500 |
| commit | 2762007f636d5e9c2abb186a7f857c2491db3dd5 (patch) | |
| tree | 79b9a3493524573add6ef6a736eb9756bd8f2820 /lib | |
| parent | 9e92e3a47da7d6e3444afa1542fa818dde17570e (diff) | |
feat: show different mini.webp
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/partials.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/partials.php b/lib/partials.php index 1b1b089..d9eaaf5 100644 --- a/lib/partials.php +++ b/lib/partials.php @@ -53,10 +53,23 @@ function html_big_navbar() function html_mini_navbar(string|null $subtitle = null) { + $brand_url = '/static/img/brand/mini.webp'; + $static_folder = '/static/img/brand/mini'; + $brand_folder = $_SERVER['DOCUMENT_ROOT'] . $static_folder; + + if (is_dir($brand_folder)) { + $files = glob("$brand_folder/*.*"); + + if (!empty($files)) { + $file = basename($files[random_int(0, count($files) - 1)]); + $brand_url = "$static_folder/$file"; + } + } + echo '' ?> - <section class="row align-bottom gap-8 navbar"> + <section class="row align-bottom gap-8 navbar wrap"> <a href="/" class="row gap-8 align-bottom" style="text-decoration:none;color:inherit;"> - <img src="/static/img/brand/mini.webp" alt=""> + <img src="<?= $brand_url ?>" alt=""> <div class="column"> <?php if ($subtitle): ?> <p class="font-small"><?= $subtitle ?></p> |
