Update hentai info design & Remove livewire view count

This commit is contained in:
2026-05-24 15:52:22 +02:00
parent 9fc9e8ed10
commit 3574d20fae
6 changed files with 234 additions and 233 deletions

View File

@@ -1,29 +0,0 @@
<?php
namespace App\Livewire;
use App\Models\Episode;
use Livewire\Component;
class ViewCount extends Component
{
public $episodeId = 0;
public $viewCount = 0;
public function mount(Episode $episode)
{
$this->episodeId = $episode->id;
$this->viewCount = $episode->view_count;
}
public function update()
{
$this->viewCount = Episode::where('id', $this->episodeId)->firstOrFail()->view_count;
}
public function render()
{
return view('livewire.view-count');
}
}

View File

@@ -1,5 +1,5 @@
<section> <section>
<div class="overflow-hidden rounded-2xl border border-neutral-200 bg-white shadow-sm dark:border-neutral-800 dark:bg-neutral-900"> <div id="comments" class="overflow-hidden rounded-2xl border border-neutral-200 bg-white shadow-sm dark:border-neutral-800 dark:bg-neutral-900">
{{-- Header --}} {{-- Header --}}
<div class="border-b border-neutral-200 px-6 py-5 dark:border-neutral-800"> <div class="border-b border-neutral-200 px-6 py-5 dark:border-neutral-800">

View File

@@ -1,13 +1,9 @@
<div> <div>
@if (Auth::check()) <button class="inline-flex font-bold items-center gap-2 rounded-xl bg-gray-100 px-4 py-2 text-gray-700 dark:bg-white/5 dark:text-gray-200" wire:click="like" wire:poll.90000ms="update">
<div class="text-xl text-gray-800 dark:text-gray-200 leading-tight cursor-pointer whitespace-nowrap" wire:click="like" wire:poll.90000ms="update">
@else
<div data-te-toggle="tooltip" title="Please login to like the episode" class="text-xl text-gray-800 dark:text-gray-200 leading-tight cursor-pointer whitespace-nowrap" wire:poll.60000ms="update">
@endif
@if ($liked) @if ($liked)
<i class="fa-solid fa-heart pr-[4px] text-rose-600"></i> {{ $likeCount }} <i class="fa-solid fa-heart pr-[4px] text-rose-600"></i> {{ $likeCount }}
@else @else
<i class="fa-regular fa-heart pr-[4px]"></i> {{ $likeCount }} <i class="fa-regular fa-heart pr-[4px]"></i> {{ $likeCount }}
@endif @endif
</div> </button>
</div> </div>

View File

@@ -1,5 +0,0 @@
<div>
<a class="text-xl text-gray-800 dark:text-gray-200 leading-tight whitespace-nowrap" wire:poll.90000ms="update">
<i class="fa-regular fa-eye pr-0.5"></i> {{ $viewCount }}
</a>
</div>

View File

@@ -1,58 +1,66 @@
<div class="bg-transparent rounded-lg"> <div>
<div class="px-1 sm:px-2">
<p class="leading-normal font-bold text-lg text-gray-900 dark:text-gray-200"> <div class="mb-5 flex items-center justify-between">
<h2 class="text-xl font-bold text-gray-900 dark:text-white">
{{ __('stream.gallery') }} {{ __('stream.gallery') }}
</p> </h2>
</div>
@if ($gallery->count() > 5) @if ($gallery->count() > 5)
<div class="grid grid-rows-1 w-30 text-left"> <button
<ul data-te-lightbox-init class="list-none text-center" style="overflow: hidden;"> id="galleryToggle"
@php $counter = 0; @endphp class="text-sm font-semibold text-gray-900 dark:text-white transition">
@foreach($gallery as $image) {{ __('home.show-more') }}
@php $counter++; @endphp </button>
<li class="inline-block m-1 w-[45%] sm:w-[45%] md:w-[20%] xl:w-[18%]">
@if ($counter > 5)
<div class="!visible hidden" id="collapseGallery" data-te-collapse-item>
@else
<div>
@endif @endif
<div class="py-2 mt-2">
<img onClick="(function(){player.play(); player.pause(); })();" src="{{ $image->thumbnail_url }}" data-te-img="{{ $image->image_url }}" alt="{{ $episode->title }} - {{ $episode->episode }} - Screenshot {{ $counter }}" class="relative block items-center h-full w-full rounded-lg tracking-widest transition ease-in-out duration-150 cursor-zoom-in shadow-sm data-[te-lightbox-disabled]:cursor-auto" />
</div> </div>
<div
data-te-lightbox-init
class="grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5">
@foreach($gallery as $index => $image)
<div class="{{ $index >= 5 ? 'hidden extra-gallery-item' : '' }}">
<div
class="group overflow-hidden rounded-2xl border border-gray-200 bg-white shadow-sm transition hover:-translate-y-1 hover:shadow-xl dark:border-neutral-700 dark:bg-neutral-800">
<img
onClick="(function(){player.play(); player.pause(); })();"
src="{{ $image->thumbnail_url }}"
data-te-img="{{ $image->image_url }}"
alt="{{ $episode->title }} - Screenshot {{ $index + 1 }}"
class="aspect-video w-full cursor-zoom-in object-cover transition duration-300 group-hover:scale-105"
>
</div> </div>
</li>
</div>
@endforeach @endforeach
</ul>
</div> </div>
<div class="grid grid-rows-1 w-30 text-center">
<a id="galleryShowMore" data-te-collapse-init data-te-ripple-init data-te-ripple-color="light" href="#collapseGallery" role="button" aria-expanded="false" aria-controls="collapseGallery" class="text-sm float-right cursor-pointer text-rose-600">{{ __('home.show-more') }}</a>
</div>
<script>
var state = 0;
function toggleGallery() {
if (state == 0) {
document.getElementById('galleryShowMore').innerText = "{{ __('stream.show-less') }}";
state = 1;
} else {
document.getElementById('galleryShowMore').innerText = "{{ __('home.show-more') }}";
state = 0;
}
}
document.getElementById('galleryShowMore').addEventListener('click', toggleGallery);
</script>
@else
<div class="grid grid-rows-1 w-30 text-left">
<ul data-te-lightbox-init class="list-none text-center" style="overflow: hidden;">
@php $counter = 0; @endphp
@foreach($gallery as $image)
@php $counter++; @endphp
<li class="inline-block m-1 w-[45%] sm:w-[45%] md:w-[20%] xl:w-[18%]">
<div class="py-2 mt-2">
<img onClick="(function(){player.play(); player.pause(); })();" src="{{ $image->thumbnail_url }}" data-te-img="{{ $image->image_url }}" alt="{{ $episode->title }} - {{ $episode->episode }} - Screenshot {{ $counter }}" class="relative block items-center h-full w-full rounded-lg tracking-widest transition ease-in-out duration-150 cursor-zoom-in shadow-sm data-[te-lightbox-disabled]:cursor-auto" />
</div>
</li>
@endforeach
</ul>
</div>
@endif
</div> </div>
@if ($gallery->count() > 5)
<script>
const toggleBtn = document.getElementById('galleryToggle');
const hiddenItems = document.querySelectorAll('.extra-gallery-item');
let expanded = false;
toggleBtn.addEventListener('click', () => {
expanded = !expanded;
hiddenItems.forEach(item => {
item.classList.toggle('hidden');
});
toggleBtn.innerText = expanded
? "{{ __('stream.show-less') }}"
: "{{ __('home.show-more') }}";
});
</script>
@endif

View File

@@ -1,167 +1,198 @@
<div class="overflow-hidden p-5 bg-transparent bg-white rounded-xl dark:bg-neutral-800"> <div
class="overflow-hidden rounded-2xl border border-gray-200/70 bg-white/90 shadow-sm backdrop-blur-sm transition-colors dark:border-white/10 dark:bg-neutral-900/80">
<div class="p-5 md:p-7">
<input id="e_id" type="hidden" value="{{ $episode->id }}" />
<div class="flex flex-col gap-6 lg:flex-row">
<!-- Cover --> <!-- Cover -->
<div class="w-[100px] md:w-[150px] mr-4 float-left hidden md:block"> <div class="hidden shrink-0 md:block">
<img alt="{{ $episode->title }}" loading="lazy" width="150" <img
class="block relative rounded-xl object-cover object-center aspect-[11/16] z-20" alt="{{ $episode->title }}"
src="{{ $episode->cover_url }}"></img> loading="lazy"
width="180"
src="{{ $episode->cover_url }}"
class="aspect-[11/16] w-[140px] rounded-2xl object-cover shadow-lg ring-1 ring-black/5 dark:ring-white/10" />
</div> </div>
<!-- Info --> <!-- Main Content -->
<div class="relative"> <div class="flex-1">
<input id="e_id" type="hidden" value="{{ $episode->id }}" /> <div class="flex flex-col gap-5 xl:flex-row xl:items-start xl:justify-between">
<div class="flex flex-col justify-between xl:flex-row">
<div>
<!-- Title -->
<h1 class="text-3xl font-bold text-rose-600">
<a class="text-rose-600 break-words hover:underline hover:underline-offset-4"
href="{{ route('hentai.index', ['title' => $episode->hentai->slug]) }}">{{ $episode->title }}</a>
- {{ $episode->episode }}
</h1>
<div>
<h2 class="inline leading-tight text-gray-800 dark:text-white">{{ $episode->title_jpn }}</h2>
<a data-te-toggle="tooltip" <!-- Title + Metadata -->
title="Uploaded {{ $episode->created_at->diffForHumans(['parts' => 2]) }}" <div class="min-w-0">
class="pl-1 leading-tight text-gray-800 text-l dark:text-white"> <h1
<p class="inline"> class="break-words text-2xl font-black tracking-tight text-gray-900 dark:text-white md:text-4xl">
| <i class="fa-solid fa-upload"></i> {{ $episode->created_at->format('Y-m-d') }} | <a
</p> href="{{ route('hentai.index', ['title' => $episode->hentai->slug]) }}"
class="bg-gradient-to-r from-rose-500 to-pink-500 bg-clip-text text-transparent transition hover:opacity-80">
{{ $episode->title }} - {{ $episode->episode }}
</a> </a>
<a data-te-toggle="tooltip" </h1>
title="Released {{ \Carbon\Carbon::parse($episode->release_date)->diffForHumans(['parts' => 2]) }}"
class="pl-1 leading-tight text-gray-800 text-l dark:text-white"> <p class="mt-2 text-sm text-gray-500 dark:text-gray-400 md:text-base">
<p class="inline"> {{ $episode->title_jpn }}
<i class="fa-regular fa-calendar"></i> {{ $episode->release_date }}
|
</p> </p>
</a>
<a href="{{ route('hentai.search', ['order' => 'recently-uploaded', 'studios[0]' => $episode->studio->slug]) }}" <!-- Meta Pills -->
class="leading-tight text-gray-800 text-l dark:text-white hover:underline hover:underline-offset-4"> <div class="mt-4 flex flex-wrap items-center gap-2 text-sm">
<div
class="inline-flex items-center gap-2 rounded-full bg-gray-100 px-3 py-1 text-gray-700 dark:bg-white/5 dark:text-gray-300">
<i class="fa-solid fa-upload text-xs"></i>
{{ $episode->created_at->format('Y-m-d') }}
</div>
<div
class="inline-flex items-center gap-2 rounded-full bg-gray-100 px-3 py-1 text-gray-700 dark:bg-white/5 dark:text-gray-300">
<i class="fa-regular fa-calendar text-xs"></i>
{{ $episode->release_date }}
</div>
<a
href="{{ route('hentai.search', ['order' => 'recently-uploaded', 'studios[0]' => $episode->studio->slug]) }}"
class="inline-flex items-center rounded-full bg-rose-100 px-3 py-1 font-medium text-rose-700 transition hover:bg-rose-200 dark:bg-rose-500/10 dark:text-rose-300 dark:hover:bg-rose-500/20">
{{ $episode->studio->name }} {{ $episode->studio->name }}
</a> </a>
<a id="av1-unsupported" data-te-toggle="tooltip"
title="For 1080p and 4k streams we are using the new AV1 codec. Edge users on Windows have to install the AV1 extension pack from the Microsoft Store." <a
class="hidden leading-tight text-red-800 cursor-pointer text-l dark:text-red-500"> id="av1-unsupported"
data-te-toggle="tooltip"
title="For 1080p and 4k streams we are using the new AV1 codec."
class="hidden rounded-full bg-red-100 px-3 py-1 text-sm font-medium text-red-700 dark:bg-red-500/10 dark:text-red-400">
AV1 Unsupported AV1 Unsupported
</a> </a>
</div> </div>
</div> </div>
<div> <!-- Stats + Actions -->
<!-- View Count and Misc Buttons --> <div class="flex flex-col gap-3 xl:items-end min-w-[330px]">
<div class="float-right">
<div class="grid"> <!-- Stats -->
<div class="flex gap-x-4"> <div class="flex flex-wrap items-center gap-3">
<div
class="inline-flex font-bold items-center gap-2 rounded-xl bg-gray-100 px-4 py-2 text-gray-700 dark:bg-white/5 dark:text-gray-200">
<i class="fa-regular fa-eye"></i>
{{ $episode->viewCountFormatted() }}
</div>
@auth @auth
@livewire('view-count', ['episode' => $episode])
@livewire('like-button', ['episode' => $episode]) @livewire('like-button', ['episode' => $episode])
@endauth @endauth
@guest @guest
<div> <div
<a class="text-xl leading-tight text-gray-800 whitespace-nowrap dark:text-gray-200"> data-te-toggle="tooltip"
<i class="pr-0.5 fa-regular fa-eye"></i> {{ $episode->viewCountFormatted() }} title="Please login to like the episode"
</a> class="inline-flex cursor-pointer items-center gap-2 rounded-xl bg-gray-100 px-4 py-2 text-gray-700 dark:bg-white/5 dark:text-gray-200">
</div> <i class="fa-regular fa-heart"></i>
<div data-te-toggle="tooltip" title="Please login to like the episode" {{ $episode->likeCount() }}
class="text-xl leading-tight text-gray-800 whitespace-nowrap cursor-pointer dark:text-gray-200">
<i class="fa-regular fa-heart pr-[4px]"></i> {{ $episode->likeCount() }}
</div> </div>
@endguest @endguest
@php $commentcount = $episode->commentCount(); @endphp @php $commentcount = $episode->commentCount(); @endphp
@if ($commentcount > 0)
<a href="#comments" <a
class="text-xl leading-tight text-gray-800 whitespace-nowrap dark:text-gray-200"> href="#comments"
<i class="pr-0.5 fa-regular fa-comment"></i> {{ $commentcount }} class="inline-flex items-center gap-2 rounded-xl bg-gray-100 px-4 py-2 text-gray-700 transition hover:bg-gray-200 dark:bg-white/5 dark:text-gray-200 dark:hover:bg-white/10">
<i class="fa-regular fa-comment"></i>
{{ $commentcount }}
</a> </a>
@else
<a href="#comments" data-te-toggle="tooltip" title="Be the first one to comment!"
class="text-xl leading-tight text-gray-800 whitespace-nowrap dark:text-gray-200">
<i class="pr-0.5 fa-regular fa-comment"></i> {{ $commentcount }}
</a>
@endif
</div> </div>
<div> <!-- Action Buttons -->
<div class="flex flex-wrap gap-2">
@if(!$episode->dmca_takedown) @if(!$episode->dmca_takedown)
<a data-te-toggle="modal" data-te-target="#modalDownload" id="reloadCaptchaModal" <a
class="text-xl leading-tight text-gray-800 whitespace-nowrap cursor-pointer dark:text-gray-200"> data-te-toggle="modal"
<i class="fa-solid fa-download pr-[4px]"></i> {{ __('stream.download') }} data-te-target="#modalDownload"
id="reloadCaptchaModal"
class="inline-flex cursor-pointer items-center gap-2 rounded-xl bg-rose-600 px-4 py-2 text-sm font-semibold text-white transition hover:bg-rose-700">
<i class="fa-solid fa-download"></i>
{{ __('stream.download') }}
</a> </a>
@endif @endif
<a data-te-toggle="modal" data-te-target="#modalShare" <a
class="text-xl leading-tight text-gray-800 whitespace-nowrap cursor-pointer dark:text-gray-200"> data-te-toggle="modal"
<i class="fa-solid fa-share pr-[4px]"></i> {{ __('stream.share') }} data-te-target="#modalShare"
class="inline-flex cursor-pointer items-center gap-2 rounded-xl border border-gray-300 bg-white px-4 py-2 text-sm font-semibold text-gray-700 transition hover:bg-gray-100 dark:border-white/10 dark:bg-white/5 dark:text-gray-200 dark:hover:bg-white/10">
<i class="fa-solid fa-share"></i>
{{ __('stream.share') }}
</a> </a>
</div>
@auth @auth
<div> <a
<a data-te-toggle="modal" data-te-target="#modalAddToPlaylist" data-te-toggle="modal"
class="text-xl leading-tight text-gray-800 whitespace-nowrap cursor-pointer dark:text-gray-200"> data-te-target="#modalAddToPlaylist"
<i class="fa-solid fa-square-plus pr-[6px]"></i> {{ __('playlist.playlist') }} class="inline-flex cursor-pointer items-center gap-2 rounded-xl border border-gray-300 bg-white px-4 py-2 text-sm font-semibold text-gray-700 transition hover:bg-gray-100 dark:border-white/10 dark:bg-white/5 dark:text-gray-200 dark:hover:bg-white/10">
<i class="fa-solid fa-square-plus"></i>
{{ __('playlist.playlist') }}
</a> </a>
</div>
@endauth @endauth
</div> </div>
</div> </div>
</div> </div>
</div>
<hr class="mt-2 mb-2 border-gray-400/40"> <!-- Description -->
<p class="text-lg font-bold leading-normal text-rose-600"> <div class="mt-8 border-t border-gray-200 pt-6 dark:border-white/10">
<h2 class="mb-3 text-lg font-bold text-gray-900 dark:text-white">
{{ __('stream.description') }} {{ __('stream.description') }}
</p> </h2>
<p class="text-gray-800 dark:text-gray-200 leading-tight min-h-[50%]">
<p class="leading-relaxed text-gray-700 dark:text-gray-300">
{{ $episode->description }} {{ $episode->description }}
</p> </p>
<hr class="mt-2 mb-1 border-gray-400/40"> </div>
<p class="text-lg font-bold leading-normal text-rose-600">
<!-- Genres -->
<div class="mt-8 border-t border-gray-200 pt-6 dark:border-white/10">
<h2 class="mb-4 text-lg font-bold text-gray-900 dark:text-white">
{{ __('stream.genres') }} {{ __('stream.genres') }}
</p> </h2>
<ul class="list-none text-center" style="overflow: hidden;">
<a class="text-gray-400"> <div class="flex flex-wrap gap-2">
|
</a>
@foreach ($episode->tags->sortBy('slug') as $tag) @foreach ($episode->tags->sortBy('slug') as $tag)
<li class="inline-block p-1">
@if ($tag->slug == 'uncensored' || $tag->slug == 'vanilla' || $tag->slug == '4k') @php
<a href="{{ route('hentai.search', ['order' => 'recently-uploaded', 'tags[0]' => $tag->slug]) }}" $classes = 'bg-gray-100 text-gray-700 hover:bg-rose-600 hover:text-white dark:bg-white/5 dark:text-gray-300 dark:hover:bg-rose-600';
class="block relative items-center px-2 py-2 mt-1 text-xs font-semibold tracking-widest text-green-500 uppercase rounded-md border border-transparent transition duration-150 ease-in-out dark:focus:ring-offset-gray-800 dark:hover:text-white hover:text-white hover:bg-green-700 focus:bg-green-700 active:bg-green-900 focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2">
{{ $tag->name }} if (in_array($tag->slug, ['uncensored', 'vanilla', '4k'])) {
</a> $classes = 'bg-green-100 text-green-700 hover:bg-green-600 hover:text-white dark:hover:text-white dark:bg-green-500/10 dark:text-green-400 dark:hover:bg-green-600';
@elseif($tag->slug == 'censored') }
<a href="{{ route('hentai.search', ['order' => 'recently-uploaded', 'tags[0]' => $tag->slug]) }}"
class="block relative items-center px-2 py-2 mt-1 text-xs font-semibold tracking-widest text-yellow-600 uppercase rounded-md border border-transparent transition duration-150 ease-in-out dark:focus:ring-offset-gray-800 dark:hover:text-white hover:text-white hover:bg-yellow-700 focus:bg-yellow-700 active:bg-yellow-900 focus:outline-none focus:ring-2 focus:ring-yellow-500 focus:ring-offset-2"> if ($tag->slug === 'censored') {
{{ $tag->name }} $classes = 'bg-yellow-100 text-yellow-700 hover:bg-yellow-500 hover:text-white dark:hover:text-white dark:bg-yellow-500/10 dark:text-yellow-400 dark:hover:bg-yellow-500';
</a> }
@elseif(
$tag->slug == 'gore' || if (in_array($tag->slug, ['gore', 'horror', 'scat', 'ntr', 'rape'])) {
$tag->slug == 'horror' || $classes = 'bg-red-100 text-red-700 hover:bg-red-600 hover:text-white dark:hover:text-white dark:bg-red-500/10 dark:text-red-400 dark:hover:bg-red-600';
$tag->slug == 'scat' || }
$tag->slug == 'ntr' || @endphp
$tag->slug == 'rape')
<a href="{{ route('hentai.search', ['order' => 'recently-uploaded', 'tags[0]' => $tag->slug]) }}" <a
class="block relative items-center px-2 py-2 mt-1 text-xs font-semibold tracking-widest text-red-600 uppercase rounded-md border border-transparent transition duration-150 ease-in-out dark:focus:ring-offset-gray-800 dark:hover:text-white hover:text-white hover:bg-red-700 focus:bg-red-700 active:bg-red-900 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2"> href="{{ route('hentai.search', ['order' => 'recently-uploaded', 'tags[0]' => $tag->slug]) }}"
<i class="fa-solid fa-triangle-exclamation"></i> {{ $tag->name }} class="inline-flex items-center gap-2 rounded-full px-4 py-2 text-xs font-bold uppercase tracking-wide transition {{ $classes }}">
</a>
@else @if(in_array($tag->slug, ['gore', 'horror', 'scat', 'ntr', 'rape']))
<a href="{{ route('hentai.search', ['order' => 'recently-uploaded', 'tags[0]' => $tag->slug]) }}" <i class="fa-solid fa-triangle-exclamation text-[10px]"></i>
class="block relative items-center px-2 py-2 mt-1 text-xs font-semibold tracking-widest uppercase rounded-md border border-transparent transition duration-150 ease-in-out dark:focus:ring-offset-gray-800 dark:text-white hover:text-white hover:bg-rose-700 focus:bg-rose-700 active:bg-rose-900 focus:outline-none focus:ring-2 focus:ring-rose-500 focus:ring-offset-2">
{{ $tag->name }}
</a>
@endif @endif
</li>
<a class="text-gray-400"> {{ $tag->name }}
|
</a> </a>
@endforeach @endforeach
</ul> </div>
<hr class="mt-2 mb-1 border-gray-400/40"> </div>
<div class="inline-block pt-5">
<!-- Gallery -->
<div class="mt-8 border-t border-gray-200 pt-6 dark:border-white/10">
@include('stream.partials.gallery') @include('stream.partials.gallery')
</div> </div>
</div> </div>
</div>
</div>
</div> </div>