@php use Botble\Base\Facades\BaseHelper; use Botble\Media\Facades\RvMedia; /** * Simple-slider style-baby — slideshow-2 single-column hero w/ decorative * graphic overlay (home-baby pattern). * * Mirrors html/home-baby.html lines 1477-1593: * * * * * * * * * * * * * {subtitle} * {title} * {button_label} * * * * * ... * * * * * * * Per-slide attrs (via metadata): * subtitle — eyebrow text (.h6) * button_label — CTA label (.tf-btn btn-white) * decor_image — desktop decorative graphic image path (e.g. item/graphic-item.png) * * Per-shortcode attrs: * wrapper_class — extra outer classes (default 'pt-30 p-xl-0') * text_color — 'white' (default) | 'dark' * button_style — 'pill-white' (default) | 'pill-dark' | 'outline-white' | 'outline-dark' * show_dots — 'yes' (default) | 'no' */ $autoplay = ($shortcode->is_autoplay ?? 'yes') === 'yes'; $autoplaySpeed = (int) ($shortcode->autoplay_speed ?? 3000); $showDots = ($shortcode->show_dots ?? 'yes') === 'yes'; $wrapperExtra = trim((string) ($shortcode->wrapper_class ?? 'pt-30 p-xl-0')); $textColor = ($shortcode->text_color ?? 'white') === 'dark' ? '' : 'text-white'; $btnStyleRaw = $shortcode->button_style ?? 'pill-white'; $btnClassMap = [ 'pill-white' => 'tf-btn btn-white', 'pill-dark' => 'tf-btn animate-btn', 'outline-white' => 'tf-btn btn-line style-white', 'outline-dark' => 'tf-btn btn-line', ]; $btnClass = $btnClassMap[$btnStyleRaw] ?? 'tf-btn btn-white'; @endphp htmlAttributes() !!} class="tf-slideshow slideshow-2 {{ $wrapperExtra }}"> @foreach ($sliders as $sliderItem) @php $title = $sliderItem->title; $description = $sliderItem->description; $subtitle = method_exists($sliderItem, 'getMetaData') ? ($sliderItem->getMetaData('subtitle', true) ?: null) : null; $buttonLabel = method_exists($sliderItem, 'getMetaData') ? ($sliderItem->getMetaData('button_label', true) ?: null) : null; $decorImage = method_exists($sliderItem, 'getMetaData') ? ($sliderItem->getMetaData('decor_image', true) ?: null) : null; $imageUrl = RvMedia::getImageUrl($sliderItem->image); $decorUrl = $decorImage ? RvMedia::getImageUrl($decorImage) : null; @endphp {{-- Mobile ( {{-- Desktop (≥md): decorative graphic overlay (transparent PNG). --}} @if ($decorUrl) @endif @if (! empty($subtitle)) {!! BaseHelper::clean($subtitle) !!} @endif @if (! empty($title)) {!! nl2br(BaseHelper::clean($title)) !!} @endif @if (! empty($description)) {!! BaseHelper::clean($description) !!} @endif @if (! empty($buttonLabel)) {!! BaseHelper::clean($buttonLabel) !!} @endif {{-- Desktop background: same slider image rendered behind overlay graphic. --}} @endforeach @if ($showDots) @endif
{!! BaseHelper::clean($description) !!}