feat: disable post cover autoplay
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import "swiper/css"
|
||||
import "swiper/css/effect-fade"
|
||||
import "swiper/css/navigation"
|
||||
import "swiper/css/pagination"
|
||||
import { Autoplay, EffectFade, Navigation, Pagination } from "swiper/modules"
|
||||
import "swiper/css/scrollbar"
|
||||
import { Navigation, Scrollbar } from "swiper/modules"
|
||||
import { Swiper, SwiperSlide } from "swiper/react"
|
||||
|
||||
import { Image } from "~/components/ui/Image"
|
||||
@@ -30,23 +29,15 @@ export default function PostCover({
|
||||
{(images?.length || 0) > 1 ? (
|
||||
<>
|
||||
<Swiper
|
||||
pagination={{
|
||||
type: "progressbar",
|
||||
}}
|
||||
loop={true}
|
||||
navigation={{
|
||||
prevEl: `#swiper-button-prev-${uniqueKey}`,
|
||||
nextEl: `#swiper-button-next-${uniqueKey}`,
|
||||
}}
|
||||
autoplay={{
|
||||
delay: 5000,
|
||||
disableOnInteraction: false,
|
||||
pauseOnMouseEnter: true,
|
||||
waitForTransition: false,
|
||||
scrollbar={{
|
||||
hide: true,
|
||||
}}
|
||||
effect={"fade"}
|
||||
speed={1000}
|
||||
modules={[EffectFade, Autoplay, Pagination, Navigation]}
|
||||
modules={[Navigation, Scrollbar]}
|
||||
className="w-full h-full"
|
||||
>
|
||||
{images?.map((image) => (
|
||||
|
||||
@@ -445,26 +445,3 @@ textarea.input {
|
||||
.swiper-button {
|
||||
@apply absolute top-1/2 -translate-y-1/2 bg-white rounded-full z-[1] w-6 h-6 flex items-center justify-center opacity-80;
|
||||
}
|
||||
|
||||
.swiper .swiper-pagination-bullet {
|
||||
@apply bg-zinc-100 opacity-50 w-[7px] h-[7px];
|
||||
}
|
||||
|
||||
.swiper .swiper-pagination-bullet-active {
|
||||
@apply opacity-100;
|
||||
}
|
||||
|
||||
.swiper .swiper-pagination-bullets {
|
||||
@apply leading-3;
|
||||
}
|
||||
|
||||
.swiper .swiper-pagination-progressbar .swiper-pagination-progressbar-fill {
|
||||
@apply bg-accent;
|
||||
transition-duration: 5000ms !important;
|
||||
transition-timing-function: linear;
|
||||
transform: translate3d(0px, 0px, 0px) scaleX(0) scaleY(1);
|
||||
}
|
||||
|
||||
.swiper .swiper-pagination-progressbar.swiper-pagination-horizontal {
|
||||
@apply h-[2px] bg-transparent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user