@if (!empty($page_init['contact']['social']))
@php $socialLinks = $page_init['contact']['social'] ?? []; $headerSocialOrder = ['line', 'facebook', 'youtube', 'twitter', 'instagram', 'tiktok']; $headerSocialHover = [ 'line' => 'hover:bg-[#00B900] hover:text-white', 'facebook' => 'hover:bg-[#1877F2] hover:text-white', 'youtube' => 'hover:bg-[#FF0000] hover:text-white', 'twitter' => 'hover:bg-[var(--foreground)] hover:text-white', 'instagram' => 'hover:bg-gradient-to-br hover:from-[#f09433] hover:via-[#e6683c] hover:to-[#dc2743] hover:text-white', 'tiktok' => 'hover:bg-[#000000] hover:text-white', ]; $headerSocialAria = [ 'line' => 'Line', 'facebook' => 'Facebook', 'youtube' => 'YouTube', 'twitter' => 'X (Twitter)', 'instagram' => 'Instagram', 'tiktok' => 'TikTok', ]; @endphp @foreach ($headerSocialOrder as $network) @php $href = trim((string) (is_array($socialLinks[$network] ?? null) ? $socialLinks[$network]['url'] ?? '' : '')); @endphp @continue($href === '') @switch ($network) @case('line') @break @case('facebook') @break @case('youtube') @break @case('twitter') @break @case('instagram') @break @case('tiktok') @break @endswitch @endforeach
@endif
@if (!empty($page_init['setting']['logo']['header'])) Logo @else LOGO @endif @php $normalizeHeaderMenuPath = function (?string $href): ?string { if ($href === null || $href === '') { return null; } $href = trim((string) $href); if (str_starts_with(strtolower($href), 'javascript:')) { return null; } $path = parse_url($href, PHP_URL_PATH); if ($path === null || $path === '') { $path = str_starts_with($href, '/') ? $href : '/' . $href; } $path = trim((string) $path, '/'); return $path === '' ? '/' : '/' . $path; }; $currentHeaderPath = '/' . trim(request()->path(), '/'); $currentHeaderPath = $currentHeaderPath === '//' ? '/' : $currentHeaderPath; $headerMenuIsActive = function (?string $menuHref) use ($normalizeHeaderMenuPath, $currentHeaderPath): bool { $menuPath = $normalizeHeaderMenuPath($menuHref); if ($menuPath === null) { return false; } if ($menuPath === $currentHeaderPath) { return true; } if ($menuPath !== '/' && str_starts_with($currentHeaderPath, $menuPath . '/')) { return true; } return false; }; @endphp
{{ strtoupper($page_init['lang']) ?? '' }}
@php $l = [ 'en' => 'English', 'th' => 'ไทย (Thai)', 'cn' => '中文 (Chinese)', ]; @endphp @foreach ($page_init['lang_switch'] ?? [] as $k => $v) {{ $l[$k] ?? '' }} @endforeach