164 lines
10 KiB
PHP
164 lines
10 KiB
PHP
@extends('layouts.nova')
|
|
|
|
@php($useUnifiedSeo = true)
|
|
|
|
@section('content')
|
|
<div class="px-6 pt-10 pb-8 md:px-10" id="search-page" data-q="{{ $q ?? '' }}">
|
|
<div class="mb-8">
|
|
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
|
<div>
|
|
<p class="mb-1 text-xs font-semibold uppercase tracking-widest text-white/30">Discover</p>
|
|
<h1 class="flex items-center gap-3 text-3xl font-bold leading-tight text-white">
|
|
<i class="fa-solid fa-magnifying-glass text-2xl text-sky-400"></i>
|
|
Search
|
|
</h1>
|
|
<p class="mt-1 text-sm text-white/50">
|
|
{{ $hasQuery ? 'Results for "' . $q . '"' : 'Find artworks, creators, groups, and styles across Skinbase.' }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<form action="/search" method="GET" class="relative mt-5 max-w-3xl" role="search">
|
|
<input
|
|
type="search"
|
|
name="q"
|
|
value="{{ $q ?? '' }}"
|
|
placeholder="Search artworks, groups, artists, tags..."
|
|
autofocus
|
|
class="w-full rounded-xl border border-white/10 bg-white/[0.05] py-3 pl-4 pr-12 text-white outline-none transition-colors placeholder:text-neutral-500 focus:border-sky-500"
|
|
>
|
|
@if($hasQuery)
|
|
<input type="hidden" name="sort" value="{{ $sort ?? 'latest' }}">
|
|
@endif
|
|
<button type="submit" class="absolute right-3 top-1/2 -translate-y-1/2 text-neutral-400 transition-colors hover:text-sky-400">
|
|
<svg class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-4.35-4.35M17 11A6 6 0 1 1 5 11a6 6 0 0 1 12 0z" />
|
|
</svg>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|
|
@if($hasQuery)
|
|
<div class="mb-6 flex flex-wrap items-center gap-3">
|
|
<span class="text-sm text-neutral-400">Sort by:</span>
|
|
@foreach(['latest' => 'Newest', 'popular' => 'Most viewed', 'likes' => 'Most liked', 'downloads' => 'Most downloaded'] as $key => $label)
|
|
<a
|
|
href="{{ request()->fullUrlWithQuery(['sort' => $key, 'page' => null]) }}"
|
|
class="rounded-lg px-3 py-1.5 text-xs font-medium transition-colors {{ ($sort ?? 'latest') === $key ? 'bg-sky-500 text-white' : 'bg-white/5 text-neutral-400 hover:bg-white/10 hover:text-white' }}"
|
|
>
|
|
{{ $label }}
|
|
</a>
|
|
@endforeach
|
|
|
|
<span class="ml-auto text-sm text-neutral-500">
|
|
{{ number_format($resultCount + $groupResultCount + $newsResultCount) }} {{ ($resultCount + $groupResultCount + $newsResultCount) === 1 ? 'result' : 'results' }}
|
|
</span>
|
|
</div>
|
|
@endif
|
|
|
|
@if($groupResultCount > 0)
|
|
<section class="mb-8 rounded-[28px] border border-white/10 bg-white/[0.03] p-5 shadow-[0_18px_50px_rgba(2,6,23,0.2)]">
|
|
<div class="mb-4 flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between">
|
|
<div>
|
|
<p class="text-[11px] font-semibold uppercase tracking-[0.2em] text-sky-200/80">Groups</p>
|
|
<h2 class="mt-1 text-xl font-semibold text-white">Collaborative identities matching your search</h2>
|
|
<p class="mt-1 text-sm text-slate-400">Explore shared publishing brands, contributor teams, and recruiting collectives related to this query.</p>
|
|
</div>
|
|
<a href="/groups" class="text-sm font-semibold text-sky-300 transition hover:text-white">Browse all groups</a>
|
|
</div>
|
|
|
|
<div class="grid gap-4 md:grid-cols-2 xl:grid-cols-3">
|
|
@foreach($groupResults as $group)
|
|
<a href="{{ $group['urls']['public'] ?? $group['profile_url'] ?? '/groups' }}" class="rounded-[24px] border border-white/10 bg-black/20 p-4 transition hover:-translate-y-0.5 hover:border-white/20">
|
|
<div class="flex items-start gap-4">
|
|
<div class="flex h-14 w-14 items-center justify-center overflow-hidden rounded-2xl border border-white/10 bg-white/[0.04] text-slate-300">
|
|
@if(!empty($group['avatar_url']))
|
|
<img src="{{ $group['avatar_url'] }}" alt="{{ $group['name'] ?? 'Group' }}" class="h-full w-full object-cover" loading="lazy">
|
|
@else
|
|
<i class="fa-solid fa-people-group"></i>
|
|
@endif
|
|
</div>
|
|
<div class="min-w-0 flex-1">
|
|
<div class="truncate text-lg font-semibold text-white">{{ $group['name'] ?? 'Group' }}</div>
|
|
@if(!empty($group['headline']))
|
|
<div class="mt-1 text-sm text-slate-400">{{ $group['headline'] }}</div>
|
|
@elseif(!empty($group['bio_excerpt']))
|
|
<div class="mt-1 text-sm text-slate-400">{{ $group['bio_excerpt'] }}</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-4 flex flex-wrap gap-2">
|
|
@foreach(collect($group['trust_signals'] ?? [])->take(2) as $signal)
|
|
<span class="rounded-full border border-white/10 bg-white/[0.04] px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.16em] text-slate-200">{{ $signal['label'] ?? 'Signal' }}</span>
|
|
@endforeach
|
|
@if(!empty($group['is_recruiting']))
|
|
<span class="rounded-full border border-emerald-300/20 bg-emerald-400/10 px-3 py-1 text-[11px] font-semibold uppercase tracking-[0.16em] text-emerald-100">Recruiting</span>
|
|
@endif
|
|
</div>
|
|
|
|
<div class="mt-4 flex flex-wrap gap-4 text-xs text-slate-400">
|
|
<span>{{ number_format((int) ($group['counts']['artworks'] ?? $group['artworks_count'] ?? 0)) }} artworks</span>
|
|
<span>{{ number_format((int) ($group['counts']['members'] ?? $group['members_count'] ?? 0)) }} members</span>
|
|
<span>{{ number_format((int) ($group['counts']['followers'] ?? $group['followers_count'] ?? 0)) }} followers</span>
|
|
</div>
|
|
</a>
|
|
@endforeach
|
|
</div>
|
|
</section>
|
|
@endif
|
|
|
|
@if($newsResultCount > 0)
|
|
<section class="mb-8 rounded-[28px] border border-white/10 bg-white/[0.03] p-5 shadow-[0_18px_50px_rgba(2,6,23,0.2)]">
|
|
<div class="mb-4 flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between">
|
|
<div>
|
|
<p class="text-[11px] font-semibold uppercase tracking-[0.2em] text-sky-200/80">News</p>
|
|
<h2 class="mt-1 text-xl font-semibold text-white">Editorial stories and platform updates matching your search</h2>
|
|
<p class="mt-1 text-sm text-slate-400">Find tutorials, release notes, community spotlights, and announcements connected to this topic.</p>
|
|
</div>
|
|
<a href="/news" class="text-sm font-semibold text-sky-300 transition hover:text-white">Browse all News</a>
|
|
</div>
|
|
|
|
<div class="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
|
|
@foreach($newsResults as $item)
|
|
<a href="{{ route('news.show', $item->slug) }}" class="rounded-[24px] border border-white/10 bg-black/20 p-4 transition hover:-translate-y-0.5 hover:border-white/20">
|
|
<div class="flex flex-wrap items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.16em] text-white/35">
|
|
<span class="rounded-full border border-white/10 bg-white/[0.04] px-2 py-0.5 text-white/60">{{ $item->type_label }}</span>
|
|
@if($item->category)
|
|
<span class="rounded-full border border-sky-400/20 bg-sky-500/10 px-2 py-0.5 text-sky-200">{{ $item->category->name }}</span>
|
|
@endif
|
|
</div>
|
|
<h3 class="mt-3 text-lg font-semibold leading-7 text-white">{{ $item->title }}</h3>
|
|
<p class="mt-2 text-sm leading-6 text-slate-400">{{ Str::limit(strip_tags((string) ($item->excerpt ?: $item->rendered_content)), 120) }}</p>
|
|
<div class="mt-4 flex items-center justify-between gap-3 text-xs text-slate-500">
|
|
<span>{{ $item->author?->name ?? 'Skinbase' }}</span>
|
|
<span>{{ $item->published_at?->format('d M Y') }}</span>
|
|
</div>
|
|
</a>
|
|
@endforeach
|
|
</div>
|
|
</section>
|
|
@endif
|
|
|
|
@if($hasQuery && !$hasAnyResults)
|
|
<div class="rounded-xl border border-white/[0.06] bg-white/[0.03] p-14 text-center">
|
|
<p class="mb-2 text-lg text-neutral-400">No results for <span class="text-white">"{{ $q }}"</span></p>
|
|
<p class="text-sm text-neutral-500">Try a different keyword or browse <a href="/groups" class="text-sky-400 hover:underline">public groups</a>, <a href="/news" class="text-sky-400 hover:underline">News</a>, and <a href="/discover/trending" class="text-sky-400 hover:underline">trending artworks</a>.</p>
|
|
</div>
|
|
@else
|
|
<div
|
|
data-react-masonry-gallery
|
|
data-artworks="{{ json_encode($galleryArtworks) }}"
|
|
data-gallery-type="search"
|
|
@if($galleryNextPageUrl) data-next-page-url="{{ $galleryNextPageUrl }}" @endif
|
|
data-limit="24"
|
|
class="min-h-32"
|
|
></div>
|
|
@endif
|
|
</div>
|
|
@endsection
|
|
|
|
@push('scripts')
|
|
@vite('resources/js/entry-masonry-gallery.jsx')
|
|
@endpush
|