- Updated the User model to implement Filament’s tenancy contracts - Seeded a ready-to-use demo tenant (user, tenant, active package, purchase) - Introduced a branded, translated 403 error page to replace the generic forbidden message for unauthorised admin hits - Removed the public “Register” links from the marketing header - hardened join event logic and improved error handling in the guest pwa.
159 lines
6.7 KiB
PHP
159 lines
6.7 KiB
PHP
@php
|
||
$width = $layout['svg']['width'] ?? 1080;
|
||
$height = $layout['svg']['height'] ?? 1520;
|
||
$background = $layout['background'] ?? '#FFFFFF';
|
||
$gradient = $layout['background_gradient'] ?? null;
|
||
$gradientId = $gradient ? 'bg-gradient-'.uniqid() : null;
|
||
$accent = $layout['accent'] ?? '#000000';
|
||
$secondary = $layout['secondary'] ?? '#E5E7EB';
|
||
$textColor = $layout['text'] ?? '#111827';
|
||
$badgeColor = $layout['badge'] ?? $accent;
|
||
$instructions = $layout['instructions'] ?? [];
|
||
$description = $layout['description'] ?? '';
|
||
$subtitle = $layout['subtitle'] ?? '';
|
||
$titleLines = explode("\n", wordwrap($eventName, 18, "\n", true));
|
||
$subtitleLines = $subtitle !== '' ? explode("\n", wordwrap($subtitle, 36, "\n", true)) : [];
|
||
$descriptionLines = $description !== '' ? explode("\n", wordwrap($description, 40, "\n", true)) : [];
|
||
$instructionStartY = 870;
|
||
$instructionSpacing = 56;
|
||
if ($gradient) {
|
||
$angle = (float) ($gradient['angle'] ?? 180);
|
||
$angleRad = deg2rad($angle);
|
||
$x1 = 0.5 - cos($angleRad) / 2;
|
||
$y1 = 0.5 - sin($angleRad) / 2;
|
||
$x2 = 0.5 + cos($angleRad) / 2;
|
||
$y2 = 0.5 + sin($angleRad) / 2;
|
||
$x1Attr = number_format($x1, 4, '.', '');
|
||
$y1Attr = number_format($y1, 4, '.', '');
|
||
$x2Attr = number_format($x2, 4, '.', '');
|
||
$y2Attr = number_format($y2, 4, '.', '');
|
||
}
|
||
@endphp
|
||
<svg width="{{ $width }}" height="{{ $height }}" viewBox="0 0 {{ $width }} {{ $height }}" xmlns="http://www.w3.org/2000/svg">
|
||
<defs>
|
||
@if($gradientId)
|
||
<linearGradient id="{{ $gradientId }}" x1="{{ $x1Attr }}" y1="{{ $y1Attr }}" x2="{{ $x2Attr }}" y2="{{ $y2Attr }}">
|
||
@php
|
||
$stops = $gradient['stops'] ?? [];
|
||
$stopCount = max(count($stops) - 1, 1);
|
||
@endphp
|
||
@foreach($stops as $index => $stopColor)
|
||
@php
|
||
$offset = $stopCount > 0 ? ($index / $stopCount) * 100 : 0;
|
||
@endphp
|
||
<stop offset="{{ number_format($offset, 2, '.', '') }}%" stop-color="{{ $stopColor }}"/>
|
||
@endforeach
|
||
</linearGradient>
|
||
@endif
|
||
</defs>
|
||
|
||
<style>
|
||
.title-line {
|
||
font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
|
||
font-size: 82px;
|
||
font-weight: 700;
|
||
letter-spacing: -1px;
|
||
}
|
||
.subtitle-line {
|
||
font-family: 'Lora', 'Georgia', serif;
|
||
font-size: 32px;
|
||
font-weight: 500;
|
||
}
|
||
.description-line {
|
||
font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
|
||
font-size: 30px;
|
||
font-weight: 400;
|
||
line-height: 1.4;
|
||
}
|
||
.badge-text {
|
||
font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
|
||
font-size: 28px;
|
||
font-weight: 600;
|
||
letter-spacing: 4px;
|
||
text-transform: uppercase;
|
||
}
|
||
.instruction-bullet {
|
||
font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
|
||
font-size: 30px;
|
||
font-weight: 600;
|
||
}
|
||
.instruction-text {
|
||
font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
|
||
font-size: 30px;
|
||
font-weight: 400;
|
||
}
|
||
.small-label {
|
||
font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
|
||
font-size: 28px;
|
||
font-weight: 600;
|
||
letter-spacing: 3px;
|
||
text-transform: uppercase;
|
||
}
|
||
.link-text {
|
||
font-family: 'Courier New', monospace;
|
||
font-size: 30px;
|
||
}
|
||
.footer-text {
|
||
font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
|
||
font-size: 26px;
|
||
font-weight: 400;
|
||
}
|
||
.footer-strong {
|
||
font-weight: 700;
|
||
}
|
||
</style>
|
||
|
||
<rect x="0" y="0" width="{{ $width }}" height="{{ $height }}" fill="{{ $gradientId ? 'url(#'.$gradientId.')' : $background }}" />
|
||
|
||
<rect x="70" y="380" width="500" height="600" rx="46" fill="rgba(255,255,255,0.78)" />
|
||
|
||
<rect x="600" y="420" width="380" height="380" rx="36" fill="rgba(255,255,255,0.88)" />
|
||
<rect x="640" y="780" width="300" height="6" rx="3" fill="{{ $accent }}" opacity="0.6" />
|
||
|
||
<rect x="80" y="120" width="250" height="70" rx="35" fill="{{ $badgeColor }}" />
|
||
<text x="205" y="165" text-anchor="middle" fill="#FFFFFF" class="badge-text">Digitale Gästebox</text>
|
||
|
||
@foreach($titleLines as $index => $line)
|
||
<text x="80" y="{{ 260 + $index * 88 }}" fill="{{ $textColor }}" class="title-line">{{ e($line) }}</text>
|
||
@endforeach
|
||
|
||
@php
|
||
$subtitleOffset = 260 + count($titleLines) * 88 + 40;
|
||
@endphp
|
||
@foreach($subtitleLines as $index => $line)
|
||
<text x="80" y="{{ $subtitleOffset + $index * 44 }}" fill="{{ $secondary }}" class="subtitle-line">{{ e($line) }}</text>
|
||
@endforeach
|
||
|
||
@php
|
||
$descriptionOffset = $subtitleOffset + (count($subtitleLines) ? count($subtitleLines) * 44 + 60 : 40);
|
||
@endphp
|
||
@foreach($descriptionLines as $index => $line)
|
||
<text x="110" y="{{ $descriptionOffset + $index * 48 }}" fill="{{ $textColor }}" class="description-line">{{ e($line) }}</text>
|
||
@endforeach
|
||
|
||
<text x="120" y="760" fill="{{ $accent }}" class="small-label">SO FUNKTIONIERT'S</text>
|
||
|
||
@foreach($instructions as $index => $step)
|
||
@php
|
||
$lineY = $instructionStartY + $index * $instructionSpacing;
|
||
@endphp
|
||
<circle cx="120" cy="{{ $lineY - 18 }}" r="10" fill="{{ $accent }}" />
|
||
<text x="150" y="{{ $lineY }}" fill="{{ $textColor }}" class="instruction-text">{{ e($step) }}</text>
|
||
@endforeach
|
||
|
||
<text x="640" y="760" fill="{{ $accent }}" class="small-label">ALTERNATIVER LINK</text>
|
||
<rect x="630" y="790" width="320" height="120" rx="22" fill="rgba(0,0,0,0.08)" />
|
||
<text x="650" y="850" fill="{{ $textColor }}" class="link-text">{{ e($tokenUrl) }}</text>
|
||
|
||
<image href="{{ $qrPngDataUri }}" x="620" y="440" width="{{ $layout['qr']['size_px'] ?? 340 }}" height="{{ $layout['qr']['size_px'] ?? 340 }}" />
|
||
|
||
<text x="820" y="820" text-anchor="middle" fill="{{ $accent }}" class="small-label">JETZT SCANNEN</text>
|
||
|
||
<text x="120" y="{{ $height - 160 }}" fill="rgba(17,24,39,0.6)" class="footer-text">
|
||
<tspan class="footer-strong" fill="{{ $accent }}">{{ e(config('app.name', 'Fotospiel')) }}</tspan>
|
||
– Gästebox & Fotochallenges
|
||
</text>
|
||
<text x="{{ $width - 120 }}" y="{{ $height - 160 }}" text-anchor="end" fill="rgba(17,24,39,0.6)" class="footer-text">
|
||
Einladung gültig: {{ $joinToken->expires_at ? $joinToken->expires_at->isoFormat('LLL') : 'bis Widerruf' }}
|
||
</text>
|
||
</svg> |