Skip to content

Commit f383c12

Browse files
committed
Revert "Merge branch 'embla'"
This reverts commit 91b76c9, reversing changes made to ffaca2c.
1 parent 033d9cf commit f383c12

File tree

4 files changed

+16
-48
lines changed

4 files changed

+16
-48
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"@solidjs/start": "^1.1.0",
1414
"@tailwindcss/vite": "^4.1.3",
1515
"atropos": "^2.0.2",
16-
"embla-carousel-solid": "^8.6.0",
1716
"scrollreveal": "^4.0.9",
1817
"solid-js": "^1.9.5",
1918
"swiper": "10.3.1",

pnpm-lock.yaml

Lines changed: 0 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/routes/index.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,26 @@ import GridRow from "~/shared/ui/GridRow"
1313
import ListItem from "~/shared/ui/ListItem"
1414
import Account from "~/shared/ui/Account"
1515
import PageTitle from "~/shared/ui/PageTitle"
16-
import createEmblaCarousel from "embla-carousel-solid"
1716

1817
export 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"

src/shared/ui/Card/Card.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const Card = (props: Props) => {
1313
loading="lazy"
1414
alt={`NFT ${props.title}`}
1515
/>
16+
<div class="swiper-lazy-preloader"></div>
1617
<div class="absolute top-[10px] right-[8px] xl:top-[14px] xl:right-[10px] bg-[#1C1D2059]/65 rounded-lg xl:rounded-xl px-[10px] py-[6px] xl:px-[14px] xl:py-[8px] text-white text-[10px] xl:text-[14px] font-[Poppins] font-medium text-nowrap">
1718
{props.timer}
1819
</div>

0 commit comments

Comments
 (0)