portfolio/components/ImageSlider.vue

38 lines
1.1 KiB
Vue

<template>
<Swiper
:autoHeight="false"
:loop="true"
:spaceBetween="30"
:centeredSlides="true"
:autoplay="{
delay: 4000,
disableOnInteraction: false,
pauseOnMouseEnter: true
}"
:pagination="{
clickable: true,
}"
:navigation="true"
:style="{
'--swiper-navigation-color': 'rgb(71 85 105)',
'--swiper-pagination-color': 'rgb(71 85 105)',
'--swiper-pagination-top': '0',
'--swiper-navigation-top-offset': '4rem'
}"
:modules="[SwiperAutoplay, SwiperPagination, SwiperNavigation]"
class="h-full w-full px-12 pt-16"
>
<SwiperSlide v-for="(image, index) in gallery" :key="image.id || index" class="!flex !items-start !justify-center !py-8 !bg-zinc-100">
<img :src="'/' + bucket + '/' + image.image"
style="max-width: calc(100% - 80px); max-height: calc(85vh - 160px); object-fit: contain;"/>
</SwiperSlide>
</Swiper>
</template>
<script>
export default {
props: ['gallery', 'bucket']
}
</script>