@@ -13,20 +13,26 @@ import GridRow from "~/shared/ui/GridRow"
1313import ListItem from "~/shared/ui/ListItem"
1414import Account from "~/shared/ui/Account"
1515import PageTitle from "~/shared/ui/PageTitle"
16- import createEmblaCarousel from "embla-carousel-solid"
1716
1817export default function Home ( ) {
19- const [ emblaRef , emblaApi ] = createEmblaCarousel ( ( ) => ( {
20- loop : true ,
21- skipSnaps : true ,
22- } ) )
23-
2418 createEffect ( ( ) => {
2519 Atropos ( {
2620 el : ".atropos-img1" ,
2721 shadow : false ,
2822 rotateTouch : "scroll-y" ,
2923 } )
24+
25+ new Swiper ( ".swiper" , {
26+ modules : [ Navigation ] ,
27+ loop : true ,
28+ slidesPerView : "auto" ,
29+ centeredSlides : true ,
30+ lazyPreloadPrevNext : 2 ,
31+ navigation : {
32+ nextEl : ".swiper-button-next" ,
33+ prevEl : ".swiper-button-prev" ,
34+ } ,
35+ } )
3036 } )
3137
3238 const gridRows = createMemo ( ( ) => NFTS . slice ( 0 , 4 ) )
@@ -117,11 +123,11 @@ export default function Home() {
117123 < h2 class = "font-[Poppins] text-[30px] lg:text-[32px] xl:text-[45px] text-[#c5c5c5] font-semibold" >
118124 Weekly - Top NFT
119125 </ h2 >
120- < div class = "embla mt-[60px] lg:mt-[70px] xl:mt-[100px] w-full transform-none overflow-hidden" ref = { emblaRef } >
121- < div class = "embla__container max-w-full transform-none flex flex-row select -none" >
126+ < div class = "swiper mt-[60px] lg:mt-[70px] xl:mt-[100px] w-full transform-none" >
127+ < div class = "swiper-wrapper max-w-full transform-none" >
122128 < For each = { NFTS } >
123129 { ( item ) => (
124- < div class = "embla__slide min-w-[230px] max-w-[230px] xl:min-w-[320px ] xl:max-w-[320px] px-[15px] xl:px-[20px]" >
130+ < div class = "swiper-slide flex flex-col max-w-[230px] xl:max-w-[320px] px-[15px] xl:px-[20px]" >
125131 < Card { ...item } />
126132 </ div >
127133 ) }
@@ -131,7 +137,6 @@ export default function Home() {
131137 < button
132138 class = "swiper-button-prev flex flex-row items-center justify-center grow cursor-pointer"
133139 aria-label = "move left"
134- onClick = { ( ) => emblaApi ( ) ?. scrollPrev ( ) }
135140 >
136141 < img
137142 loading = "lazy"
@@ -143,7 +148,6 @@ export default function Home() {
143148 < button
144149 class = "swiper-button-next flex flex-row items-center justify-center grow cursor-pointer"
145150 aria-label = "move right"
146- onClick = { ( ) => emblaApi ( ) ?. scrollNext ( ) }
147151 >
148152 < img
149153 loading = "lazy"
0 commit comments