]
);
+ $this->add_control(
+ 'bg_color',
+ [
+ 'label' => __( 'Background Colour', 'cube' ),
+ 'type' => Controls_Manager::COLOR,
+ 'default' => '',
+ 'selectors' => [
+ '{{WRAPPER}} .timeline' => '--timeline-bg: {{VALUE}};',
+ ],
+ ]
+ );
+
$this->add_control(
'items',
[
--- /dev/null
+//== Elementor Swiper overrides
+// Note: These arrow styles should also match those in slick-carousel.styl
+// The styles can't be shared because Slick and Swiper have different structures
+.elementor-swiper-button, .elementor-lightbox .elementor-swiper-button
+ @apply bg-pink text-white
+ border-radius: 50%
+ font-size: 40px
+ width: 1.25em
+ height: @width
+ align-items: center
+ justify-content: center
+ transition: all 0.2s ease-out
+
+ &:hover
+ @apply bg-teal
+
+ .eicon-chevron
+ &-left:before
+ content: '\e89f'
+ &-right:before
+ content: '\e89e'
+
+ // Icon holder - make sure it remains transparent (because our buttons always have a their own background)
+ i
+ background-color: transparent !important
+
+// Adjust width of container to make room for arrow buttons
+.elementor-arrows-position-outside
+ .swiper-container
+ width: calc(100% - 160px);
+
+ // On Smaller screens, push even closer to the edge to maximise Swiper content width
+ +below(768px)
+ width: calc(100% - 90px);
+
+ .elementor-swiper-button
+ font-size: 45px
+
+ &-prev
+ left: -10px
+ &-next
+ right: -10px
+
+ +below(500px)
+ width: calc(100% - 50px);
+
+ .elementor-swiper-button
+ font-size: 35px
+
+.elementor-lightbox
+ .elementor-swiper-button
+ &-prev
+ left: 1.5rem
+ +below(768px)
+ left: 0.5rem
+
+ &-next
+ right: 1.5rem
+ +below(768px)
+ right: 0.5rem
$dot-size = 14px // width or height of a single background dot, including its gutter
.timeline
+ --timeline-bg: #fff // Used for masking elements so needs match bg of container (customisable in Elementor)
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='3' height='14'%3E%3Ccircle cx='1.5' cy='1.5' r='1.5' fill='%23707070'/%3E%3C/svg%3E")
background-repeat: repeat-y
background-position: 3.3em 0
+below($breakpoint-timeline)
flex-direction: column
align-items: center
- background-color: #fff
+ background-color: var(--timeline-bg)
padding-bottom: $dot-size
&-date-wrapper
// with white so background dots don't show above...
&:before
.timeline-item:first-child &
- background-color: #fff
+ background-color: var(--timeline-bg)
// For the last timeline item, mask any space BELOW the date
// with white so background dots don't show above...
&:after
.timeline-item:last-child &
- background-color: #fff
+ background-color: var(--timeline-bg)
+below($breakpoint-timeline)
background: none
&-date
+ @apply relative
@apply bg-teal text-white text-lg rounded-full
@apply flex items-center justify-center
flex: 0 0 auto
overflow: hidden
box-shadow: inset 0 0 0 0.45em rgba(#fff, 0.6)
box-sizing: content-box // So border takes space outside circle instead of making it smaller
- border: $dot-size solid #fff // White border works as mask so background dots don't get too close to date circles
+ border: $dot-size solid var(--timeline-bg) // Border works as mask so background dots don't get too close to date circles
margin-left: - $dot-size // Offset the invisible white border on the left
margin-right: $dot-size * 9 // Number of dots to show
+below(1200px)
- margin-right: $dot-size * 6
- +below(768px)
margin-right: $dot-size * 4
+below($breakpoint-timeline)
margin: - $dot-size 0 0 0
-
- &.is-highlight
+ &-highlight
@apply bg-pink
+ // Center and contain image
+ img
+ position: absolute
+ top: 0
+ left: 0
+ width: 100%
+ height: 100%
+ object-fit: cover
+ object-position: center
+
&-content
+below($breakpoint-timeline)
max-width: 280px
@foreach ($items as $item)
<div class="timeline-item">
<div class="timeline-item-date-wrapper">
- <div class="timeline-item-date @if($item['highlight'] == 'yes')is-highlight @endif">{{ $item['year'] }}</div>
+
+ @php
+ $class = '';
+ if ($item['highlight'] == 'yes') $class .= ' timeline-item-date-highlight';
+ if ($item['image']['id']) $class .= ' bg-transparent';
+ @endphp
+
+ <div class="timeline-item-date{{ $class }}">
+ {{ $item['year'] }}
+ @if ($item['image']['id']) @image($item['image']['id'], 'medium') @endif
+ </div>
+ </div>
+ <div class="timeline-item-content">
+ @if ($item['title'])
+ <h4>{{ $item['title'] }}</h4>
+ @endif
+ {!! $item['details'] !!}
+
+ @if ($item['cta_text'])
+ @php
+ $target = $item['cta_link']['is_external'] ? ' target="_blank"' : '';
+ $rel = $item['cta_link']['nofollow'] ? ' rel="nofollow"' : '';
+ @endphp
+ <a class="btn px-4 py-2 -mt-2" href="{{ $item['cta_link']['url'] }}"{!! $target !!}{!! $rel !!}>
+ {{ $item['cta_text'] }}
+ </a>
+ @endif
</div>
- <div class="timeline-item-content">{!! $item['details'] !!}</div>
</div>
@endforeach
</div>