Compare commits
No commits in common. "8ddc36b5fc4a95e7087d5eef8ae4b79d57f802fe" and "3b6d64df923631a9a959be3cb1166f5be2f03d3f" have entirely different histories.
8ddc36b5fc
...
3b6d64df92
|
|
@ -11,21 +11,13 @@ import {
|
||||||
CarouselPrevious,
|
CarouselPrevious,
|
||||||
type CarouselApi,
|
type CarouselApi,
|
||||||
} from "@/ui/carousel";
|
} from "@/ui/carousel";
|
||||||
const imageUrls = [
|
|
||||||
|
|
||||||
"/images/carousel-1.jpg",
|
|
||||||
"/images/carousel-2.jpg",
|
|
||||||
"/images/carousel-3.jpg",
|
|
||||||
"/images/carousel-4.jpg",
|
|
||||||
"/images/carousel-5.jpg",
|
|
||||||
"/images/carousel-6.jpg",
|
|
||||||
];
|
|
||||||
export function CarouselDemo() {
|
export function CarouselDemo() {
|
||||||
const [api, setApi] = React.useState<CarouselApi>();
|
const [api, setApi] = React.useState<CarouselApi>();
|
||||||
const [current, setCurrent] = React.useState(0);
|
const [current, setCurrent] = React.useState(0);
|
||||||
const [count, setCount] = React.useState(0);
|
const [count, setCount] = React.useState(0);
|
||||||
|
|
||||||
const totalSlides = imageUrls.length;
|
const totalSlides = 6;
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (!api) return;
|
if (!api) return;
|
||||||
|
|
@ -54,16 +46,12 @@ export function CarouselDemo() {
|
||||||
className="w-full"
|
className="w-full"
|
||||||
>
|
>
|
||||||
<CarouselContent>
|
<CarouselContent>
|
||||||
{imageUrls.map((src, index) => (
|
{Array.from({ length: totalSlides }).map((_, index) => (
|
||||||
<CarouselItem key={index}>
|
<CarouselItem key={index}>
|
||||||
<div className="p-1">
|
<div className="p-1">
|
||||||
<Card>
|
<Card>
|
||||||
<CardContent className="flex aspect-square items-center justify-center p-6">
|
<CardContent className="flex aspect-square items-center justify-center p-6">
|
||||||
<img
|
<span className="text-4xl font-semibold">{index + 1}</span>
|
||||||
src={src}
|
|
||||||
alt={`Slide ${index + 1}`}
|
|
||||||
className="w-full h-full object-cover"
|
|
||||||
/>
|
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ export function meta( ) {
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<Header />
|
||||||
|
<TopNav />
|
||||||
<CarouselDemo />
|
<CarouselDemo />
|
||||||
<NewsList />
|
<NewsList />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 52 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 416 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 824 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.6 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 549 KiB |
Loading…
Reference in New Issue