-$breakpoint-timeline-horizontal = 900px // When timeline changes to mobile view
+$breakpoint-timeline-horizontal = 768px // When timeline changes to mobile view
.timeline-horizontal
- .swiper-wrapper
- @apply items-center
-
&-item
@apply bg-white flex items-center
horizontal-spacing(12.5vw)
+ height: auto // Needed for fade effect so all slides are same height (height: 100% actually breaks it)
+
+ +below(950px)
+ padding-left: 10vw
+ padding-right: @padding-left
+
+ +below($breakpoint-timeline-horizontal)
+ flex-direction: column
+ padding-left: 15vw
+ padding-right: @padding-left
&-image-wrapper
display: flex
justify-content: center
constrain(margin-right, 5vw)
+ +below($breakpoint-timeline-horizontal)
+ margin: 0 0 2em 0
+ flex-grow: 0
+ flex-basis: auto
+ width: 75%
+ max-width: 220px
+
&-content
flex: 1 1 60%
+ > *
+ max-width: 750px
+
a
@apply text-pink
+ &:hover
+ @apply text-teal
+
+ // Special override for large text so it fits better on smallest screens
+ .text-lg
+ +below(500px)
+ font-size: 1.125rem
+
// Timeline Pagination
&-pagination
position: relative
margin: 0
z-index: 1
+ +below(950px)
+ width: 90% !important
+ left: 5% !important
+
+ +below($breakpoint-timeline-horizontal)
+ display: none
+
// Timeline horizontal line
&:before
content: ''
&:before
opacity: 0
+ // Step number (mobile only)
+ &-step
+ @apply font-display text-center
+
+ +above($breakpoint-timeline-horizontal)
+ display: none
+
+ &-title
+ @apply font-bold text-lg text-teal uppercase mt-2 mb-6
+ max-width: 8em
+
+ .bullet
+ @apply bg-teal text-white
+ height: r(68px)
+ width: @height
+ line-height: @height
+ font-size: 52px
+ display: inline-block
+ border-radius: 50%
+
// Navigation Arrows
&-prev, &-next
&-prev
constrain(left, 5vw)
+
+ +below(950px)
+ left: 2.5vw
+
&-next
constrain(right, 5vw)
+
+ +below(950px)
+ right: 2.5vw
$settings = [
'slidesPerView' => 1,
'loop' => true,
- //'effect' => 'fade', // TODO: try to make this work properly so slides are all the same height
+ 'effect' => 'fade',
'touchEventsTarget' => 'wrapper', // Fix pagination links sometimes going to wrong place
'pagination' => [
'el' => '.timeline-horizontal-pagination',
@foreach ($items as $item)
<div class="timeline-horizontal-item swiper-slide" data-title="{{ $item['title'] }}">
- {{-- TODO: mobile title
- <div class="timeline-horizontal-number">
- {{ $loop->iteration }}
+ <div class="timeline-horizontal-step">
+ <div class="bullet">{{ $loop->iteration }}</div>
+ <h3 class="timeline-horizontal-step-title">{{ $item['title'] }}</h3>
</div>
- --}}
<div class="timeline-horizontal-item-image-wrapper">
@image($item['image']['id'], 'full', ['class' => 'timeline-horizontal-item-image'])
</div>
<div class="timeline-horizontal-item-content">
- <h3 class="text-2xl uppercase">{{ $item['title'] }}</h3>
+ <h3 class="text-2xl xs:text-xl uppercase">{{ $item['title'] }}</h3>
{!! $item['content'] !!}
</div>
</div>