From c1e27447b0ad13a741793143c5e484958d68d0c0 Mon Sep 17 00:00:00 2001 From: Tejas Panchal Date: Tue, 29 Jul 2025 19:34:45 +0530 Subject: [PATCH] voice actor --- src/components/pageslider/PageSlider.jsx | 34 +-- src/components/voiceactor/Voiceactor.jsx | 40 ++-- .../voiceactorlist/VoiceactorList.jsx | 197 +++++++++--------- 3 files changed, 141 insertions(+), 130 deletions(-) diff --git a/src/components/pageslider/PageSlider.jsx b/src/components/pageslider/PageSlider.jsx index c42ebe2..0d66ccd 100644 --- a/src/components/pageslider/PageSlider.jsx +++ b/src/components/pageslider/PageSlider.jsx @@ -26,51 +26,59 @@ function PageSlider({ page, totalPages, handlePageChange, start = false, style } )); }; + return ( -
-
+
+
{page > 1 && totalPages > 2 && ( )} {page > 1 && ( )} {renderPageNumbers()} {page < totalPages && ( )} {page < totalPages && totalPages > 2 && ( )}
- ) + ); } -export default PageSlider \ No newline at end of file +export default PageSlider; \ No newline at end of file diff --git a/src/components/voiceactor/Voiceactor.jsx b/src/components/voiceactor/Voiceactor.jsx index bcc588e..bdb03d6 100644 --- a/src/components/voiceactor/Voiceactor.jsx +++ b/src/components/voiceactor/Voiceactor.jsx @@ -5,28 +5,27 @@ import VoiceactorList from "../voiceactorlist/VoiceactorList"; function Voiceactor({ animeInfo, className }) { const [showVoiceActors, setShowVoiceActors] = useState(false); return ( -
+
-

+

Characters & Voice Actors

-
-
+ +
{animeInfo.charactersVoiceActors.slice(0, 6).map((character, index) => (
{character.character && (
@@ -39,18 +38,18 @@ function Voiceactor({ animeInfo, className }) { onError={(e) => { e.target.src = "https://i.postimg.cc/HnHKvHpz/no-avatar.jpg"; }} - className="w-[45px] h-[45px] flex-shrink-0 rounded-full object-cover" + className="w-[48px] h-[48px] flex-shrink-0 rounded-full object-cover border-2 border-zinc-700 hover:border-zinc-500 transition-all duration-300 max-[480px]:w-[36px] max-[480px]:h-[36px]" loading="lazy" /> )}
{character.character.name && ( -

+

{character.character.name}

)} {character.character.cast && ( -

+

{character.character.cast}

)} @@ -60,10 +59,10 @@ function Voiceactor({ animeInfo, className }) { )} {character.voiceActors.length > 0 && character.voiceActors[0] && (
-
-
+
+
{character.voiceActors[0].name && ( - + {character.voiceActors[0].name} )} @@ -77,7 +76,7 @@ function Voiceactor({ animeInfo, className }) { onError={(e) => { e.target.src = "https://i.postimg.cc/HnHKvHpz/no-avatar.jpg"; }} - className="w-[45px] h-[45px] rounded-full object-cover grayscale hover:grayscale-0 hover:cursor-pointer flex-shrink-0 transition-all duration-300 ease-in-out" + className="w-[48px] h-[48px] rounded-full object-cover opacity-60 hover:opacity-100 cursor-pointer flex-shrink-0 transition-all duration-300 border-2 border-zinc-700 hover:border-zinc-500 max-[480px]:w-[36px] max-[480px]:h-[36px]" /> )}
@@ -86,6 +85,7 @@ function Voiceactor({ animeInfo, className }) {
))}
+ {showVoiceActors && ( ; @@ -54,119 +55,121 @@ function VoiceactorList({ id, isOpen, onClose }) { navigate("/404-not-found-page"); return null; } + return (
{ + if (e.target === e.currentTarget) onClose(); }} > -
- {!loading && ( -

- Characters & Voice Actors -

- )} +
+
e.stopPropagation()} + > + {/* Header */} +
+ {!loading && ( +

+ Characters & Voice Actors +

+ )} + +
- {loading ? ( - - ) : ( -
- {VoiceactorList.map((item, index) => ( -
-
- { - e.target.src = "https://i.postimg.cc/HnHKvHpz/no-avatar.jpg"; - }} - /> -
- {item.character.name && ( -

- {item.character.name} -

- )} - {item.character.cast && ( -

- {item.character.cast} -

- )} -
-
- - {item.voiceActors && - item.voiceActors.length > 0 && - (item.voiceActors.length > 1 ? ( -
- {item.voiceActors.map((data, index) => ( - { - e.target.src = "https://i.postimg.cc/HnHKvHpz/no-avatar.jpg"; - }} - /> - ))} -
- ) : ( -
- {item?.voiceActors[0]?.name && ( -

- {item.voiceActors[0].name} -

- )} + {/* Content */} +
+ {loading ? ( + + ) : ( +
+ {VoiceactorList.map((item, index) => ( +
+ {/* Character Section */} +
{ e.target.src = "https://i.postimg.cc/HnHKvHpz/no-avatar.jpg"; }} /> +
+ {item.character.name && ( +

+ {item.character.name} +

+ )} + {item.character.cast && ( +

+ {item.character.cast} +

+ )} +
- ))} + + {/* Voice Actors Section */} + {item.voiceActors && item.voiceActors.length > 0 && ( +
+ {item.voiceActors.length > 1 ? ( +
+ {item.voiceActors.map((actor, idx) => ( + { + e.target.src = "https://i.postimg.cc/HnHKvHpz/no-avatar.jpg"; + }} + /> + ))} +
+ ) : ( + <> +
+

+ {item.voiceActors[0].name} +

+
+ { + e.target.src = "https://i.postimg.cc/HnHKvHpz/no-avatar.jpg"; + }} + /> + + )} +
+ )} +
+ ))}
- ))} + )}
- )} -
- + {/* Pagination */} +
+ +
- -
);