|
| 1 | +@php |
| 2 | +use App\Services\FrontendService; |
| 3 | +use App\Services\AccountService; |
| 4 | +
|
| 5 | +$appName = FrontendService::getAppName(); |
| 6 | +$appDesc = FrontendService::getAppDescription(); |
| 7 | +
|
| 8 | +$profileTitle = $profile ? "{$profile->name} (@{$profile->username}) | {$appName}" : $appName; |
| 9 | +
|
| 10 | +$descParts = []; |
| 11 | +if ($profile && $profile->bio) { |
| 12 | + $descParts[] = Str::limit($profile->bio, 26); |
| 13 | +} |
| 14 | +$likes = AccountService::getAccountLikesCount($profile->id); |
| 15 | +if ($profile) { |
| 16 | + $stats = [ |
| 17 | + number_format($profile->video_count ?? 0) . ' videos', |
| 18 | + number_format($profile->followers ?? 0) . ' followers', |
| 19 | + number_format($likes ?? 0) . ' likes' |
| 20 | + ]; |
| 21 | + $descParts[] = implode(' · ', $stats); |
| 22 | +} |
| 23 | +
|
| 24 | +$profileDesc = !empty($descParts) ? implode(' | ', $descParts) : $appDesc; |
| 25 | +
|
| 26 | +$profileUrl = $profile ? url('/@' . $profile->username) : url('/'); |
| 27 | +$profileAvatar = $profile && $profile->avatar ? $profile->avatar : url('/storage/avatars/default.jpg'); |
| 28 | +@endphp |
| 29 | +<!DOCTYPE html> |
| 30 | +<html> |
| 31 | +<head> |
| 32 | + <meta charset="utf-8"> |
| 33 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 34 | + <title>{{ $profileTitle }}</title> |
| 35 | + <link rel="shortcut icon" type="image/png" href="{{ url('/favicon.png') }}"/> |
| 36 | + |
| 37 | + <meta name="description" content="{{ $profileDesc }}"> |
| 38 | + <meta property="og:title" content="{{ $profileTitle }}" /> |
| 39 | + <meta property="og:description" content="{{ $profileDesc }}" /> |
| 40 | + <meta property="og:type" content="profile" /> |
| 41 | + <meta property="og:url" content="{{ $profileUrl }}" /> |
| 42 | + <meta property="og:image" content="{{ $profileAvatar }}" /> |
| 43 | + @if($profile)<meta property="profile:username" content="{{ $profile->username }}" />@endif |
| 44 | + |
| 45 | + <meta name="twitter:card" content="summary" /> |
| 46 | + <meta name="twitter:title" content="{{ $profileTitle }}" /> |
| 47 | + <meta name="twitter:description" content="{{ $profileDesc }}" /> |
| 48 | + <meta name="twitter:image" content="{{ $profileAvatar }}" /> |
| 49 | + |
| 50 | + @vite(['resources/js/app.js']) |
| 51 | + {!! FrontendService::getCustomCss() !!} |
| 52 | + |
| 53 | + <script type="text/javascript"> |
| 54 | + window.appConfig = {!! FrontendService::getAppData() !!}; |
| 55 | + window._navi = {!! App\Services\PageService::getActiveSideLinks() !!}; |
| 56 | + {!! FrontendService::getCaptchaData() !!} |
| 57 | + </script> |
| 58 | +</head> |
| 59 | + |
| 60 | +<body class="bg-white dark:bg-slate-950"> |
| 61 | + <main id="app"> |
| 62 | + <router-view></router-view> |
| 63 | + </main> |
| 64 | +</body> |
| 65 | +</html> |
0 commit comments