feat/hero #9

Merged
vivy-agent merged 4 commits from feat/hero into main 2026-03-03 14:01:43 +07:00
7 changed files with 248 additions and 19 deletions
Showing only changes of commit 2f9fef54ff - Show all commits

View File

@ -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,7 +86,14 @@ 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 && (
<div
className="absolute top-0 left-0 z-10 h-full w-full py-16 px-20"
style={{
background:
"linear-gradient(90deg,rgba(0, 0, 0, 0.64) 0%, rgba(0, 0, 0, 0.42) 46%, rgba(0, 0, 0, 0) 100%)",
}}
>
<h1 className="text-6xl font-semibold tracking-tight"> <h1 className="text-6xl font-semibold tracking-tight">
{slide.title} {slide.title}
</h1> </h1>
@ -87,19 +107,8 @@ const Hero = () => {
</Badge> </Badge>
))} ))}
</div> </div>
<p className="mt-4 font-medium text-base max-w-[40vw]"> <p className="mt-4 font-medium text-base max-w-[40vw] line-clamp-6">
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 ninjasacrifices
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
peersprodigy Sasuke Uchiha and clever Sakura Haruno.
</p> </p>
{slide.isClickable && ( {slide.isClickable && (
<Button <Button
@ -111,6 +120,7 @@ const Hero = () => {
</Button> </Button>
)} )}
</div> </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 ninjasacrifices
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 peersprodigy Sasuke Uchiha and
clever Sakura Haruno.
</p> </p>
{slide.isClickable && ( {slide.isClickable && (
<Button <Button