diff options
Diffstat (limited to 'components/anime/viewMode/thumbnailOnly.js')
| -rw-r--r-- | components/anime/viewMode/thumbnailOnly.js | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/components/anime/viewMode/thumbnailOnly.js b/components/anime/viewMode/thumbnailOnly.js new file mode 100644 index 0000000..6063dfc --- /dev/null +++ b/components/anime/viewMode/thumbnailOnly.js @@ -0,0 +1,59 @@ +import Image from "next/image"; +import Link from "next/link"; + +export default function ThumbnailOnly({ + info, + providerId, + episode, + artStorage, + progress, + dub, +}) { + const time = artStorage?.[episode?.id]?.time; + const duration = artStorage?.[episode?.id]?.duration; + let prog = (time / duration) * 100; + if (prog > 90) prog = 100; + return ( + <Link + // key={index} + href={`/en/anime/watch/${info.id}/${providerId}?id=${encodeURIComponent( + episode.id + )}&num=${episode.number}${dub ? `&dub=${dub}` : ""}`} + className="transition-all duration-200 ease-out lg:hover:scale-105 hover:ring-1 hover:ring-white cursor-pointer bg-secondary shrink-0 relative w-full h-[180px] sm:h-[130px] subpixel-antialiased rounded-md overflow-hidden" + > + <span className="absolute text-sm z-40 bottom-1 left-2 font-karla font-semibold text-white"> + Episode {episode?.number} + </span> + <span + className={`absolute bottom-7 left-0 h-1 bg-red-600`} + style={{ + width: + progress && artStorage && episode?.number <= progress + ? "100%" + : artStorage?.[episode?.id] + ? `${prog}%` + : "0%", + }} + /> + <div className="absolute inset-0 bg-black z-30 opacity-20" /> + <Image + // src={ + // providerId === "animepahe" + // ? `https://img.moopa.live/image-proxy?url=${encodeURIComponent( + // episode.img + // )}&headers=${encodeURIComponent( + // JSON.stringify({ Referer: "https://animepahe.com/" }) + // )}` + // : thumbnail?.img.includes("null") + // ? info.coverImage.large + // : thumbnail?.img || info.coverImage.large + // } + src={episode?.image} + alt="epi image" + width={500} + height={500} + className="object-cover w-full h-[150px] sm:h-[100px] z-20" + /> + </Link> + ); +} |