lots of design improvements

This commit is contained in:
Doar Mihai
2026-02-14 16:11:09 +02:00
parent 56b593d9ca
commit 67de095a03
25 changed files with 1942 additions and 1477 deletions
@@ -2,10 +2,10 @@
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<!-- Logo and Primary Navigation -->
<div class="flex">
<div class="flex flex-1">
<!-- Logo -->
<div class="flex-shrink-0 flex items-center">
<a href="{{ route('products.index') }}" class="flex items-center space-x-2">
<a href="{{ route('homepage') }}" class="flex items-center space-x-2">
<svg class="h-8 w-8 text-primary-600" fill="currentColor" viewBox="0 0 24 24">
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"></path>
</svg>
@@ -16,8 +16,8 @@
<!-- Desktop Navigation -->
<div class="hidden sm:ml-8 sm:flex sm:space-x-8">
<a href="{{ route('products.index') }}"
class="inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium {{ request()->routeIs('products.index') ? 'border-primary-500 text-gray-900' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700' }}">
Discover
class="inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium {{ request()->routeIs('products.*') ? 'border-primary-500 text-gray-900' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700' }}">
Products
</a>
@auth
@if(auth()->user()->hasAnyRole(['admin', 'moderator']))
@@ -28,6 +28,24 @@
@endif
@endauth
</div>
<!-- Search Bar (Desktop) -->
<div class="hidden md:flex md:flex-1 md:ml-8 md:mr-8 md:max-w-md">
<form action="{{ route('products.index') }}" method="GET" class="w-full">
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<svg class="h-5 w-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
</svg>
</div>
<input type="text"
name="search"
value="{{ request('search') }}"
class="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md leading-5 bg-white placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 focus:ring-1 focus:ring-primary-500 focus:border-primary-500 sm:text-sm"
placeholder="Search products...">
</div>
</form>
</div>
</div>
<!-- Right Side -->
@@ -0,0 +1,71 @@
<div class="bg-white rounded-lg border border-gray-200 hover:shadow-lg transition-shadow overflow-hidden group">
<a href="{{ route('products.show', $product) }}" class="block">
<!-- Thumbnail -->
<div class="relative aspect-video bg-gray-100 overflow-hidden">
@if($product->thumbnail_url)
<img src="{{ $product->thumbnail_url }}"
alt="{{ $product->title }}"
class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300">
@else
<div class="w-full h-full flex items-center justify-center bg-gradient-to-br from-primary-100 to-primary-200">
<svg class="h-16 w-16 text-primary-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"></path>
</svg>
</div>
@endif
<!-- Category Badge -->
<div class="absolute top-2 left-2">
<span class="inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-medium bg-white/90 backdrop-blur-sm text-gray-800">
{{ $product->category->name }}
</span>
</div>
</div>
<!-- Content -->
<div class="p-4">
<h3 class="text-lg font-semibold text-gray-900 line-clamp-1 group-hover:text-primary-600">
{{ $product->title }}
</h3>
<p class="mt-2 text-sm text-gray-600 line-clamp-2">
{{ $product->description }}
</p>
<!-- Meta Info -->
<div class="mt-4 flex items-center justify-between">
<div class="flex items-center space-x-3">
<!-- Upvote Button -->
<form action="{{ route('products.upvote', $product) }}" method="POST" class="inline-block" @auth @else onclick="event.preventDefault(); alert('Please login to upvote');" @endauth>
@csrf
<button type="submit"
@guest disabled @endguest
class="group/upvote flex items-center space-x-1 px-3 py-1.5 rounded-md border {{ $product->isUpvotedBy(auth()->user()) ? 'border-primary-500 bg-primary-50 text-primary-700' : 'border-gray-300 bg-white text-gray-700 hover:border-primary-500 hover:bg-primary-50' }} transition-colors">
<svg class="h-4 w-4" fill="{{ $product->isUpvotedBy(auth()->user()) ? 'currentColor' : 'none' }}" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7"></path>
</svg>
<span class="text-sm font-medium">{{ $product->upvotes_count }}</span>
</button>
</form>
<!-- Comments Count -->
<div class="flex items-center space-x-1 text-gray-500">
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path>
</svg>
<span class="text-sm">{{ $product->comments_count }}</span>
</div>
</div>
<!-- User Info -->
<div class="flex items-center">
<a href="{{ route('profile.show', $product->user) }}" class="flex items-center space-x-2 hover:opacity-75" onclick="event.stopPropagation();">
<div class="h-6 w-6 rounded-full bg-gradient-to-br from-primary-500 to-accent-500 flex items-center justify-center text-white text-xs font-semibold">
{{ strtoupper(substr($product->user->name, 0, 1)) }}
</div>
<span class="text-xs text-gray-600">{{ $product->user->name }}</span>
</a>
</div>
</div>
</div>
</a>
</div>
@@ -35,9 +35,9 @@ aria-live="assertive">
x-transition:leave="transition ease-in duration-200"
x-transition:leave-start="transform translate-x-0 opacity-100"
x-transition:leave-end="transform translate-x-full opacity-0"
class="max-w-sm w-full bg-white shadow-lg rounded-lg pointer-events-auto ring-1 ring-black ring-opacity-5 overflow-hidden">
class="w-full max-w-sm bg-white shadow-lg rounded-lg pointer-events-auto ring-1 ring-black ring-opacity-5 overflow-hidden">
<div class="p-4">
<div class="flex items-start">
<div class="flex items-start gap-3">
<div class="flex-shrink-0">
<!-- Success Icon -->
<template x-if="notice.type === 'success'">
@@ -64,11 +64,11 @@ aria-live="assertive">
</svg>
</template>
</div>
<div class="ml-3 w-0 flex-1 pt-0.5">
<div class="flex-1 min-w-0">
<p class="text-sm font-medium text-gray-900" x-text="notice.title"></p>
<p class="mt-1 text-sm text-gray-500" x-text="notice.message"></p>
<p class="mt-1 text-sm text-gray-500 break-words" x-text="notice.message"></p>
</div>
<div class="ml-4 flex-shrink-0 flex">
<div class="flex-shrink-0">
<button @click="remove(notice.id)"
class="bg-white rounded-md inline-flex text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
<span class="sr-only">Close</span>