feat/hero #9
@ -37,32 +37,45 @@ const dummyData = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "jo21j189291",
|
id: "jo21j189291",
|
||||||
isClickable: false,
|
isClickable: true,
|
||||||
title: "Warning System",
|
title: "Warning System",
|
||||||
tags: [],
|
tags: [],
|
||||||
description:
|
description:
|
||||||
"This is a warning system for anime that contain controversial content. This system is designed to inform viewers about the potential risks of watching certain anime. Viewer discretion is advised. Please watch these anime at your own risk.",
|
"This is a warning system for anime that contain controversial content. This system is designed to inform viewers about the potential risks of watching certain anime. Viewer discretion is advised. Please watch these anime at your own risk.",
|
||||||
buttonContent: "Watch Now",
|
buttonContent: "Learn More",
|
||||||
buttonLink: "https://www.example.com/boku-no-pico",
|
buttonLink: "https://www.example.com/boku-no-pico",
|
||||||
imageUrl: "",
|
imageUrl: "",
|
||||||
startDate: "2024-01-01",
|
startDate: "2024-01-01",
|
||||||
endDate: "2024-12-31",
|
endDate: "2024-12-31",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "dwasdasdasd",
|
||||||
|
isClickable: false,
|
||||||
|
title: "",
|
||||||
|
tags: [],
|
||||||
|
description: "",
|
||||||
|
buttonContent: "",
|
||||||
|
buttonLink: "",
|
||||||
|
imageUrl:
|
||||||
|
"https://wallpapers.com/images/featured/cool-boy-anime-y61kpjindsmr277u.jpg",
|
||||||
|
startDate: "2024-01-01",
|
||||||
|
endDate: "2024-12-31",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
// End of dummy data
|
// End of dummy data
|
||||||
|
|
||||||
const Hero = () => {
|
const Hero = () => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
return (
|
return (
|
||||||
<div className="h-120 rounded-md overflow-hidden">
|
<div className="h-120 rounded-lg overflow-hidden">
|
||||||
<Swiper
|
<Swiper
|
||||||
spaceBetween={0}
|
spaceBetween={0}
|
||||||
slidesPerView={1}
|
slidesPerView={1}
|
||||||
onSlideChange={() => console.log("slide change")}
|
onSlideChange={() => console.log("slide change")}
|
||||||
onSwiper={(swiper) => console.log(swiper)}
|
onSwiper={(swiper) => console.log(swiper)}
|
||||||
className="h-full"
|
className="h-full"
|
||||||
// autoplay={{ delay: 5000, disableOnInteraction: false }}
|
autoplay={{ delay: 5000, disableOnInteraction: false }}
|
||||||
// modules={[Autoplay, Pagination, Navigation]}
|
modules={[Autoplay, Pagination, Navigation]}
|
||||||
>
|
>
|
||||||
{dummyData.map((slide) =>
|
{dummyData.map((slide) =>
|
||||||
slide.imageUrl ? (
|
slide.imageUrl ? (
|
||||||
@ -73,44 +86,41 @@ const Hero = () => {
|
|||||||
alt={slide.title}
|
alt={slide.title}
|
||||||
className="absolute top-0 left-0 z-0 object-cover w-full h-full opacity-80"
|
className="absolute top-0 left-0 z-0 object-cover w-full h-full opacity-80"
|
||||||
/>
|
/>
|
||||||
<div className="absolute top-0 left-0 z-10 h-full w-full py-14 px-20">
|
{slide.title && slide.description && (
|
||||||
<h1 className="text-6xl font-semibold tracking-tight">
|
<div
|
||||||
{slide.title}
|
className="absolute top-0 left-0 z-10 h-full w-full py-16 px-20"
|
||||||
</h1>
|
style={{
|
||||||
<div className="mt-4 flex gap-1.5">
|
background:
|
||||||
{slide.tags.map((tag) => (
|
"linear-gradient(90deg,rgba(0, 0, 0, 0.64) 0%, rgba(0, 0, 0, 0.42) 46%, rgba(0, 0, 0, 0) 100%)",
|
||||||
<Badge
|
}}
|
||||||
className="bg-neutral-200 text-neutral-800"
|
>
|
||||||
key={tag}
|
<h1 className="text-6xl font-semibold tracking-tight">
|
||||||
|
{slide.title}
|
||||||
|
</h1>
|
||||||
|
<div className="mt-4 flex gap-1.5">
|
||||||
|
{slide.tags.map((tag) => (
|
||||||
|
<Badge
|
||||||
|
className="bg-neutral-200 text-neutral-800"
|
||||||
|
key={tag}
|
||||||
|
>
|
||||||
|
{tag}
|
||||||
|
</Badge>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<p className="mt-4 font-medium text-base max-w-[40vw] line-clamp-6">
|
||||||
|
{slide.description}
|
||||||
|
</p>
|
||||||
|
{slide.isClickable && (
|
||||||
|
<Button
|
||||||
|
size="lg"
|
||||||
|
onClick={() => router.push(slide.buttonLink)}
|
||||||
|
className="mt-6"
|
||||||
>
|
>
|
||||||
{tag}
|
{slide.buttonContent}
|
||||||
</Badge>
|
</Button>
|
||||||
))}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<p className="mt-4 font-medium text-base max-w-[40vw]">
|
)}
|
||||||
Twelve years ago, a colossal demon fox terrorized the world.
|
|
||||||
During the monster's attack on the Hidden Leaf Village, the
|
|
||||||
Hokage—the village's leader and most powerful ninja—sacrifices
|
|
||||||
himself to seal the beast inside a newborn, relieving
|
|
||||||
civilization from destruction while dooming the baby to a
|
|
||||||
lonely life. Now, after years of being shunned and bullied,
|
|
||||||
Naruto Uzumaki pesters the village with elaborate pranks and
|
|
||||||
vandalism. Despite these antics, he works hard to achieve his
|
|
||||||
dream: to become the Hokage and earn the acknowledgement of
|
|
||||||
those who have mistreated him for his entire life. Naruto
|
|
||||||
joins Team 7, a ninja squad made up of two of his
|
|
||||||
peers—prodigy Sasuke Uchiha and clever Sakura Haruno.
|
|
||||||
</p>
|
|
||||||
{slide.isClickable && (
|
|
||||||
<Button
|
|
||||||
size="lg"
|
|
||||||
onClick={() => router.push(slide.buttonLink)}
|
|
||||||
className="mt-6"
|
|
||||||
>
|
|
||||||
{slide.buttonContent}
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</SwiperSlide>
|
</SwiperSlide>
|
||||||
) : (
|
) : (
|
||||||
// Fallback for slides without image
|
// Fallback for slides without image
|
||||||
@ -129,18 +139,7 @@ const Hero = () => {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<p className="mt-4 font-medium text-base max-w-[40vw] mx-auto">
|
<p className="mt-4 font-medium text-base max-w-[40vw] mx-auto">
|
||||||
Twelve years ago, a colossal demon fox terrorized the world.
|
{slide.description}
|
||||||
During the monster's attack on the Hidden Leaf Village, the
|
|
||||||
Hokage—the village's leader and most powerful ninja—sacrifices
|
|
||||||
himself to seal the beast inside a newborn, relieving
|
|
||||||
civilization from destruction while dooming the baby to a lonely
|
|
||||||
life. Now, after years of being shunned and bullied, Naruto
|
|
||||||
Uzumaki pesters the village with elaborate pranks and vandalism.
|
|
||||||
Despite these antics, he works hard to achieve his dream: to
|
|
||||||
become the Hokage and earn the acknowledgement of those who have
|
|
||||||
mistreated him for his entire life. Naruto joins Team 7, a ninja
|
|
||||||
squad made up of two of his peers—prodigy Sasuke Uchiha and
|
|
||||||
clever Sakura Haruno.
|
|
||||||
</p>
|
</p>
|
||||||
{slide.isClickable && (
|
{slide.isClickable && (
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user