Implemented a block editor for changing the layout of the page

This commit is contained in:
2026-04-04 01:17:05 +02:00
parent 0800f7664f
commit ff58e82497
41 changed files with 2706 additions and 298 deletions

View File

@@ -0,0 +1,33 @@
@props([
'block',
'subscriberCount' => 0,
])
@php
/** @var \App\Models\PageBlock $block */
$c = $block->content ?? [];
$min = (int) data_get($c, 'min_count', 0);
$template = (string) data_get($c, 'template', '');
$style = (string) data_get($c, 'style', 'pill');
$showAnim = filter_var(data_get($c, 'show_animation', true), FILTER_VALIDATE_BOOLEAN);
@endphp
@if ($subscriberCount >= $min && str_contains($template, '{count}'))
<div
class="w-full text-center"
x-show="phase !== 'thanks'"
x-cloak
>
@php
$text = str_replace('{count}', number_format($subscriberCount, 0, ',', '.'), $template);
$wrapClass = match ($style) {
'badge' => 'inline-flex rounded-lg border border-white/20 bg-white/10 px-4 py-2 text-sm text-white',
'plain' => 'text-sm text-white/90',
default => 'inline-flex rounded-full border border-festival/40 bg-festival/15 px-5 py-2 text-sm font-medium text-white shadow-inner',
};
@endphp
<p @class([$wrapClass, 'transition-transform duration-500' => $showAnim]) x-data="{ shown: false }" x-init="setTimeout(() => shown = true, 100)" :class="shown ? 'scale-100 opacity-100' : 'scale-95 opacity-0'">
{{ $text }}
</p>
</div>
@endif