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",
isClickable: false,
isClickable: true,
title: "Warning System",
tags: [],
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.",
buttonContent: "Watch Now",
buttonContent: "Learn More",
buttonLink: "https://www.example.com/boku-no-pico",
imageUrl: "",
startDate: "2024-01-01",
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
const Hero = () => {
const router = useRouter();
return (
<div className="h-120 rounded-md overflow-hidden">
<div className="h-120 rounded-lg overflow-hidden">
<Swiper
spaceBetween={0}
slidesPerView={1}
onSlideChange={() => console.log("slide change")}
onSwiper={(swiper) => console.log(swiper)}
className="h-full"
// autoplay={{ delay: 5000, disableOnInteraction: false }}
// modules={[Autoplay, Pagination, Navigation]}
autoplay={{ delay: 5000, disableOnInteraction: false }}
modules={[Autoplay, Pagination, Navigation]}
>
{dummyData.map((slide) =>
slide.imageUrl ? (
@ -73,7 +86,14 @@ const Hero = () => {
alt={slide.title}
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">
{slide.title}
</h1>
@ -87,19 +107,8 @@ const Hero = () => {
</Badge>
))}
</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 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 className="mt-4 font-medium text-base max-w-[40vw] line-clamp-6">
{slide.description}
</p>
{slide.isClickable && (
<Button
@ -111,6 +120,7 @@ const Hero = () => {
</Button>
)}
</div>
)}
</SwiperSlide>
) : (
// Fallback for slides without image
@ -129,18 +139,7 @@ const Hero = () => {
))}
</div>
<p className="mt-4 font-medium text-base max-w-[40vw] mx-auto">
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 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.
{slide.description}
</p>
{slide.isClickable && (
<Button