portfolio/components/ImageSlider.vue

39 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-bottom': 'auto',
'--swiper-pagination-top': '1rem',
'--swiper-navigation-top-offset': '5rem'
}"
:modules="[SwiperAutoplay, SwiperPagination, SwiperNavigation]"
class="h-full w-full"
>
<SwiperSlide v-for="(image, index) in gallery" :key="image.id || index" class="!flex !items-center !justify-center !py-4 !bg-zinc-100">
<img :src="'/' + bucket + '/' + image.image"
style="max-width: 100%; max-height: calc(85vh - 40px); object-fit: contain;"/>
</SwiperSlide>
</Swiper>
</template>
<script>
export default {
props: ['gallery', 'bucket']
}
</script>