feat: add customizable Nitro client loading overlay with Filament settings

Add full Client Login Effect section to Theme & Buttons page with:
- Enable toggle, 30+ animation effects, customizable colors/logo/text
- 6 loading bar styles (sliding, dots, pulse, double, spinner, skeleton)
- Optimized to single DB query via WebsiteSetting::whereIn
- Overlay covers Nitro v3 internal loading (5s min, 15s fallback)
This commit is contained in:
root
2026-05-22 21:09:33 +02:00
parent c53d1bca45
commit 76bce1d092
5 changed files with 875 additions and 31 deletions
@@ -3,6 +3,7 @@
namespace App\Http\Controllers\Client;
use App\Http\Controllers\Controller;
use App\Models\Miscellaneous\WebsiteSetting;
use Illuminate\View\View;
class NitroController extends Controller
@@ -23,8 +24,34 @@ class NitroController extends Controller
$sso = $user->ssoTicket();
$keys = [
'login_effect_enabled', 'login_effect_animation', 'login_effect_background',
'login_effect_icon_color', 'login_effect_text_color', 'login_effect_bar_color',
'login_effect_bar_style', 'login_effect_icon_size', 'login_effect_show_logo',
'login_effect_show_name', 'login_effect_custom_text',
];
$settings = WebsiteSetting::whereIn('key', $keys)->pluck('value', 'key');
$loginData = null;
if (($settings['login_effect_enabled'] ?? '0') === '1') {
$loginData = [
'animation' => $settings['login_effect_animation'] ?? 'none',
'background' => $settings['login_effect_background'] ?? '#0f1922',
'icon_color' => $settings['login_effect_icon_color'] ?? '#eeb425',
'text_color' => $settings['login_effect_text_color'] ?? '#ffffff',
'bar_color' => $settings['login_effect_bar_color'] ?? '#eeb425',
'bar_style' => $settings['login_effect_bar_style'] ?? 'bar',
'icon_size' => $settings['login_effect_icon_size'] ?? '120',
'show_logo' => ($settings['login_effect_show_logo'] ?? '0') === '1',
'show_name' => ($settings['login_effect_show_name'] ?? '0') === '1',
'custom_text' => $settings['login_effect_custom_text'] ?? '',
];
}
return view('client.' . $view, [
'sso' => $sso,
'loginData' => $loginData,
]);
}
}