121 lines
5.1 KiB
PHP
121 lines
5.1 KiB
PHP
@props([
|
|
'episode',
|
|
'view',
|
|
'displayjapanese' => false
|
|
])
|
|
|
|
@php
|
|
$title = $displayjapanese
|
|
? "{$episode->title_jpn} ({$episode->title}) - {$episode->episode}"
|
|
: "{$episode->title} - {$episode->episode}";
|
|
|
|
$isLoggedIn = auth()->check();
|
|
|
|
$isWatched = $isLoggedIn
|
|
? $episode->userWatched(auth()->id())
|
|
: false;
|
|
|
|
$problematic = cache()->rememberForever(
|
|
"episodeProblematic{$episode->id}",
|
|
fn () => $episode->getProblematicTags()
|
|
);
|
|
@endphp
|
|
|
|
<div class="group w-full p-1">
|
|
<a
|
|
href="{{ route('hentai.index', ['title' => $episode->slug]) }}"
|
|
class="block overflow-hidden rounded-2xl border dark:border-neutral-800 border-neutral-300 dark:bg-neutral-900 transition-all duration-300 hover:-translate-y-1 dark:hover:border-neutral-700 hover:border-neutral-400 hover:shadow-2xl hover:shadow-black/30"
|
|
>
|
|
<div class="relative overflow-hidden">
|
|
|
|
{{-- Thumbnail / Cover --}}
|
|
@if ($view === 'poster')
|
|
<img
|
|
src="{{ $episode->cover_url }}"
|
|
alt="{{ $episode->title }} - {{ $episode->episode }}"
|
|
loading="lazy"
|
|
width="400"
|
|
class="aspect-[11/16] w-full object-cover object-center transform-gpu transition-transform duration-500 group-hover:scale-[1.02]"
|
|
>
|
|
@elseif ($view === 'thumbnail')
|
|
<img
|
|
src="{{ $episode->gallery->first()?->thumbnail_url }}"
|
|
alt="{{ $episode->title }} - {{ $episode->episode }}"
|
|
loading="lazy"
|
|
width="1000"
|
|
class="w-full object-cover object-center transform-gpu transition-transform duration-500 group-hover:scale-[1.02]"
|
|
>
|
|
@endif
|
|
|
|
{{-- Overlay Gradient --}}
|
|
<div class="pointer-events-none absolute inset-0 bg-gradient-to-t from-black/80 via-black/10 to-transparent"></div>
|
|
|
|
{{-- Top Row --}}
|
|
<div class="absolute inset-x-0 top-0 z-20 flex items-start justify-between p-3">
|
|
|
|
{{-- Problematic Tags --}}
|
|
@if (!empty($problematic))
|
|
<div class="rounded-xl border border-red-500/30 bg-red-900/70 px-2.5 py-1 text-xs font-semibold text-white">
|
|
<i class="fa-solid fa-triangle-exclamation mr-1"></i>
|
|
{{ $problematic }}
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Resolution --}}
|
|
<div class="ml-auto rounded-xl bg-black/70 px-2.5 py-1 text-xs font-semibold tracking-wide text-neutral-100 ring-1 ring-white/10">
|
|
{{ $episode->getResolution() }}
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Bottom Stats --}}
|
|
<div class="absolute inset-x-0 bottom-0 z-20 p-3">
|
|
<div class="flex items-end justify-between gap-3">
|
|
|
|
{{-- Stats --}}
|
|
<div class="flex flex-1 flex-wrap items-center gap-x-3 gap-y-1 text-sm font-bold text-neutral-200">
|
|
|
|
<span class="flex items-center gap-1">
|
|
<i class="fa-regular fa-eye text-neutral-400"></i>
|
|
{{ $episode->viewCountFormatted() }}
|
|
</span>
|
|
|
|
<span class="flex items-center gap-1">
|
|
<i class="fa-regular fa-heart text-neutral-400"></i>
|
|
{{ $episode->likeCount() }}
|
|
</span>
|
|
|
|
<span class="flex items-center gap-1">
|
|
<i class="fa-regular fa-comment text-neutral-400"></i>
|
|
{{ $episode->commentCount() }}
|
|
</span>
|
|
</div>
|
|
|
|
{{-- Watched Status (logged in users only) --}}
|
|
@auth
|
|
@if ($isWatched)
|
|
<div class="shrink-0 rounded-full bg-emerald-800/40 px-2.5 py-1 text-xs font-semibold text-emerald-300 ring-1 ring-emerald-500/30">
|
|
@if ($view === 'thumbnail')
|
|
<i class="fa-solid fa-check mr-1"></i> Watched
|
|
@else
|
|
<i class="fa-solid fa-check"></i>
|
|
@endif
|
|
</div>
|
|
@else
|
|
<div class="shrink-0 rounded-full bg-rose-800/40 px-2.5 py-1 text-xs font-semibold text-rose-300 ring-1 ring-rose-500/30">
|
|
<i class="fa-solid fa-eye-slash"></i>
|
|
</div>
|
|
@endif
|
|
@endauth
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Content --}}
|
|
<div class="relative isolate border-t dark:border-neutral-800 dark:bg-neutral-900 bg-white border-neutral-100 p-4">
|
|
<h3 class="text-sm font-semibold leading-relaxed dark:text-neutral-100 transition-colors duration-200 dark:group-hover:text-white">
|
|
{{ $title }}
|
|
</h3>
|
|
</div>
|
|
</a>
|
|
</div> |