Redesign logo & storefront, light subtle admin theme, and 3D print cost calculator
This commit is contained in:
@@ -3,22 +3,94 @@
|
||||
@section('title', 'Product Bewerken: ' . $product->name . ' | Jouwdriedee Beheer')
|
||||
|
||||
@section('content')
|
||||
<div class="space-y-6 max-w-4xl mx-auto">
|
||||
<div class="space-y-6 max-w-5xl mx-auto"
|
||||
x-data="{
|
||||
basePrice: '{{ old('base_price', $product->base_price) }}',
|
||||
weightGrams: {{ old('weight_grams', $product->weight_grams ?: 85) }},
|
||||
printTimeHours: {{ old('print_time_hours', $product->print_time_hours ?: 4.0) }},
|
||||
colorCount: 1,
|
||||
material: 'pla',
|
||||
markupPercent: {{ setting('calc_default_markup', 65.0) }},
|
||||
showCalculator: true,
|
||||
|
||||
rates: {
|
||||
filamentPriceKg: {{ setting('calc_filament_price_kg', 20.00) }},
|
||||
electricityKwh: {{ setting('calc_electricity_kwh', 0.35) }},
|
||||
machineHourly: {{ setting('calc_machine_hourly_rate', 0.50) }},
|
||||
handlingFlat: {{ setting('calc_handling_flat', 1.50) }},
|
||||
failureRate: {{ setting('calc_failure_rate', 5.0) }}
|
||||
},
|
||||
|
||||
colorWasteMults: { 1: 1.0, 2: 1.15, 3: 1.25, 4: 1.35 },
|
||||
materialMults: { 'pla': 1.0, 'petg': 1.20, 'silk': 1.30, 'tpu': 1.40 },
|
||||
|
||||
get effectiveWeight() {
|
||||
let mult = this.colorWasteMults[this.colorCount] || 1.0;
|
||||
return (this.weightGrams * mult).toFixed(1);
|
||||
},
|
||||
get purgeWasteGrams() {
|
||||
return Math.max(0, this.effectiveWeight - this.weightGrams).toFixed(1);
|
||||
},
|
||||
get materialCost() {
|
||||
let matMult = this.materialMults[this.material] || 1.0;
|
||||
return ((this.effectiveWeight / 1000) * (this.rates.filamentPriceKg * matMult)).toFixed(2);
|
||||
},
|
||||
get electricityCost() {
|
||||
return (this.printTimeHours * 0.15 * this.rates.electricityKwh).toFixed(2);
|
||||
},
|
||||
get machineCost() {
|
||||
return (this.printTimeHours * this.rates.machineHourly).toFixed(2);
|
||||
},
|
||||
get handlingCost() {
|
||||
let extraColorFee = Math.max(0, this.colorCount - 1) * 0.50;
|
||||
return (this.rates.handlingFlat + extraColorFee).toFixed(2);
|
||||
},
|
||||
get subtotalCost() {
|
||||
return (parseFloat(this.materialCost) + parseFloat(this.electricityCost) + parseFloat(this.machineCost) + parseFloat(this.handlingCost)).toFixed(2);
|
||||
},
|
||||
get failureCost() {
|
||||
return (parseFloat(this.subtotalCost) * (this.rates.failureRate / 100)).toFixed(2);
|
||||
},
|
||||
get totalProductionCost() {
|
||||
return (parseFloat(this.subtotalCost) + parseFloat(this.failureCost)).toFixed(2);
|
||||
},
|
||||
get priceExclVat() {
|
||||
return (parseFloat(this.totalProductionCost) * (1 + this.markupPercent / 100)).toFixed(2);
|
||||
},
|
||||
get suggestedPrice() {
|
||||
let rawWithVat = parseFloat(this.priceExclVat) * 1.21;
|
||||
if (rawWithVat <= 7.0) return '6.95';
|
||||
let floor = Math.floor(rawWithVat);
|
||||
let fraction = rawWithVat - floor;
|
||||
if (fraction <= 0.25) {
|
||||
return (floor < rawWithVat ? floor + 0.50 : floor - 0.05).toFixed(2);
|
||||
} else if (fraction <= 0.70) {
|
||||
return (floor + 0.50).toFixed(2);
|
||||
} else {
|
||||
return (floor + 0.95).toFixed(2);
|
||||
}
|
||||
},
|
||||
applySuggestedPrice() {
|
||||
this.basePrice = this.suggestedPrice;
|
||||
}
|
||||
}">
|
||||
|
||||
<!-- Header -->
|
||||
<div class="flex items-center justify-between pb-6 border-b border-slate-800">
|
||||
<div class="flex items-center justify-between pb-5 border-b border-slate-200/80">
|
||||
<div>
|
||||
<a href="{{ route('admin.products.index') }}" class="text-xs text-amber-400 font-bold hover:underline inline-flex items-center space-x-1 mb-1">
|
||||
<a href="{{ route('admin.products.index') }}" class="text-xs text-amber-600 font-bold hover:underline inline-flex items-center space-x-1 mb-1">
|
||||
<i data-lucide="arrow-left" class="w-3.5 h-3.5"></i>
|
||||
<span>Terug naar Producten</span>
|
||||
</a>
|
||||
<h1 class="font-heading text-2xl font-black text-white">Product Bewerken: {{ $product->name }}</h1>
|
||||
<h1 class="font-heading text-2xl font-black text-slate-900">Product Bewerken: {{ $product->name }}</h1>
|
||||
</div>
|
||||
|
||||
<a href="{{ route('product.show', $product->slug) }}" target="_blank" class="px-3.5 py-2 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-300 hover:text-white text-xs font-bold transition flex items-center space-x-1.5 border border-slate-700">
|
||||
<span>Bekijk Live</span>
|
||||
<i data-lucide="external-link" class="w-3.5 h-3.5"></i>
|
||||
</a>
|
||||
<div class="flex items-center space-x-2">
|
||||
<a href="{{ route('product.show', $product->slug) }}" target="_blank" class="px-3.5 py-2 rounded-xl bg-white hover:bg-slate-50 text-slate-700 text-xs font-bold transition flex items-center space-x-1.5 border border-slate-200 shadow-2xs">
|
||||
<span>Bekijk Live</span>
|
||||
<i data-lucide="external-link" class="w-3.5 h-3.5 text-slate-400"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Edit Form -->
|
||||
@@ -26,17 +98,18 @@
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="p-6 rounded-3xl bg-slate-900 border border-slate-800 space-y-5">
|
||||
<div class="p-6 sm:p-8 rounded-3xl bg-white border border-slate-200/80 shadow-2xs space-y-6">
|
||||
|
||||
<!-- Basis Informatie -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div class="md:col-span-2 space-y-1.5">
|
||||
<label class="block text-xs font-bold text-slate-300">Productnaam *</label>
|
||||
<input type="text" name="name" value="{{ old('name', $product->name) }}" required class="w-full bg-slate-950 border border-slate-700 rounded-xl px-3.5 py-2.5 text-xs text-white font-bold focus:outline-none focus:ring-2 focus:ring-amber-400">
|
||||
<label class="block text-xs font-bold text-slate-700">Productnaam *</label>
|
||||
<input type="text" name="name" value="{{ old('name', $product->name) }}" required class="w-full bg-slate-50/60 focus:bg-white border border-slate-200 rounded-xl px-3.5 py-2.5 text-xs text-slate-900 font-bold focus:outline-none focus:ring-2 focus:ring-amber-400/20 focus:border-amber-400 transition">
|
||||
</div>
|
||||
|
||||
<div class="space-y-1.5">
|
||||
<label class="block text-xs font-bold text-slate-300">Categorie *</label>
|
||||
<select name="category_id" required class="w-full bg-slate-950 border border-slate-700 rounded-xl px-3 py-2.5 text-xs text-white font-bold">
|
||||
<label class="block text-xs font-bold text-slate-700">Categorie *</label>
|
||||
<select name="category_id" required class="w-full bg-slate-50/60 focus:bg-white border border-slate-200 rounded-xl px-3 py-2.5 text-xs text-slate-900 font-bold">
|
||||
@foreach($categories as $cat)
|
||||
<option value="{{ $cat->id }}" {{ old('category_id', $product->category_id) == $cat->id ? 'selected' : '' }}>
|
||||
{{ $cat->name }}
|
||||
@@ -46,20 +119,144 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ==================================================== -->
|
||||
<!-- 3D PRINT KOSTPRIJSCALCULATOR WIDGET (3dprintingcostcalculator) -->
|
||||
<!-- ==================================================== -->
|
||||
<div class="p-5 rounded-2xl bg-amber-50/40 border border-amber-200/70 space-y-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center space-x-2">
|
||||
<span class="w-6 h-6 rounded-lg bg-amber-400 text-slate-950 flex items-center justify-center text-xs">🖨️</span>
|
||||
<h3 class="font-heading text-xs font-black text-slate-900 uppercase tracking-wider">3D Print Kostprijscalculator</h3>
|
||||
<span class="px-2 py-0.5 rounded-full bg-amber-100 text-amber-900 font-mono text-[10px] font-bold">Live Calculator</span>
|
||||
</div>
|
||||
|
||||
<button type="button" @click="showCalculator = !showCalculator" class="text-xs text-slate-500 hover:text-slate-800 font-semibold flex items-center space-x-1">
|
||||
<span x-text="showCalculator ? 'Inklappen' : 'Calculator Openen'"></span>
|
||||
<i data-lucide="chevron-down" class="w-3.5 h-3.5 transition-transform" :class="showCalculator ? 'rotate-180' : ''"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div x-show="showCalculator" x-transition class="space-y-4 pt-2">
|
||||
<div class="grid grid-cols-2 sm:grid-cols-4 gap-3 text-xs">
|
||||
<!-- Gewicht -->
|
||||
<div class="space-y-1">
|
||||
<label class="block text-[11px] font-bold text-slate-600">Gewicht (gram)</label>
|
||||
<div class="relative">
|
||||
<input type="number" x-model.number="weightGrams" min="1" max="5000" class="w-full bg-white border border-slate-200 rounded-xl px-3 py-1.5 text-xs font-black text-slate-900">
|
||||
<span class="absolute right-2.5 top-1/2 -translate-y-1/2 text-[10px] text-slate-400 font-bold">gram</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Printtijd -->
|
||||
<div class="space-y-1">
|
||||
<label class="block text-[11px] font-bold text-slate-600">Printtijd (uren)</label>
|
||||
<div class="relative">
|
||||
<input type="number" step="0.1" x-model.number="printTimeHours" min="0.1" max="100" class="w-full bg-white border border-slate-200 rounded-xl px-3 py-1.5 text-xs font-black text-slate-900">
|
||||
<span class="absolute right-2.5 top-1/2 -translate-y-1/2 text-[10px] text-slate-400 font-bold">uur</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Aantal Kleuren (AMS Purge) -->
|
||||
<div class="space-y-1">
|
||||
<label class="block text-[11px] font-bold text-slate-600">Aantal Kleuren</label>
|
||||
<div class="grid grid-cols-4 gap-1">
|
||||
<template x-for="c in [1, 2, 3, 4]" :key="c">
|
||||
<button
|
||||
type="button"
|
||||
@click="colorCount = c"
|
||||
class="py-1.5 rounded-lg text-center font-bold text-xs transition border"
|
||||
:class="colorCount === c ? 'bg-amber-400 border-amber-500 text-slate-950 font-black shadow-2xs' : 'bg-white border-slate-200 text-slate-600 hover:bg-slate-50'"
|
||||
x-text="c"
|
||||
></button>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Materiaalsoort -->
|
||||
<div class="space-y-1">
|
||||
<label class="block text-[11px] font-bold text-slate-600">Materiaalsoort</label>
|
||||
<select x-model="material" class="w-full bg-white border border-slate-200 rounded-xl px-2.5 py-1.5 text-xs font-bold text-slate-900">
|
||||
<option value="pla">Bio-PLA (1.0x)</option>
|
||||
<option value="petg">PETG Tough (1.2x)</option>
|
||||
<option value="silk">Silk Zijdeglans (1.3x)</option>
|
||||
<option value="tpu">TPU Flexibel (1.4x)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Winstmarge selectie -->
|
||||
<div class="flex flex-wrap items-center justify-between gap-2 pt-2 border-t border-amber-200/50 text-xs">
|
||||
<div class="flex items-center space-x-1.5">
|
||||
<span class="text-slate-600 font-bold text-[11px]">Winstmarge:</span>
|
||||
<div class="inline-flex rounded-lg border border-slate-200 bg-white p-0.5 text-[11px] font-bold">
|
||||
<button type="button" @click="markupPercent = 35" :class="markupPercent === 35 ? 'bg-amber-400 text-slate-950 font-black' : 'text-slate-600 hover:text-slate-900'" class="px-2 py-0.5 rounded-md transition">35%</button>
|
||||
<button type="button" @click="markupPercent = 50" :class="markupPercent === 50 ? 'bg-amber-400 text-slate-950 font-black' : 'text-slate-600 hover:text-slate-900'" class="px-2 py-0.5 rounded-md transition">50%</button>
|
||||
<button type="button" @click="markupPercent = 65" :class="markupPercent === 65 ? 'bg-amber-400 text-slate-950 font-black' : 'text-slate-600 hover:text-slate-900'" class="px-2 py-0.5 rounded-md transition">65%</button>
|
||||
<button type="button" @click="markupPercent = 100" :class="markupPercent === 100 ? 'bg-amber-400 text-slate-950 font-black' : 'text-slate-600 hover:text-slate-900'" class="px-2 py-0.5 rounded-md transition">100%</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Live Cost Breakdown Strip -->
|
||||
<div class="flex items-center space-x-3 text-[11px] text-slate-500 font-semibold">
|
||||
<span>🧵 Materiaal: €<span x-text="materialCost"></span></span>
|
||||
<span>⚡ Stroom: €<span x-text="electricityCost"></span></span>
|
||||
<span>⚙️ Slijtage: €<span x-text="machineCost"></span></span>
|
||||
<span class="font-bold text-slate-700">Kostprijs: €<span x-text="totalProductionCost"></span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Result Banner met 1-klik overneem knop -->
|
||||
<div class="p-3.5 rounded-xl bg-white border border-amber-300 shadow-2xs flex flex-col sm:flex-row sm:items-center justify-between gap-3">
|
||||
<div class="flex items-center space-x-3">
|
||||
<div class="w-10 h-10 rounded-xl bg-amber-100 text-amber-900 flex items-center justify-center font-heading font-black text-sm">
|
||||
€
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-[10px] text-slate-400 block font-bold uppercase tracking-wider">Berekend Prijsvoorstel (incl. 21% btw)</span>
|
||||
<div class="flex items-baseline space-x-1.5">
|
||||
<span class="font-heading text-xl font-black text-slate-900">€ <span x-text="suggestedPrice"></span></span>
|
||||
<span class="text-[11px] text-slate-500">op basis van <span x-text="weightGrams"></span>g • <span x-text="printTimeHours"></span>u • <span x-text="colorCount"></span> kleur(en)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
@click="applySuggestedPrice"
|
||||
class="px-4 py-2 bg-gradient-to-r from-amber-400 to-rose-400 hover:from-amber-300 hover:to-rose-300 text-slate-950 font-black text-xs rounded-xl shadow-xs transition flex items-center justify-center space-x-1.5 cursor-pointer"
|
||||
>
|
||||
<i data-lucide="check" class="w-4 h-4"></i>
|
||||
<span>Neem Adviesprijs Over (€ <span x-text="suggestedPrice"></span>)</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Prijs & Korte Omschrijving -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<div class="space-y-1.5">
|
||||
<label class="block text-xs font-bold text-slate-300">Basisprijs (€) *</label>
|
||||
<input type="number" step="0.01" name="base_price" value="{{ old('base_price', $product->base_price) }}" required class="w-full bg-slate-950 border border-slate-700 rounded-xl px-3.5 py-2.5 text-xs text-white font-bold">
|
||||
<label class="block text-xs font-bold text-slate-700">Basisprijs (€) *</label>
|
||||
<div class="relative">
|
||||
<span class="absolute left-3.5 top-1/2 -translate-y-1/2 font-bold text-slate-400 text-xs">€</span>
|
||||
<input
|
||||
type="number"
|
||||
step="0.01"
|
||||
name="base_price"
|
||||
x-model="basePrice"
|
||||
required
|
||||
class="w-full bg-slate-50/60 focus:bg-white border border-slate-200 rounded-xl pl-7 pr-3.5 py-2.5 text-xs text-slate-900 font-bold focus:outline-none focus:ring-2 focus:ring-amber-400/20 focus:border-amber-400"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="md:col-span-2 space-y-1.5">
|
||||
<label class="block text-xs font-bold text-slate-300">Korte Omschrijving (voor catalogus cards)</label>
|
||||
<input type="text" name="short_description" value="{{ old('short_description', $product->short_description) }}" placeholder="Korte samenvatting in 1 zin..." class="w-full bg-slate-950 border border-slate-700 rounded-xl px-3.5 py-2.5 text-xs text-white">
|
||||
<label class="block text-xs font-bold text-slate-700">Korte Omschrijving (voor catalogus cards)</label>
|
||||
<input type="text" name="short_description" value="{{ old('short_description', $product->short_description) }}" placeholder="Korte samenvatting in 1 zin..." class="w-full bg-slate-50/60 focus:bg-white border border-slate-200 rounded-xl px-3.5 py-2.5 text-xs text-slate-900">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Visueel Afbeeldingen & Fotogalerij Beheer -->
|
||||
<div class="pt-5 border-t border-slate-800 space-y-4"
|
||||
<div class="pt-5 border-t border-slate-200/80 space-y-4"
|
||||
x-data="{
|
||||
imageUrl: '{{ old('image_url', $product->image_url ?? '') }}',
|
||||
galleryImages: {{ json_encode(old('gallery_images', $product->gallery_images ?? []), JSON_UNESCAPED_SLASHES) }},
|
||||
@@ -145,7 +342,7 @@
|
||||
}
|
||||
}">
|
||||
|
||||
<!-- Verborgen form fields die verstuurd worden naar de server -->
|
||||
<!-- Verborgen form fields -->
|
||||
<input type="hidden" name="image_url" :value="imageUrl">
|
||||
<template x-for="(img, idx) in galleryImages" :key="idx">
|
||||
<input type="hidden" name="gallery_images[]" :value="img">
|
||||
@@ -154,64 +351,64 @@
|
||||
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-2">
|
||||
<div>
|
||||
<div class="flex items-center space-x-2">
|
||||
<i data-lucide="image" class="w-4 h-4 text-amber-400"></i>
|
||||
<h3 class="font-heading text-sm font-black text-white uppercase tracking-wider">Productafbeeldingen & Fotogalerij</h3>
|
||||
<span class="px-2 py-0.5 rounded-full bg-slate-800 text-amber-400 font-mono text-[11px] font-bold" x-text="(imageUrl ? 1 : 0) + galleryImages.length + ' foto(\'s)'"></span>
|
||||
<i data-lucide="image" class="w-4 h-4 text-amber-500"></i>
|
||||
<h3 class="font-heading text-sm font-black text-slate-900 uppercase tracking-wider">Productafbeeldingen & Fotogalerij</h3>
|
||||
<span class="px-2 py-0.5 rounded-full bg-slate-100 text-slate-700 font-mono text-[11px] font-bold" x-text="(imageUrl ? 1 : 0) + galleryImages.length + ' foto(\'s)'"></span>
|
||||
</div>
|
||||
<p class="text-xs text-slate-400 mt-0.5">
|
||||
<p class="text-xs text-slate-500 mt-0.5">
|
||||
Alle foto's die vanuit MakerWorld zijn binnengehaald worden hier visueel getoond. Je kunt foto's toevoegen, wisselen van hoofdfoto of verwijderen.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center space-x-2">
|
||||
<!-- Bestand uploaden button -->
|
||||
<label class="px-3 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 text-xs font-bold transition flex items-center space-x-1.5 border border-slate-700 cursor-pointer">
|
||||
<i data-lucide="upload" class="w-3.5 h-3.5 text-amber-400"></i>
|
||||
<label class="px-3 py-1.5 rounded-xl bg-white hover:bg-slate-50 text-slate-700 text-xs font-bold transition flex items-center space-x-1.5 border border-slate-200 shadow-2xs cursor-pointer">
|
||||
<i data-lucide="upload" class="w-3.5 h-3.5 text-amber-500"></i>
|
||||
<span x-text="isUploading ? 'Uploaden...' : 'Foto Uploaden'"></span>
|
||||
<input type="file" accept="image/*" class="hidden" @change="uploadFile" :disabled="isUploading">
|
||||
</label>
|
||||
|
||||
<!-- URL toevoegen toggle -->
|
||||
<button type="button" @click="showUrlInput = !showUrlInput" class="px-3 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 text-xs font-bold transition flex items-center space-x-1.5 border border-slate-700">
|
||||
<i data-lucide="link" class="w-3.5 h-3.5 text-amber-400"></i>
|
||||
<button type="button" @click="showUrlInput = !showUrlInput" class="px-3 py-1.5 rounded-xl bg-white hover:bg-slate-50 text-slate-700 text-xs font-bold transition flex items-center space-x-1.5 border border-slate-200 shadow-2xs">
|
||||
<i data-lucide="link" class="w-3.5 h-3.5 text-amber-500"></i>
|
||||
<span>URL Plakken</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- URL Toevoegen Bar (uitklapbaar) -->
|
||||
<div x-show="showUrlInput" x-transition class="p-3 bg-slate-950 rounded-2xl border border-slate-800 space-y-2">
|
||||
<!-- URL Toevoegen Bar -->
|
||||
<div x-show="showUrlInput" x-transition class="p-3 bg-slate-50 rounded-2xl border border-slate-200 space-y-2">
|
||||
<div class="flex items-center space-x-2">
|
||||
<input
|
||||
type="text"
|
||||
x-model="newImageUrl"
|
||||
@keydown.enter.prevent="addImageUrl"
|
||||
placeholder="Plak hier een foto-URL (bijv. https://makerworld... of /images/products/...)"
|
||||
class="flex-1 bg-slate-900 border border-slate-700 rounded-xl px-3 py-2 text-xs text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-amber-400"
|
||||
class="flex-1 bg-white border border-slate-200 rounded-xl px-3 py-2 text-xs text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-amber-400"
|
||||
>
|
||||
<button type="button" @click="addImageUrl" class="px-4 py-2 bg-amber-400 hover:bg-amber-300 text-slate-950 rounded-xl text-xs font-black transition flex items-center space-x-1">
|
||||
<i data-lucide="plus" class="w-3.5 h-3.5"></i>
|
||||
<span>Toevoegen</span>
|
||||
</button>
|
||||
</div>
|
||||
<p x-show="addError" x-text="addError" class="text-xs text-rose-400 font-bold"></p>
|
||||
<p x-show="addError" x-text="addError" class="text-xs text-rose-600 font-bold"></p>
|
||||
</div>
|
||||
|
||||
<div x-show="uploadError" x-text="uploadError" class="p-2.5 bg-rose-500/10 border border-rose-500/30 text-xs text-rose-300 rounded-xl font-bold"></div>
|
||||
<div x-show="uploadError" x-text="uploadError" class="p-2.5 bg-rose-50 border border-rose-200 text-xs text-rose-700 rounded-xl font-bold"></div>
|
||||
|
||||
<!-- Visuele Weergave: Hoofdafbeelding + Gallerij Grid -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-12 gap-4 items-start">
|
||||
|
||||
<!-- Hoofdafbeelding Box (Links) -->
|
||||
<div class="md:col-span-5 bg-slate-950 rounded-2xl border-2 border-amber-400/50 p-3 space-y-2 relative overflow-hidden">
|
||||
<div class="md:col-span-5 bg-slate-50/80 rounded-2xl border-2 border-amber-300 p-3.5 space-y-2 relative overflow-hidden">
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="px-2.5 py-1 rounded-full bg-amber-400 text-slate-950 font-black text-[10px] uppercase tracking-wider flex items-center space-x-1 shadow-sm">
|
||||
<span class="px-2.5 py-1 rounded-full bg-amber-400 text-slate-950 font-black text-[10px] uppercase tracking-wider flex items-center space-x-1 shadow-2xs">
|
||||
<i data-lucide="star" class="w-3 h-3 fill-current"></i>
|
||||
<span>Hoofdafbeelding (Cover)</span>
|
||||
</span>
|
||||
|
||||
<template x-if="imageUrl">
|
||||
<button type="button" @click="removeCover" class="text-slate-400 hover:text-rose-400 text-xs font-bold transition flex items-center space-x-1" title="Verwijder hoofdafbeelding">
|
||||
<button type="button" @click="removeCover" class="text-slate-400 hover:text-rose-600 text-xs font-bold transition flex items-center space-x-1" title="Verwijder hoofdafbeelding">
|
||||
<i data-lucide="trash-2" class="w-3.5 h-3.5"></i>
|
||||
<span>Verwijderen</span>
|
||||
</button>
|
||||
@@ -219,13 +416,13 @@
|
||||
</div>
|
||||
|
||||
<!-- Grote Image Preview -->
|
||||
<div class="aspect-4/3 rounded-xl bg-slate-900 overflow-hidden flex items-center justify-center relative border border-slate-800">
|
||||
<div class="aspect-4/3 rounded-xl bg-white overflow-hidden flex items-center justify-center relative border border-slate-200 shadow-2xs">
|
||||
<template x-if="imageUrl">
|
||||
<img :src="imageUrl" alt="Hoofdafbeelding" class="w-full h-full object-cover">
|
||||
</template>
|
||||
<template x-if="!imageUrl">
|
||||
<div class="text-center p-4 text-slate-500 space-y-1">
|
||||
<i data-lucide="image" class="w-8 h-8 mx-auto text-slate-600"></i>
|
||||
<div class="text-center p-4 text-slate-400 space-y-1">
|
||||
<i data-lucide="image" class="w-8 h-8 mx-auto text-slate-300"></i>
|
||||
<p class="text-xs font-bold">Geen hoofdafbeelding</p>
|
||||
<p class="text-[10px]">Kies een foto uit de galerij of voeg er een toe.</p>
|
||||
</div>
|
||||
@@ -234,37 +431,36 @@
|
||||
|
||||
<!-- Huidige Cover URL weergave -->
|
||||
<div class="pt-1">
|
||||
<span class="text-[10px] font-mono text-slate-500 truncate block" x-text="imageUrl || 'Geen URL ingesteld'"></span>
|
||||
<span class="text-[10px] font-mono text-slate-400 truncate block" x-text="imageUrl || 'Geen URL ingesteld'"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Gallerij Foto's (Rechts) -->
|
||||
<div class="md:col-span-7 bg-slate-950/60 rounded-2xl border border-slate-800 p-3 space-y-3">
|
||||
<div class="md:col-span-7 bg-slate-50/60 rounded-2xl border border-slate-200 p-3.5 space-y-3">
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-xs font-black text-slate-300 uppercase tracking-wider">Extra Gallerij Foto's</span>
|
||||
<span class="text-[10px] text-slate-500 font-bold" x-text="galleryImages.length + ' extra foto(\'s)'"></span>
|
||||
<span class="text-xs font-black text-slate-700 uppercase tracking-wider">Extra Gallerij Foto's</span>
|
||||
<span class="text-[10px] text-slate-400 font-bold" x-text="galleryImages.length + ' extra foto(\'s)'"></span>
|
||||
</div>
|
||||
|
||||
<!-- Grid van Extra Foto's -->
|
||||
<div class="grid grid-cols-2 sm:grid-cols-3 gap-2.5 max-h-96 overflow-y-auto pr-1">
|
||||
<template x-for="(img, index) in galleryImages" :key="index">
|
||||
<div class="group relative rounded-xl bg-slate-900 border border-slate-800 hover:border-amber-400 transition overflow-hidden">
|
||||
<div class="aspect-square w-full overflow-hidden bg-slate-950">
|
||||
<div class="group relative rounded-xl bg-white border border-slate-200 hover:border-amber-400 transition overflow-hidden shadow-2xs">
|
||||
<div class="aspect-square w-full overflow-hidden bg-slate-100">
|
||||
<img :src="img" alt="Gallerij foto" class="w-full h-full object-cover group-hover:scale-105 transition duration-200" loading="lazy">
|
||||
</div>
|
||||
|
||||
<!-- Index Badge -->
|
||||
<div class="absolute top-1.5 left-1.5">
|
||||
<span class="px-1.5 py-0.5 rounded bg-slate-950/80 text-white font-mono text-[9px] font-bold backdrop-blur" x-text="'#' + (index + 1)"></span>
|
||||
<span class="px-1.5 py-0.5 rounded bg-slate-900/80 text-white font-mono text-[9px] font-bold backdrop-blur" x-text="'#' + (index + 1)"></span>
|
||||
</div>
|
||||
|
||||
<!-- Overlay Knoppen (Maak Hoofdfoto & Verwijderen) -->
|
||||
<div class="absolute inset-0 bg-slate-950/70 backdrop-blur-xs opacity-0 group-hover:opacity-100 transition flex flex-col items-center justify-center gap-1.5 p-2">
|
||||
<!-- Overlay Knoppen -->
|
||||
<div class="absolute inset-0 bg-slate-900/60 opacity-0 group-hover:opacity-100 transition flex flex-col items-center justify-center gap-1.5 p-2">
|
||||
<button
|
||||
type="button"
|
||||
@click="setAsCover(index)"
|
||||
class="w-full py-1.5 px-2 bg-amber-400 hover:bg-amber-300 text-slate-950 rounded-lg text-[10px] font-black uppercase tracking-wider transition flex items-center justify-center space-x-1 shadow"
|
||||
title="Maak deze foto de hoofdafbeelding"
|
||||
>
|
||||
<i data-lucide="star" class="w-3 h-3 fill-current"></i>
|
||||
<span>Als Cover</span>
|
||||
@@ -274,7 +470,6 @@
|
||||
type="button"
|
||||
@click="removeGalleryImage(index)"
|
||||
class="w-full py-1 px-2 bg-rose-600 hover:bg-rose-500 text-white rounded-lg text-[10px] font-bold transition flex items-center justify-center space-x-1"
|
||||
title="Verwijder deze foto uit galerij"
|
||||
>
|
||||
<i data-lucide="trash-2" class="w-3 h-3"></i>
|
||||
<span>Verwijder</span>
|
||||
@@ -284,11 +479,11 @@
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<!-- Empty state als er geen extra gallerij foto's zijn -->
|
||||
<div x-show="galleryImages.length === 0" class="text-center py-8 px-4 rounded-xl border border-dashed border-slate-800 text-slate-500 space-y-1">
|
||||
<i data-lucide="images" class="w-6 h-6 mx-auto text-slate-600"></i>
|
||||
<p class="text-xs font-bold text-slate-400">Nog geen extra galerijfoto's</p>
|
||||
<p class="text-[11px] text-slate-500 max-w-xs mx-auto">
|
||||
<!-- Empty state -->
|
||||
<div x-show="galleryImages.length === 0" class="text-center py-8 px-4 rounded-xl border border-dashed border-slate-200 text-slate-400 space-y-1">
|
||||
<i data-lucide="images" class="w-6 h-6 mx-auto text-slate-300"></i>
|
||||
<p class="text-xs font-bold text-slate-600">Nog geen extra galerijfoto's</p>
|
||||
<p class="text-[11px] text-slate-400 max-w-xs mx-auto">
|
||||
Voeg extra detailfoto's of printbedfoto's toe via "URL Plakken" of "Foto Uploaden".
|
||||
</p>
|
||||
</div>
|
||||
@@ -298,38 +493,39 @@
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Beschrijving -->
|
||||
<div class="space-y-1.5">
|
||||
<label class="block text-xs font-bold text-slate-300">Volledige Productbeschrijving *</label>
|
||||
<textarea name="description" rows="6" required class="w-full bg-slate-950 border border-slate-700 rounded-xl px-3.5 py-2.5 text-xs text-white leading-relaxed">{{ old('description', $product->description) }}</textarea>
|
||||
<label class="block text-xs font-bold text-slate-700">Volledige Productbeschrijving *</label>
|
||||
<textarea name="description" rows="6" required class="w-full bg-slate-50/60 focus:bg-white border border-slate-200 rounded-xl px-3.5 py-2.5 text-xs text-slate-900 leading-relaxed">{{ old('description', $product->description) }}</textarea>
|
||||
</div>
|
||||
|
||||
<!-- Print Specs -->
|
||||
<div class="grid grid-cols-1 sm:grid-cols-3 gap-4 pt-3 border-t border-slate-800">
|
||||
<div class="grid grid-cols-1 sm:grid-cols-3 gap-4 pt-4 border-t border-slate-200/80">
|
||||
<div class="space-y-1.5">
|
||||
<label class="block text-xs font-bold text-slate-300">Afmetingen (LxBxH)</label>
|
||||
<input type="text" name="dimensions" value="{{ old('dimensions', $product->dimensions) }}" placeholder="bijv. 12 x 8 x 10 cm" class="w-full bg-slate-950 border border-slate-700 rounded-xl px-3 py-2 text-xs text-white">
|
||||
<label class="block text-xs font-bold text-slate-700">Afmetingen (LxBxH)</label>
|
||||
<input type="text" name="dimensions" value="{{ old('dimensions', $product->dimensions) }}" placeholder="bijv. 12 x 8 x 10 cm" class="w-full bg-slate-50/60 focus:bg-white border border-slate-200 rounded-xl px-3 py-2 text-xs text-slate-900">
|
||||
</div>
|
||||
|
||||
<div class="space-y-1.5">
|
||||
<label class="block text-xs font-bold text-slate-300">Gewicht (gram)</label>
|
||||
<input type="number" name="weight_grams" value="{{ old('weight_grams', $product->weight_grams) }}" class="w-full bg-slate-950 border border-slate-700 rounded-xl px-3 py-2 text-xs text-white">
|
||||
<label class="block text-xs font-bold text-slate-700">Gewicht (gram)</label>
|
||||
<input type="number" name="weight_grams" x-model.number="weightGrams" class="w-full bg-slate-50/60 focus:bg-white border border-slate-200 rounded-xl px-3 py-2 text-xs text-slate-900">
|
||||
</div>
|
||||
|
||||
<div class="space-y-1.5">
|
||||
<label class="block text-xs font-bold text-slate-300">Printtijd (uren)</label>
|
||||
<input type="number" step="0.1" name="print_time_hours" value="{{ old('print_time_hours', $product->print_time_hours) }}" class="w-full bg-slate-950 border border-slate-700 rounded-xl px-3 py-2 text-xs text-white">
|
||||
<label class="block text-xs font-bold text-slate-700">Printtijd (uren)</label>
|
||||
<input type="number" step="0.1" name="print_time_hours" x-model.number="printTimeHours" class="w-full bg-slate-50/60 focus:bg-white border border-slate-200 rounded-xl px-3 py-2 text-xs text-slate-900">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Toggles -->
|
||||
<div class="pt-3 border-t border-slate-800 flex items-center space-x-6">
|
||||
<label class="flex items-center space-x-2 cursor-pointer text-xs font-bold text-slate-200">
|
||||
<input type="checkbox" name="is_active" value="1" {{ old('is_active', $product->is_active) ? 'checked' : '' }} class="w-4 h-4 rounded text-amber-400 bg-slate-950 border-slate-700">
|
||||
<div class="pt-4 border-t border-slate-200/80 flex items-center space-x-6">
|
||||
<label class="flex items-center space-x-2 cursor-pointer text-xs font-bold text-slate-700">
|
||||
<input type="checkbox" name="is_active" value="1" {{ old('is_active', $product->is_active) ? 'checked' : '' }} class="w-4 h-4 rounded text-amber-500 bg-white border-slate-300">
|
||||
<span>Zichtbaar in webshop (Actief)</span>
|
||||
</label>
|
||||
|
||||
<label class="flex items-center space-x-2 cursor-pointer text-xs font-bold text-slate-200">
|
||||
<input type="checkbox" name="is_featured" value="1" {{ old('is_featured', $product->is_featured) ? 'checked' : '' }} class="w-4 h-4 rounded text-amber-400 bg-slate-950 border-slate-700">
|
||||
<label class="flex items-center space-x-2 cursor-pointer text-xs font-bold text-slate-700">
|
||||
<input type="checkbox" name="is_featured" value="1" {{ old('is_featured', $product->is_featured) ? 'checked' : '' }} class="w-4 h-4 rounded text-amber-500 bg-white border-slate-300">
|
||||
<span>Uitlichten op homepage</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -337,10 +533,10 @@
|
||||
</div>
|
||||
|
||||
<div class="flex items-center justify-end space-x-3">
|
||||
<a href="{{ route('admin.products.index') }}" class="px-4 py-2.5 rounded-xl bg-slate-800 text-slate-300 hover:text-white text-xs font-bold transition">
|
||||
<a href="{{ route('admin.products.index') }}" class="px-4 py-2.5 rounded-xl bg-white hover:bg-slate-50 text-slate-600 text-xs font-bold transition border border-slate-200">
|
||||
Annuleren
|
||||
</a>
|
||||
<button type="submit" class="px-6 py-2.5 rounded-xl bg-amber-400 hover:bg-amber-300 text-slate-950 font-black text-xs transition flex items-center space-x-1.5">
|
||||
<button type="submit" class="px-6 py-2.5 rounded-xl bg-amber-400 hover:bg-amber-300 text-slate-950 font-black text-xs transition flex items-center space-x-1.5 shadow-xs cursor-pointer">
|
||||
<i data-lucide="save" class="w-4 h-4"></i>
|
||||
<span>Wijzigingen Opslaan</span>
|
||||
</button>
|
||||
@@ -349,4 +545,3 @@
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
Reference in New Issue
Block a user