ajout de la fonctionnalité login et modification profil

This commit is contained in:
2026-03-23 23:06:33 +01:00
parent eb9d1f496b
commit a7ac890c17
20 changed files with 867 additions and 67 deletions
+32 -6
View File
@@ -23,12 +23,38 @@
</div>
<nav class="flex items-center gap-2 whitespace-nowrap">
<a href="{{ route('login') }}" class="px-5 py-2.5 text-sm font-bold text-niagara border-2 border-niagara rounded-lg hover:bg-niagara hover:text-white transition-smooth duration-200">
Connexion
</a>
<a href="{{ route('register') }}" class="px-5 py-2.5 text-sm font-bold bg-candlelight text-gray-900 rounded-lg shadow-md hover:shadow-lg hover:-translate-y-0.5 transition-smooth duration-200">
S'inscrire
</a>
@auth
<div class="relative group">
<button class="flex items-center gap-2 p-2 rounded-lg hover:bg-gray-100 transition-smooth duration-200">
<img
src="https://ui-avatars.com/api/?name={{ urlencode(Auth::user()->Pseudo) }}&background=06989e&color=fff&size=40"
alt="Photo de profil de {{ Auth::user()->Pseudo }}"
class="w-10 h-10 rounded-full border-2 border-niagara"
>
<span class="text-sm text-gray-700 font-semibold hidden sm:inline">{{ Auth::user()->Pseudo }}</span>
</button>
<!-- Menu déroulant -->
<div class="absolute right-0 mt-0 w-48 bg-white rounded-lg shadow-xl border border-gray-200 opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50">
<a href="{{ route('profile.settings') }}" class="block px-4 py-3 text-sm text-gray-700 hover:bg-gray-50 border-b border-gray-200 rounded-t-lg">
⚙️ Paramètres du profil
</a>
<form action="{{ route('logout') }}" method="POST">
@csrf
<button type="submit" class="w-full text-left px-4 py-3 text-sm text-red-600 hover:bg-red-50 rounded-b-lg font-semibold">
🚪 Déconnexion
</button>
</form>
</div>
</div>
@else
<a href="{{ route('login') }}" class="px-5 py-2.5 text-sm font-bold text-niagara border-2 border-niagara rounded-lg hover:bg-niagara hover:text-white transition-smooth duration-200">
Connexion
</a>
<a href="{{ route('register') }}" class="px-5 py-2.5 text-sm font-bold bg-candlelight text-gray-900 rounded-lg shadow-md hover:shadow-lg hover:-translate-y-0.5 transition-smooth duration-200">
S'inscrire
</a>
@endauth
</nav>
</div>
</header>