-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
930f216
commit b0fafc1
Showing
6 changed files
with
179 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
"use client" | ||
import "react-medium-image-zoom/dist/styles.css" | ||
|
||
import NextImage from "next-image-export-optimizer" | ||
import { StaticImageData } from "next/image" | ||
import Slider from "react-slick" | ||
import "slick-carousel/slick/slick.css" | ||
import "slick-carousel/slick/slick-theme.css" | ||
import { ComponentProps } from "react" | ||
|
||
const settings: ComponentProps<typeof Slider> = { | ||
speed: 500, | ||
slidesToShow: 1, | ||
slidesToScroll: 1, | ||
initialSlide: 0, | ||
adaptiveHeight: true, | ||
} | ||
|
||
interface Props { | ||
images: StaticImageData[] | ||
index: number | ||
} | ||
export const ImageCarousel = ({ images, index }: Props) => { | ||
settings.initialSlide = index || 0 | ||
return ( | ||
<div className="z-[9999] fixed left-0 top-0 bg-[rgba(0,0,0,0.5)] h-screen w-screen flex justify-center"> | ||
<div className="w-screen max-w-[1504px]"> | ||
<Slider {...settings} className="rounded-2xl"> | ||
{images.map(image => ( | ||
<div className="w-max"> | ||
<div className="flex justify-center "> | ||
<div className="max-w-max h-max flex justify-center w-full"> | ||
<img | ||
key={image.src} | ||
alt={"gallery image"} | ||
className="h-full max-h-screen" | ||
src={image.src} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
))} | ||
</Slider> | ||
</div> | ||
</div> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters