From 2762007f636d5e9c2abb186a7f857c2491db3dd5 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 22 Jun 2025 18:07:59 +0500 Subject: feat: show different mini.webp --- lib/partials.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'lib/partials.php') 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 '' ?> -