mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 18:20:48 +01:00
feat: implement summoner emote index
This commit is contained in:
@@ -4,14 +4,19 @@ namespace App\Http\Controllers;
|
|||||||
|
|
||||||
use App\Models\SummonerEmote;
|
use App\Models\SummonerEmote;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Spatie\QueryBuilder\QueryBuilder;
|
||||||
|
|
||||||
class SummonerEmoteController extends Controller
|
class SummonerEmoteController extends Controller
|
||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$this->authorize('viewAny', SummonerEmote::class);
|
$emotes = QueryBuilder::for(SummonerEmote::class)
|
||||||
|
->allowedFilters('title')
|
||||||
|
->defaultSort('-emote_id')
|
||||||
|
->paginate(72)
|
||||||
|
->appends(request()->query());
|
||||||
|
|
||||||
return SummonerEmote::all();
|
return view('emotes.index', compact('emotes'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
@@ -29,8 +34,6 @@ class SummonerEmoteController extends Controller
|
|||||||
|
|
||||||
public function show(SummonerEmote $summonerEmote)
|
public function show(SummonerEmote $summonerEmote)
|
||||||
{
|
{
|
||||||
$this->authorize('view', $summonerEmote);
|
|
||||||
|
|
||||||
return $summonerEmote;
|
return $summonerEmote;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,16 @@
|
|||||||
|
|
||||||
namespace App\View\Components\Emotes;
|
namespace App\View\Components\Emotes;
|
||||||
|
|
||||||
|
use App\Models\SummonerEmote;
|
||||||
use Illuminate\Contracts\View\View;
|
use Illuminate\Contracts\View\View;
|
||||||
use Illuminate\View\Component;
|
use Illuminate\View\Component;
|
||||||
|
|
||||||
class List_all extends Component
|
class List_all extends Component
|
||||||
{
|
{
|
||||||
|
public function __construct(public SummonerEmote $emotes)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public function render(): View
|
public function render(): View
|
||||||
{
|
{
|
||||||
return view('components.emotes.list_all');
|
return view('components.emotes.list_all');
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
<div class="flex justify-center space-x-4">
|
<div class="flex justify-center space-x-4">
|
||||||
<a href="{{route('assets.icons.index')}}"
|
<a href="{{route('assets.icons.index')}}"
|
||||||
class="bg-orange-500 text-white font-bold py-2 px-4 rounded hover:bg-orange-600">Icons</a>
|
class="bg-orange-500 text-white font-bold py-2 px-4 rounded hover:bg-orange-600">Icons</a>
|
||||||
<a href="#" class="bg-orange-500 text-white font-bold py-2 px-4 rounded hover:bg-orange-600">Emotes</a>
|
<a href="{{route('assets.emotes.index')}}" class="bg-orange-500 text-white font-bold py-2 px-4 rounded hover:bg-orange-600">Emotes</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,40 @@
|
|||||||
<div>
|
<?php
|
||||||
|
/** @var App\Models\SummonerEmote $emote */ ?>
|
||||||
|
|
||||||
|
<section class="max-w-screen-xl mx-auto mt-12">
|
||||||
|
<h2
|
||||||
|
class="text-3xl font-bold text-center text-transparent uppercase sm:text-4xl
|
||||||
|
bg-gradient-to-bl from-orange-300 to-orange-500 bg-clip-text">
|
||||||
|
Summoner Emotes</h2>
|
||||||
|
|
||||||
|
<x-emotes.searchbar/>
|
||||||
|
|
||||||
|
<div class="container mx-auto p-4 flex items-center justify-center mt-3">
|
||||||
|
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-6">
|
||||||
|
|
||||||
|
@foreach($emotes as $key => $emote)
|
||||||
|
<div
|
||||||
|
class="champ-card flex flex-col text-gray-700 bg-stone-800/40 shadow-md rounded-2xl bg-clip-border
|
||||||
|
border border-stone-800 hover:border-orange-500/10 hover:shadow-orange-500/10 items-center">
|
||||||
|
<div
|
||||||
|
class="mx-4 overflow-hidden h-36 w-36 rounded-2xl bg-clip-border border-2 border-orange-400/40 mt-3">
|
||||||
|
<img @if($key < 8) loading="eager" @else loading="lazy" @endif
|
||||||
|
src="//wsrv.nl/?url={{ $emote->image }}&w=200&output=webp&q=50&il&default=ssl:wsrv.nl%2F%3Furl%3Dhttps://i.ibb.co/5s6YyvN/aaaa.png"
|
||||||
|
class="object-cover w-full h-full "
|
||||||
|
alt="{{ $emote->title }} Emote"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="px-4 py-2">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<p class="block text-sm antialiased font-medium text-gray-100 text-center">
|
||||||
|
{{ $emote->title }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ $emotes->links() }}
|
||||||
|
</section>
|
||||||
|
|||||||
27
resources/views/components/emotes/searchbar.blade.php
Normal file
27
resources/views/components/emotes/searchbar.blade.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<div class="flex items-center justify-center mt-8 ">
|
||||||
|
<form action="{{ route('assets.emotes.index') }}" method="GET" class="flex" id="searchForm">
|
||||||
|
<div class="relative">
|
||||||
|
<input type="text" name="filter[title]" placeholder="Search by emote name"
|
||||||
|
value="{{ request('filter.title') }}"
|
||||||
|
class="border border-transparent focus:border-transparent focus:ring-0 border-stone-700 rounded-l
|
||||||
|
px-4 py-2 bg-stone-800 text-white ring-orange-500 pr-10">
|
||||||
|
@if(request('filter.title'))
|
||||||
|
<button type="button" onclick="clearSearchAndSubmit()"
|
||||||
|
class="absolute inset-y-0 right-0 flex items-center px-3 bg-stone-800 text-white cursor-pointer">
|
||||||
|
<x-iconsax-lin-clipboard-close class="w-6 text-white"/>
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
<button type="submit"
|
||||||
|
class="bg-orange-500 hover:bg-orange-600 text-white font-semibold px-4 py-2 rounded-r
|
||||||
|
focus:outline-none ring-orange-500">
|
||||||
|
Search
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
function clearSearchAndSubmit() {
|
||||||
|
document.querySelector('input[name="filter[title]"]').value = '';
|
||||||
|
document.getElementById('searchForm').submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
|
<!-- Favicon -->
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="/img/icons/apple-touch-icon.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="32x32" href="/img/icons/favicon-32x32.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="16x16" href="/img/icons/favicon-16x16.png">
|
||||||
|
<link rel="manifest" href="/img/icons/site.webmanifest">
|
||||||
|
<link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color="#e6855e">
|
||||||
|
<link rel="shortcut icon" href="/img/icons/favicon.ico">
|
||||||
|
<meta name="msapplication-TileColor" content="#ff7c47">
|
||||||
|
<meta name="msapplication-config" content="/img/icons/browserconfig.xml">
|
||||||
|
<meta name="theme-color" content="#ff7c47">
|
||||||
|
|
||||||
|
<title>Heimerdinger.LoL • Emotes</title>
|
||||||
|
<meta name="description"
|
||||||
|
content="Explore all LoL Emotes on Heimerdinger.LoL. Find detailed information on popular emotes such as Dab Pengu, Bee Mad, Little Camper and more!">
|
||||||
|
|
||||||
|
<!-- OpenGraph -->
|
||||||
|
<meta property="og:site_name" content="Heimerdinger.LoL">
|
||||||
|
<meta property="og:title" content="Heimerdinger.LoL • Icons">
|
||||||
|
<meta property="og:description"
|
||||||
|
content="Explore all LoL Emotes on Heimerdinger.LoL. Find detailed information on popular emotes such as Dab Pengu, Bee Mad, Little Camper and more!">
|
||||||
|
<meta property="og:locale" content="en">
|
||||||
|
<meta property="og:type" content="website">
|
||||||
|
<meta property="og:image" content="{{asset('img/og_image.png')}}">
|
||||||
|
|
||||||
|
<!-- Twitter -->
|
||||||
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
|
<meta property="twitter:domain" content="heimerdinger.lol">
|
||||||
|
<meta property="twitter:title" content="Heimerdinger.LoL • Icons">
|
||||||
|
<meta property="twitter:description"
|
||||||
|
content="Explore all LoL Emotes on Heimerdinger.LoL. Find detailed information on popular emotes such as Dab Pengu, Bee Mad, Little Camper and more!">
|
||||||
|
<meta property="twitter:image" content="{{asset('img/og_image.png')}}">
|
||||||
|
|
||||||
|
<link rel="preconnect" href="https://rsms.me/">
|
||||||
|
<link rel="preload" href="https://rsms.me/inter/inter.css" as="style">
|
||||||
|
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" media="print" onload="this.media='all'">
|
||||||
|
|
||||||
|
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="antialiased bg-stone-900 dark scroll-smooth">
|
||||||
|
<x-navbar/>
|
||||||
|
<x-emotes.list_all :emotes="$emotes"/>
|
||||||
|
<x-footer/>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user