movie-night-nuevo/resources/views/livewire/movie-list.blade.php
Edward Tirado Jr. 8f47f40b03
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
removed sorting placeholder
2025-12-26 13:47:30 -06:00

81 lines
4.1 KiB
PHP

<div class=" text-white pt-10 flex flex-col gap-5">
<div class="flex flex-row justify-between items-center mx-2 sm:mx-0">
<h1 class="text-2xl sm:text-3xl font-bold">{{$list->name}}</h1>
<button type="button" wire:click="toggleSettings"
class="hover:bg-blue-600 cursor-pointer text-white px-4 py-2 rounded">
<i class="fas fa-cog text-2xl"></i>
</button>
</div>
<x-ui.card class="overflow-hidden min-h-screen">
<div class="absolute">
<livewire:search-panel :list-id="$list->id"/>
<livewire:movie-details-panel/>
</div>
<div class="relative w-full overflow-hidden">
<div class="flex transition-transform duration-300 ease-in-out"
style="transform: translateX({{ $showSettings ? '-100%' : '0' }})">
<!-- Movie List View -->
<div class="w-full flex-shrink-0 flex flex-col gap-5">
<div class="flex flex-col-reverse sm:flex-row gap-5 sm:gap-0 justify-between w-full">
<div>
<input class="flex bg-white p-2 rounded sm:w-100" type="text" placeholder="Filter movies"
wire:model.live="filterText"
wire:keyup="filterMovies"/>
</div>
<hr class="my-2 sm:my-0"/>
<button wire:click="$dispatch('openSearch')"
class="bg-green-500 text-white p-2 rounded">
Add Movie
</button>
</div>
@if(!$filteredMovies->isEmpty())
<ul class="grid grid-cols-2 sm:grid-cols-4 gap-5">
@foreach ($filteredMovies as $movie)
<li class="bg-gray-200">
<x-movie :movie="$movie"/>
</li>
@endforeach
</ul>
@else
<div class="flex flex-col items-center justify-center my-10">
<span class="text-center p-5 font-bold text-2xl">"You complete me."</span>
<span class="text-center">Tom Cruise, <i>Jerry Maguire</i></span>
</div>
@endif
</div>
<!-- Settings View -->
<div class="w-full flex-shrink-0 flex flex-col gap-5">
<div class="flex justify-between items-center">
<button wire:click="toggleSettings" class="text-white hover:text-gray-300">
Back to List
</button>
<h2 class="text-xl font-semibold">Settings</h2>
</div>
<div class="flex flex-col gap-2 w-full p-5">
<label for="list-name">List Name</label>
<div class="flex flex-row">
<input type="text" wire:model.live="settingsForm.name" id="list-name"
class="w-full p-2 rounded rounded-r-none bg-white"/>
<button class="bg-green-400 p-2 rounded-r" type="submit" wire:click="saveSettings">Save
</button>
</div>
</div>
<div
class="flex items-center justify-between bg-gray-700 hover:bg-gray-500 hover:opacity-85 p-5 rounded">
<label for="is_public" class="text-white cursor-pointer">Make list public</label>
<input type="checkbox"
id="is_public"
wire:model.live="settingsForm.isPublic"
class="w-5 h-5 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500">
</div>
</div>
</div>
</div>
</x-ui.card>
</div>