* feat(home): alinhar cadência editorial * test(home): ajustar contrato do hero dividido
49 lines
2.5 KiB
PHP
49 lines
2.5 KiB
PHP
@props([
|
|
'testimonials',
|
|
])
|
|
|
|
@php
|
|
$testimonials = $testimonials
|
|
->filter(fn ($testimonial): bool => filled(trim((string) $testimonial->quote)))
|
|
->values();
|
|
@endphp
|
|
|
|
@if ($testimonials->isNotEmpty())
|
|
<section aria-labelledby="testimonials-heading" class="home-chapter border-b border-amare-border bg-amare-bg py-24" data-chapter="testimonials">
|
|
<div class="container-amare space-y-10" data-reveal-group>
|
|
<div class="max-w-2xl space-y-3 md:ml-[16.666667%]" data-reveal data-reveal-from="up">
|
|
<h2 id="testimonials-heading" class="text-3xl font-medium text-amare-text">Depoimentos</h2>
|
|
<p class="text-amare-text-muted">Quem celebrou com a Amare conta como foi a experiência.</p>
|
|
</div>
|
|
|
|
<div class="grid gap-6 md:grid-cols-12">
|
|
@foreach ($testimonials as $testimonial)
|
|
@php
|
|
$paragraphs = preg_split('/\n\s*\n/', trim((string) $testimonial->quote)) ?: [];
|
|
$paragraphs = array_values(array_filter(array_map('trim', $paragraphs), fn (string $p): bool => $p !== ''));
|
|
@endphp
|
|
<blockquote @class([
|
|
'space-y-4 border-t border-amare-border pt-4 md:col-span-5' => $loop->odd,
|
|
'space-y-4 border-t border-amare-border pt-4 md:col-span-5 md:col-start-7 md:mt-16' => $loop->even,
|
|
]) data-reveal data-reveal-from="{{ $loop->odd ? 'left' : 'right' }}">
|
|
<div class="grid grid-cols-[1.5rem_minmax(0,1fr)] gap-2">
|
|
<span class="text-3xl leading-none text-amare-sage" aria-hidden="true">“</span>
|
|
<div class="space-y-3 text-lg text-amare-text">
|
|
@foreach ($paragraphs as $paragraph)
|
|
<p>{{ $paragraph }}</p>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
<footer class="pl-8 text-sm text-amare-text-muted">
|
|
<cite class="not-italic font-semibold text-amare-text">{{ $testimonial->author_name }}</cite>
|
|
@if (filled($testimonial->context))
|
|
<span> — {{ $testimonial->context }}</span>
|
|
@endif
|
|
</footer>
|
|
</blockquote>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
</section>
|
|
@endif
|