refactor(sliders): update carousel structure and styles

- Changed class names for consistency and clarity.
- Improved carousel controls and indicators for better usability.
This commit is contained in:
Jérémy Munsch 2026-06-25 16:44:42 +02:00
parent e79a62b6f3
commit 7e28b8cd94
No known key found for this signature in database
GPG key ID: 2AAECDA6B7330F91
3 changed files with 47 additions and 43 deletions

View file

@ -159,3 +159,6 @@
scroll-margin-top: 6rem !important;
}
.bottom-n15px {
bottom: -15px !important;
}

View file

@ -1,4 +1,4 @@
.products-multi-carousel {
#products-carousel {
position: relative;
.carousel-inner {
@ -18,40 +18,32 @@
transition: none !important;
}
.carousel-control-prev-icon,
.carousel-control-next-icon {
filter: invert(1);
}
.carousel-control-prev-custom,
.carousel-control-next-custom {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 45px;
height: 45px;
background-color: var(--bs-body-bg);
border: 1px solid var(--bs-border-color);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 0.25rem 0.5rem rgba(var(--bs-dark-rgb), 0.1);
transition: background-color 0.2s ease, transform 0.2s ease;
&:hover {
background-color: rgba(var(--bs-primary-rgb), 0.08);
transform: translateY(-50%) scale(1.05);
}
.carousel-control-prev,
.carousel-control-next {
width: 8%;
opacity: 1;
z-index: 10;
&:focus-visible {
outline: 2px solid var(--bs-primary);
outline-offset: 2px;
outline: 2px solid var(--bs-dark);
outline-offset: -2px;
}
}
.carousel-control-prev-custom { left: 10px; }
.carousel-control-next-custom { right: 10px; }
.carousel-control-prev:hover,
.carousel-control-next:hover {
opacity: 1;
}
.carousel-control-prev-icon,
.carousel-control-next-icon {
width: 2.75rem;
height: 2.75rem;
border-radius: 50%;
background-color: rgba(var(--bs-dark-rgb), 0.75);
border: 1px solid rgba(var(--bs-light-rgb), 0.35);
background-size: 1.2rem 1.2rem;
}
}
#hero-carousel {

View file

@ -1,15 +1,14 @@
<div class="row">
<div class="col-12 position-relative overflow-hidden">
<div class="carousel slide products-multi-carousel" id="products-carousel" data-bs-ride="false" data-bs-touch="true">
<div class="carousel slide" id="products-carousel" data-bs-ride="false" data-bs-touch="true">
<div class="carousel-inner p-2">
@foreach ($starProductList as $productWithPricing)
<div class="carousel-item @if ($loop->first) active @endif">
<div class="h-100 p-2">
<div
class="card h-100 w-100 text-dark rounded-4 position-relative d-flex flex-column justify-content-between border-0 shadow-sm">
<div class="card h-100 w-100 rounded-4 position-relative d-flex flex-column justify-content-between border-0 shadow-sm">
<div class="card-header rounded-top-4 border-0 bg-transparent pb-0">
@unlessorderable($productWithPricing->product)
@ -35,8 +34,7 @@
<div class="card-body d-flex flex-column justify-content-between pt-0">
<div>
<h3 class="card-title fw-semibold h5 mb-2 text-center">
<a class="text-decoration-none text-dark stretched-link"
href="{{ route('fo.products.show', $productWithPricing->product) }}">
<a class="text-decoration-none stretched-link" href="{{ route('fo.products.show', $productWithPricing->product) }}">
{{ $productWithPricing->product->name }}
</a>
</h3>
@ -114,16 +112,27 @@
</div>
<button class="carousel-control-prev-custom" data-bs-target="#products-carousel" data-bs-slide="prev" type="button">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">{{ __('pagination.previous') }}</span>
</button>
@if (count($starProductList) > 1)
<div class="carousel-indicators d-lg-none bottom-n15px">
@foreach ($starProductList as $index => $product)
<button class="@if ($loop->first) active @endif" data-bs-target="#products-carousel"
data-bs-slide-to="{{ $index }}" type="button" aria-current="@if ($loop->first) true @endif"
aria-label="Slide {{ $index + 1 }}"></button>
@endforeach
</div>
@endif
<button class="carousel-control-next-custom" data-bs-target="#products-carousel" data-bs-slide="next" type="button">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">{{ __('pagination.next') }}</span>
</button>
@if (count($starProductList) > 3)
<button class="carousel-control-prev d-none d-lg-flex" data-bs-target="#products-carousel" data-bs-slide="prev" type="button">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">{{ __('pagination.previous') }}</span>
</button>
<button class="carousel-control-next d-none d-lg-flex" data-bs-target="#products-carousel" data-bs-slide="next" type="button">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">{{ __('pagination.next') }}</span>
</button>
@endif
</div>
</div>