194 lines
13 KiB
PHP
194 lines
13 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', '3D Print Catalogus 🎁 | Jouwdriedee.nl')
|
|
|
|
@section('content')
|
|
<!-- Page Header -->
|
|
<div class="bg-gradient-to-b from-amber-50 to-[#FFFDF9] border-b border-slate-200/80 py-6 sm:py-8">
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 flex flex-col sm:flex-row sm:items-center justify-between gap-3">
|
|
<div>
|
|
<div class="inline-flex items-center space-x-1.5 px-3 py-1 rounded-full bg-white border border-slate-200 text-[10px] sm:text-xs font-black text-rose-500 shadow-2xs mb-2">
|
|
<span>🧸</span>
|
|
<span>Onze Collectie 3D Prints</span>
|
|
</div>
|
|
<h1 class="font-heading text-2xl sm:text-4xl font-black text-slate-900 tracking-tight">Kies Jouw Favoriete Print! 🎁</h1>
|
|
<p class="text-xs text-slate-500 mt-1">Fidget toys, Pokémon figuren en popculture collectibles vers uit de 3D printer.</p>
|
|
</div>
|
|
@if(request()->hasAny(['category', 'material', 'q', 'sort']))
|
|
<a href="{{ route('catalog') }}" class="playful-btn px-3 py-1.5 rounded-xl bg-white border border-slate-200 text-xs font-bold text-rose-600 hover:bg-rose-50 flex items-center space-x-1 self-start shadow-2xs">
|
|
<span>✕ Filters Wissen</span>
|
|
</a>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6 sm:py-10" x-data="{ mobileFiltersOpen: false }">
|
|
|
|
<!-- Mobile Filter Toggle Bar (Zodat mobiele gebruikers niet 600px omlaag hoeven te scrollen!) -->
|
|
<div class="lg:hidden mb-4 flex items-center justify-between gap-2">
|
|
<button
|
|
type="button"
|
|
@click="mobileFiltersOpen = !mobileFiltersOpen"
|
|
class="flex-1 py-2.5 px-4 rounded-xl bg-white border border-slate-200 text-slate-800 text-xs font-bold flex items-center justify-center space-x-2 shadow-2xs"
|
|
>
|
|
<i data-lucide="sliders-horizontal" class="w-4 h-4 text-rose-500"></i>
|
|
<span x-text="mobileFiltersOpen ? 'Verberg Filters' : 'Filters & Categorieën'"></span>
|
|
@if(request()->hasAny(['category', 'material', 'q']))
|
|
<span class="w-2 h-2 rounded-full bg-rose-500"></span>
|
|
@endif
|
|
</button>
|
|
|
|
<!-- Snelle Sortering op Mobiel -->
|
|
<form action="{{ route('catalog') }}" method="GET" class="w-40">
|
|
@if(request('category')) <input type="hidden" name="category" value="{{ request('category') }}"> @endif
|
|
@if(request('material')) <input type="hidden" name="material" value="{{ request('material') }}"> @endif
|
|
@if(request('q')) <input type="hidden" name="q" value="{{ request('q') }}"> @endif
|
|
<select name="sort" onchange="this.form.submit()" class="w-full bg-white border border-slate-200 rounded-xl px-2.5 py-2.5 text-xs font-bold text-slate-700 shadow-2xs">
|
|
<option value="newest" {{ request('sort') === 'newest' ? 'selected' : '' }}>Nieuwste</option>
|
|
<option value="price_asc" {{ request('sort') === 'price_asc' ? 'selected' : '' }}>Prijs ↑</option>
|
|
<option value="price_desc" {{ request('sort') === 'price_desc' ? 'selected' : '' }}>Prijs ↓</option>
|
|
</select>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 lg:grid-cols-4 gap-6 lg:gap-8">
|
|
|
|
<!-- Filters Sidebar (Op mobiel inklapbaar via Alpine.js) -->
|
|
<aside :class="mobileFiltersOpen ? 'block' : 'hidden lg:block'" class="space-y-4">
|
|
<div class="p-5 sm:p-6 rounded-3xl bg-white border border-slate-100 shadow-sm space-y-5">
|
|
<div class="flex items-center justify-between pb-3 border-b border-slate-100">
|
|
<span class="font-heading text-xs font-black text-slate-900 uppercase tracking-wider flex items-center space-x-1.5">
|
|
<i data-lucide="filter" class="w-3.5 h-3.5 text-rose-500"></i>
|
|
<span>Filters & Zoeken</span>
|
|
</span>
|
|
@if(request()->hasAny(['category', 'material', 'q', 'sort']))
|
|
<a href="{{ route('catalog') }}" class="text-[11px] font-bold text-rose-500 hover:underline">Wissen</a>
|
|
@endif
|
|
</div>
|
|
|
|
<!-- Zoekveld -->
|
|
<form action="{{ route('catalog') }}" method="GET" class="space-y-4">
|
|
@if(request('category')) <input type="hidden" name="category" value="{{ request('category') }}"> @endif
|
|
@if(request('material')) <input type="hidden" name="material" value="{{ request('material') }}"> @endif
|
|
|
|
<div>
|
|
<label class="block text-xs font-bold text-slate-700 mb-1.5">Zoeken</label>
|
|
<div class="relative">
|
|
<input
|
|
type="text"
|
|
name="q"
|
|
value="{{ request('q') }}"
|
|
placeholder="Draak, Pikachu, Grogu..."
|
|
class="w-full bg-slate-50 border border-slate-200 rounded-xl pl-8 pr-3 py-2 text-xs font-bold text-slate-900 placeholder-slate-400 focus:bg-white focus:outline-none focus:ring-1 focus:ring-rose-400"
|
|
>
|
|
<i data-lucide="search" class="w-3.5 h-3.5 text-slate-400 absolute left-2.5 top-1/2 -translate-y-1/2"></i>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Categorie filter -->
|
|
<div>
|
|
<label class="block text-xs font-bold text-slate-700 mb-2">Categorieën 🧸</label>
|
|
<div class="space-y-1">
|
|
<a href="{{ route('catalog', array_merge(request()->except('category', 'page'), [])) }}" class="flex items-center justify-between px-3 py-2 rounded-xl text-xs font-bold transition {{ !request('category') ? 'bg-amber-100 text-amber-950 font-black' : 'text-slate-600 hover:bg-slate-50' }}">
|
|
<span>Alle categorieën</span>
|
|
</a>
|
|
@foreach($categories as $cat)
|
|
<a href="{{ route('catalog', array_merge(request()->except('category', 'page'), ['category' => $cat->slug])) }}" class="flex items-center justify-between px-3 py-2 rounded-xl text-xs font-bold transition {{ request('category') === $cat->slug ? 'bg-amber-100 text-amber-950 font-black' : 'text-slate-600 hover:bg-slate-50' }}">
|
|
<span>{{ $cat->name }}</span>
|
|
</a>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Materiaal filter -->
|
|
<div>
|
|
<label class="block text-xs font-bold text-slate-700 mb-2">Materiaal 🌈</label>
|
|
<div class="space-y-1">
|
|
<a href="{{ route('catalog', array_merge(request()->except('material', 'page'), [])) }}" class="flex items-center justify-between px-3 py-1.5 rounded-xl text-xs font-bold transition {{ !request('material') ? 'bg-sky-100 text-sky-950 font-black' : 'text-slate-600 hover:bg-slate-50' }}">
|
|
<span>Alle materialen</span>
|
|
</a>
|
|
@foreach($materials as $mat)
|
|
<a href="{{ route('catalog', array_merge(request()->except('material', 'page'), ['material' => $mat->code])) }}" class="flex items-center justify-between px-3 py-1.5 rounded-xl text-xs font-bold transition {{ request('material') === $mat->code ? 'bg-sky-100 text-sky-950 font-black' : 'text-slate-600 hover:bg-slate-50' }}">
|
|
<span>{{ $mat->name }}</span>
|
|
</a>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Sortering Desktop -->
|
|
<div class="hidden lg:block">
|
|
<label class="block text-xs font-bold text-slate-700 mb-1.5">Sorteren</label>
|
|
<select name="sort" onchange="this.form.submit()" class="w-full bg-slate-50 border border-slate-200 rounded-xl px-3 py-2 text-xs font-bold text-slate-700 focus:bg-white focus:outline-none">
|
|
<option value="newest" {{ request('sort') === 'newest' ? 'selected' : '' }}>Nieuwste eerst ✨</option>
|
|
<option value="price_asc" {{ request('sort') === 'price_asc' ? 'selected' : '' }}>Prijs: Laag naar hoog</option>
|
|
<option value="price_desc" {{ request('sort') === 'price_desc' ? 'selected' : '' }}>Prijs: Hoog naar laag</option>
|
|
</select>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</aside>
|
|
|
|
<!-- Producten Overzicht (2 kolommen op mobiel, 3 op desktop) -->
|
|
<div class="lg:col-span-3 space-y-6">
|
|
@if($products->isEmpty())
|
|
<div class="p-10 text-center rounded-3xl bg-white border border-slate-100 shadow-sm space-y-3">
|
|
<div class="w-14 h-14 rounded-2xl bg-amber-50 text-slate-800 flex items-center justify-center mx-auto text-3xl">
|
|
🙈
|
|
</div>
|
|
<h3 class="font-heading text-lg font-black text-slate-900">Geen artikelen gevonden</h3>
|
|
<p class="text-xs text-slate-500 max-w-sm mx-auto">Er zijn geen prints gevonden die voldoen aan je huidige filters. Wis je filters of bekijk alle categorieën!</p>
|
|
<a href="{{ route('catalog') }}" class="playful-btn inline-flex px-5 py-2.5 rounded-xl bg-amber-400 text-slate-950 text-xs font-black shadow-xs">Alle prints bekijken 🎁</a>
|
|
</div>
|
|
@else
|
|
<div class="grid grid-cols-2 md:grid-cols-3 gap-3 sm:gap-6">
|
|
@foreach($products as $product)
|
|
<div class="playful-card rounded-2xl sm:rounded-3xl bg-white border border-slate-100 shadow-xs hover:shadow-lg overflow-hidden flex flex-col justify-between group">
|
|
<div>
|
|
<div class="relative h-40 sm:h-56 bg-slate-100 overflow-hidden">
|
|
<img
|
|
src="{{ $product->image_url }}"
|
|
alt="{{ $product->name }}"
|
|
class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"
|
|
loading="lazy"
|
|
>
|
|
@if($product->category)
|
|
<span class="absolute top-2 left-2 sm:top-3 sm:left-3 px-2 py-0.5 rounded-md bg-white/90 backdrop-blur-xs text-[9px] sm:text-[10px] font-black text-slate-800 shadow-2xs">
|
|
{{ $product->category->name }}
|
|
</span>
|
|
@endif
|
|
</div>
|
|
<div class="p-3 sm:p-4">
|
|
<h3 class="font-heading text-xs sm:text-sm font-black text-slate-900 group-hover:text-rose-600 transition line-clamp-2">
|
|
<a href="{{ route('product.show', $product->slug) }}">
|
|
{{ $product->name }}
|
|
</a>
|
|
</h3>
|
|
<p class="hidden sm:block text-xs text-slate-500 mt-1 line-clamp-2 leading-relaxed">
|
|
{{ $product->short_description }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="p-3 sm:p-4 pt-0 border-t border-slate-100/80 mt-1 flex items-center justify-between">
|
|
<div>
|
|
<span class="text-[9px] sm:text-[10px] text-slate-400 block font-bold uppercase">Vanaf</span>
|
|
<span class="font-heading text-sm sm:text-base font-black text-slate-900">{{ $product->formatted_price }}</span>
|
|
</div>
|
|
<a href="{{ route('product.show', $product->slug) }}" class="playful-btn px-2.5 sm:px-3 py-1 sm:py-1.5 rounded-xl bg-amber-400 hover:bg-amber-300 text-slate-950 text-[10px] sm:text-xs font-black transition flex items-center space-x-1 shadow-2xs">
|
|
<span>Kleur 🎨</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
|
|
<div class="pt-4">
|
|
{{ $products->links() }}
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
@endsection
|