blob: 06a92f5da112b40970f6ccdb0187f8023cd32cd1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
import Image from "next/image";
import Link from "next/link";
import { parseImageProxy } from "../../../utils/imageUtils";
export default function ThumbnailOnly({
info,
// image,
providerId,
episode,
artStorage,
progress,
dub,
}) {
const time = artStorage?.[episode?.id]?.timeWatched;
const duration = artStorage?.[episode?.id]?.duration;
let prog = (time / duration) * 100;
if (prog > 90) prog = 100;
const parsedImage = episode?.img
? episode?.img?.includes("null")
? info.coverImage?.extraLarge
: episode?.img
: info.coverImage?.extraLarge || null;
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 || 0}
</span>
<span
className={`absolute bottom-7 left-0 h-[2px] bg-red-600`}
style={{
width:
progress && episode?.number <= progress
? "100%"
: artStorage?.[episode?.id]
? `${prog}%`
: "0%",
}}
/>
{/* <div className="absolute inset-0 bg-black z-30 opacity-20" /> */}
{parsedImage && (
<Image
src={
parseImageProxy(
parsedImage,
providerId === "animepahe" ? "https://animepahe.ru" : undefined
) || ""
}
alt={`Episode ${episode?.number} Thumbnail`}
width={500}
height={500}
className="object-cover w-full h-[150px] sm:h-[100px] z-20 brightness-75"
/>
)}
</Link>
);
}
|