@php
try {
$cms = $cms ?? (function_exists('cms') ? (cms() ?? []) : app(\App\Services\CmsSettingsService::class)->get());
} catch (\Throwable $e) {
$cms = $cms ?? [];
}
$variant = $variant ?? 'header';
$b = data_get($cms,'branding',[]);
$a = data_get($cms,'auth',[]);
$useText = data_get($b,'use_text_logo','no') === 'yes';
$logoLocation = \App\Support\BrandLogo::location((string) ($logoLocation ?? $variant));
// Error layouts can reuse a normal header without its theme-default branding.
if (isset($errorPageBranding) && in_array($logoLocation, ['main_menu', 'sticky_menu'], true)) {
$logoLocation = 'error_pages';
}
$logoSurface = $surfaceMode ?? (in_array($variant, ['mobile', 'auth', 'footer'], true) ? 'dark' : 'light');
$img = \App\Support\BrandLogo::url($logoLocation, (array) $cms, $logoSurface);
// image sizing
$w = (int) data_get($b,'logo_width', 0);
$h = (int) data_get($b,'logo_height', 0);
$maxH = (int) data_get($b,'logo_max_height', 42);
$fit = data_get($b,'logo_object_fit', 'contain');
// TEXT LOGO KEYS
$letters = data_get($b,'text_logo_letters','TRA');
$brandName = trim((string) data_get($b, 'brand_name'))
?: trim((string) data_get($b, 'site_name'))
?: 'Trading Platform';
// allow auth overrides for text colors (optional)
$authWordmark = data_get($a,'auth_wordmark_color'); // optional
$authLetters = data_get($a,'auth_letters_color'); // optional
$tpl = data_get($b,'text_logo_template','pill-light');
$shadowOn = data_get($b,'text_logo_shadow','yes') === 'yes';
$showWordmark = data_get($b,'text_logo_show_wordmark','yes') === 'yes';
$badgeSize = (int) data_get($b,'text_logo_badge_size', 44);
$badgeRadius = (int) data_get($b,'text_logo_badge_radius', 14);
$gap = (int) data_get($b,'text_logo_gap', 10);
$border = data_get($b,'text_logo_badge_border','rgba(15,23,42,.10)');
$bg = data_get($b,'text_logo_bg_color','#FFFFFF');
$txt = data_get($b,'text_logo_text_color','#0F172A');
$dot = data_get($b,'text_logo_icon_color','#22C55E');
$wm = data_get($b,'text_logo_wordmark_color','#0F172A');
if($variant === 'auth'){
if($authWordmark) $wm = $authWordmark;
if($authLetters) $txt = $authLetters;
}
$gradFrom = data_get($b,'text_logo_gradient_from','#F59E0B');
$gradTo = data_get($b,'text_logo_gradient_to','#22C55E');
$lettersSize = (int) data_get($b,'text_logo_letters_size', 16);
$lettersWeight = (int) data_get($b,'text_logo_letters_weight', 900);
$lettersSpacing = (float) data_get($b,'text_logo_letters_spacing', -0.5);
$wordmarkSize = (int) data_get($b,'text_logo_wordmark_size', 16);
$wordmarkWeight = (int) data_get($b,'text_logo_wordmark_weight', 900);
$wordmarkSpacing = (float) data_get($b,'text_logo_wordmark_spacing', -0.3);
$badgeShadow = $shadowOn ? '0 12px 30px rgba(15,23,42,.12)' : 'none';
$badgeBg = $bg;
if($tpl === 'gradient-badge'){
$badgeBg = "linear-gradient(135deg, {$gradFrom}, {$gradTo})";
}
@endphp
@if($useText)
{{ $letters }}
@if($showWordmark)
{{ $brandName }}
@endif
@else
@if($img)
0 ? "height:{$h}px;" : "" }}
max-width:100%;
"
>
@else
{{ $brandName }}
@endif
@endif