Hice el catalogo mejor

This commit is contained in:
Bryam105
2025-12-10 12:07:27 -03:30
parent c85f4ec970
commit 09a4619e7f
4 changed files with 33 additions and 30 deletions
+21 -16
View File
@@ -1,36 +1,41 @@
<x-appc>
<div class="max-w-6xl mx-auto px-4 py-8">
<h1 class="text-center text-2xl font-bold mb-8">CATÁLOGO</h1>
<x-layout title="Catalogo - Lauck">
<!-- Header -->
<x-section-header subtitle="Inicio" title="Catalogo de " highlight="Productos"/>
<div class="w-full max-w-5xl">
@if ($products->count() > 0)
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6">
@foreach ($products as $prod)
<div class="p-4 border rounded-lg shadow-md bg-white hover:shadow-lg transition">
<div class="group p-4 border border-neutral-800 rounded-xl hover:border-neon-lime hover:-translate-y-1 transition-all duration-300 shadow-lg hover:shadow-neon-lime/20">
{{-- Imagen si existe --}}
@if (!empty($prod->imagen))
<img src="{{ asset('storage/' . $prod->imagen) }}" alt="{{ $prod->name }}"
@if (!empty($prod->img))
<img src="{{ asset('storage/' . $prod->img) }}" alt="{{ $prod->name }}"
class="w-full h-40 object-cover rounded mb-4">
@else
<div class="w-full h-40 bg-gray-200 flex items-center justify-center rounded mb-4">
<span class="text-gray-500 text-sm">Sin imagen</span>
<div class="w-full h-40 bg-lime-500 flex items-center justify-center rounded mb-4">
<span class="text-neutral-900 text-md uppercase font-bold">Sin imagen</span>
</div>
@endif
{{-- Nombre --}}
<h2 class="text-lg font-semibold text-gray-800">{{ $prod->nombre }}</h2>
<h2 class="text-lg font-semibold text-white">{{ $prod->name }}</h2>
{{-- Descripción corta --}}
@if (!empty($prod->descripcion))
<p class="text-sm text-gray-600 mt-2">{{ $prod->descripcion }}</p>
@endif
<div class="h-10 overflow-y-auto [scrollbar-width:none]">
@if (!empty($prod->description))
<p class="text-sm text-gray-400 mt-2">{{ $prod->description }}</p>
@endif
</div>
{{-- Precio --}}
@if (!empty($prod->precio))
<p class="text-blue-600 font-bold mt-3">${{ number_format($prod->precio, 2, ',', '.') }}</p>
@if (!empty($prod->price))
<p class="text-white group-hover:text-neon-lime font-bold mt-3 transition-colors">${{ number_format($prod->price, 2, ',', '.') }}</p>
@endif
{{-- Botón --}}
<a href="{{ route('productos.vistaUsuario', $prod) }}"
<a href="{{ route('productos.show', $prod) }}"
class="mt-4 block w-full bg-blue-500 text-white py-2 rounded-lg text-center hover:bg-blue-600">
Ver producto
</a>
@@ -42,4 +47,4 @@
<p class="text-center text-gray-600 mt-10">No hay productos disponibles.</p>
@endif
</div>
</x-appc>
</x-layout>