{{-- Variables: $scale, $margin, $logoTop, $logoRight, $logoW, $logoH, $titleMarginTop, $titleFont, $catFont, $excerptFont, $excerptMT, $bottomBottom, $qrSize, $venueFont, $dateFont, $footerFont, $footerMT Plus post data: $heroBase64, $logoWhiteBase64, $translation, $categoryName, $brandColor, $pdfExcerpt, $isEvent, $isNews, $isArticle, $isImagePost, $post, $meetingCityName, $author, $qrBase64 --}} {{-- Hero background --}} @if($heroBase64) @endif
{{-- Logo top-right --}} @if($logoWhiteBase64)
{{ config('app.name') }}
@endif @php // Compute title font to fit 2 lines — uses double-underscore vars to avoid parent scope collision $__titleText = mb_strtoupper($translation?->title ?? ''); $__words = explode(' ', $__titleText); $__maxPt = $cardTitleMaxPt; $__containerMm = $cardTitleContainerMm; $__fitFont = $__maxPt; $__longestWord = max(array_map('mb_strlen', $__words)); for ($__try = $__maxPt; $__try >= 10; $__try -= 0.5) { $__charW = $__try * 0.353 * 0.55; $__spaceW = $__try * 0.353 * 0.30; // A single word must never exceed the container if ($__longestWord * $__charW > $__containerMm) continue; $__lineW = 0; $__lines = 1; foreach ($__words as $__wi => $__word) { $__wordW = mb_strlen($__word) * $__charW; $__gap = $__wi > 0 ? $__spaceW : 0; if ($__lineW > 0 && $__lineW + $__gap + $__wordW > $__containerMm) { $__lines++; $__lineW = $__wordW; } else { $__lineW += $__gap + $__wordW; } } if ($__lines <= 2) { $__fitFont = $__try; break; } } $__computedFont = round($__fitFont, 1) . 'pt'; @endphp {{-- Title + category badge --}}
{{ $translation?->title }}
@if($categoryName) {{ config('app.name') }} {{ $categoryName }} @endif @if(!$isImagePost && $pdfExcerpt)
{{ $pdfExcerpt }}
@endif
{{-- Bottom panel --}}
@if($qrBase64) @endif
@if($isEvent && $post->meeting && ($post->meeting->venue || $meetingCityName || $post->meeting->from)) @php $venueParts = array_filter([$post->meeting->venue ?? null, $meetingCityName ?? null]); @endphp @if(count($venueParts))
{{ implode(', ', $venueParts) }}
@endif @if($post->meeting->from)
{{ \Illuminate\Support\Carbon::parse($post->meeting->from)->translatedFormat('l j F') }}, {{ \Illuminate\Support\Carbon::parse($post->meeting->from)->format('H:i') }} {{ __('messages.hour_abbrevation') }}
@endif @elseif($isNews)
{{ timebank_config('footer.tagline') }}
@elseif($author)
{{ $author->full_name ?? $author->name }}
@endif
{{ config('app.name') }} — {{ $isNews && $translation?->from ? \Illuminate\Support\Carbon::parse($translation->from)->translatedFormat('l j F Y') : timebank_config('footer.tagline') }}