@php use Botble\Base\Facades\BaseHelper; use Botble\Media\Facades\RvMedia; /** * Simple-slider style-headphone — `tf-slideshow style-2 v2` center-mode hero * with optional `infiniteSlide-policy-v2` USP strip rendered as sibling below. * * Mirrors html/home-headphone.html lines 1281-1455: *
*
*
*
*
*
*
*
*
{title}
*

{description}

* {button_label} *
*
*
*
* … *
* * *
*
*
*
*
*

{usp_text_N}

* … *
*
*
* * Per-slide attrs (via slider metadata): * button_label — CTA label (.tf-btn btn-white) * * Per-shortcode attrs: * show_arrows — 'yes' (default) | 'no' (drives tf-sw-nav-2 visibility) * show_dots — 'yes' (default) | 'no' (mobile-only pagination dots) * usp_quantity — number of USP policy items (0 = no strip; default 0) * usp_text_1..N — policy text strings * usp_image_1..N — policy image paths */ $autoplay = ($shortcode->is_autoplay ?? 'yes') === 'yes'; $autoplaySpeed = (int) ($shortcode->autoplay_speed ?? 3000); $showArrows = ($shortcode->show_arrows ?? 'yes') === 'yes'; $showDots = ($shortcode->show_dots ?? 'yes') === 'yes'; $uspQuantity = max(0, (int) ($shortcode->usp_quantity ?? 0)); $uspItems = []; for ($i = 1; $i <= $uspQuantity; $i++) { $text = trim((string) ($shortcode->{"usp_text_{$i}"} ?? '')); $image = trim((string) ($shortcode->{"usp_image_{$i}"} ?? '')); if ($text === '' && $image === '') { continue; } $uspItems[] = ['text' => $text, 'image' => $image]; } @endphp
htmlAttributes() !!} class="tf-section simple-slider-section style-headphone">
@foreach ($sliders as $sliderItem) @php $title = $sliderItem->title; $description = $sliderItem->description; $buttonLabel = method_exists($sliderItem, 'getMetaData') ? ($sliderItem->getMetaData('button_label', true) ?: null) : null; @endphp
{{-- Original image (1770x680) — NOT the `hero-banner` 1920x1080 size, which 16:9-crops the slide ~256px taller than the demo. --}} {!! RvMedia::image($sliderItem->image, $title ?: '', null, false, ['class' => 'lazyload scale-item scale-item-1', 'loading' => 'eager', 'decoding' => 'async', 'width' => '1770', 'height' => '680']) !!}
@if (! empty($title))
{!! BaseHelper::clean($title) !!}
@endif @if (! empty($description))

{!! BaseHelper::clean($description) !!}

@endif @if (! empty($buttonLabel)) {!! BaseHelper::clean($buttonLabel) !!} @endif
@endforeach
@if ($showArrows) @endif @if ($showDots)
@endif
@if (! empty($uspItems))
@foreach ($uspItems as $usp) @if (! empty($usp['image']))
@endif @if (! empty($usp['text']))

{!! BaseHelper::clean($usp['text']) !!}

@endif @endforeach
@endif