Agregue Ojo para Password, ademas en register, y acomode seeder.

This commit is contained in:
2026-04-05 22:57:11 -03:00
parent 7a884d73a1
commit cf0b40d79e
3 changed files with 102 additions and 77 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ class DatabaseSeeder extends Seeder
'role' => 'employee', 'role' => 'employee',
]); ]);
Supplier::create([ /*Supplier::create([
'name' => 'Cámara 29 Válvula Auto', 'name' => 'Cámara 29 Válvula Auto',
'phone' => '3434567890', 'phone' => '3434567890',
'email' => 'suplier@suplier.com' 'email' => 'suplier@suplier.com'
@@ -61,7 +61,7 @@ class DatabaseSeeder extends Seeder
]); ]);
// Generar 50 productos aleatorios más // Generar 50 productos aleatorios más
Product::factory(50)->create(); Product::factory(50)->create(); */
// Clientes y Turnos // Clientes y Turnos
$client = Client::create([ $client = Client::create([
+9
View File
@@ -128,4 +128,13 @@ $(document).on('click', '#togglePassword', function () {
input.attr('type', isPassword ? 'text' : 'password'); input.attr('type', isPassword ? 'text' : 'password');
$('#iconShow').toggleClass('hidden', isPassword); $('#iconShow').toggleClass('hidden', isPassword);
$('#iconHide').toggleClass('hidden', !isPassword); $('#iconHide').toggleClass('hidden', !isPassword);
});
$(document).on('click', '#togglePasswordConfirm', function () {
const input = $('#passwordConfirmInput');
const isPassword = input.attr('type') === 'password';
input.attr('type', isPassword ? 'text' : 'password');
$('#iconShowConfirm').toggleClass('hidden', isPassword);
$('#iconHideConfirm').toggleClass('hidden', !isPassword);
}); });
+91 -75
View File
@@ -1,95 +1,111 @@
<x-layout title="Register - Lauck"> <x-layout title="Register - Lauck">
<div class="justify-center"> <div class="justify-center">
<x-section-header <x-section-header subtitle="Crear una cuenta" title="Bicicletería " highlight="Lauck" />
subtitle="Crear una cuenta" </div>
title="Bicicletería "
highlight="Lauck"
/>
</div>
<div class="flex flex-col items-center space-y-6 w-full max-w-lg p-6"> <div class="flex flex-col items-center space-y-6 w-full max-w-lg p-6">
<div class="bg-zinc-900 p-8 rounded-xl shadow-lg w-full max-w-md border-2 border-gray-500"> <div class="bg-zinc-900 p-8 rounded-xl shadow-lg w-full max-w-md border-2 border-gray-500">
<form action="{{ route('register.store') }}" method="POST" class="space-y-5"> <form action="{{ route('register.store') }}" method="POST" class="space-y-5">
@csrf @csrf
{{-- Bloque de errores --}} {{-- Bloque de errores --}}
@if ($errors->any()) @if ($errors->any())
<div class="bg-red-900 border border-red-700 text-white p-3 rounded-md"> <div class="bg-red-900 border border-red-700 text-white p-3 rounded-md">
<p class="text-sm font-medium"> <p class="text-sm font-medium">
{{ $errors->first() }} {{ $errors->first() }}
</p> </p>
</div> </div>
@endif @endif
<div> <div>
<x-forms.label class="block text-sm font-bold text-gray-600 mb-1"> <x-forms.label class="block text-sm font-bold text-gray-600 mb-1">
Nombre completo Nombre completo
</x-forms.label> </x-forms.label>
<x-forms.input <x-forms.input type="text" value="{{ old('name') }}" name="name" required
type="text" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-lime-400 text-gray-600" />
value="{{ old('name') }}"
name="name"
required
class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-lime-400 text-gray-600"
/>
</div> </div>
<div> <div>
<x-forms.label class="block text-sm font-bold text-gray-600 mb-1"> <x-forms.label class="block text-sm font-bold text-gray-600 mb-1">
Correo electrónico Correo electrónico
</x-forms.label> </x-forms.label>
<x-forms.input <x-forms.input type="email" value="{{ old('email') }}" name="email" required
type="email" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-lime-400 text-gray-600" />
value="{{ old('email') }}" </div>
name="email"
required
class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-lime-400 text-gray-600"
/>
</div>
<div> <div>
<x-forms.label class="block text-sm font-bold text-gray-600 mb-1"> <x-forms.label class="block text-sm font-bold text-gray-600 mb-1">
Contraseña Contraseña
</x-forms.label> </x-forms.label>
<x-forms.input <div class="relative">
type="password" <x-forms.input id="passwordInput" type="password" name="password" required
name="password" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-lime-400 text-gray-600" />
required <button type="button" id="togglePassword"
class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-lime-400 text-gray-600" class="absolute right-3 top-1/2 -translate-y-1/2 text-neutral-400 hover:text-neutral-700 dark:hover:text-white transition-colors">
/> {{-- Ojo abierto --}}
</div> <svg id="iconShow" xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M2.458 12C3.732 7.943 7.523 5 12 5c4.477 0 8.268 2.943 9.542 7-1.274 4.057-5.065 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
</svg>
{{-- Ojo cerrado --}}
<svg id="iconHide" xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 hidden" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13.875 18.825A10.05 10.05 0 0112 19c-4.477 0-8.268-2.943-9.542-7a9.956 9.956 0 012.293-3.95M6.938 6.938A9.956 9.956 0 0112 5c4.477 0 8.268 2.943 9.542 7a9.97 9.97 0 01-1.88 3.118M3 3l18 18" />
</svg>
</button>
</div>
<div> </div>
<x-forms.label class="block text-sm font-bold text-gray-600 mb-1">
Confirmar contraseña
</x-forms.label>
<x-forms.input
type="password"
name="password_confirmation"
required
class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-lime-400 text-gray-600"
/>
</div>
<div> <div>
<input <x-forms.label class="block text-sm font-bold text-gray-600 mb-1">
type="submit" Confirmar contraseña
value="Registrarse" </x-forms.label>
class="w-full bg-lime-400 font-bold text-white py-2 rounded-md hover:bg-lime-500 transition-colors" <div class="relative">
> <x-forms.input id="passwordConfirmInput" type="password" name="password_confirmation" required
</div> class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-lime-400 text-gray-600" />
<p class="text-center text-sm text-gray-600">
¿Ya tenés una cuenta?
<a href="{{ route('login') }}" class="text-blue-600 hover:underline">
Iniciá sesión acá
</a>.
</p>
</form>
<button type="button" id="togglePasswordConfirm"
class="absolute right-3 top-1/2 -translate-y-1/2 text-neutral-400 hover:text-neutral-700 dark:hover:text-white transition-colors">
{{-- Ojo abierto --}}
<svg id="iconShow" xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M2.458 12C3.732 7.943 7.523 5 12 5c4.477 0 8.268 2.943 9.542 7-1.274 4.057-5.065 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
</svg>
{{-- Ojo cerrado --}}
<svg id="iconHide" xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 hidden" fill="none"
viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M13.875 18.825A10.05 10.05 0 0112 19c-4.477 0-8.268-2.943-9.542-7a9.956 9.956 0 012.293-3.95M6.938 6.938A9.956 9.956 0 0112 5c4.477 0 8.268 2.943 9.542 7a9.97 9.97 0 01-1.88 3.118M3 3l18 18" />
</svg>
</button>
</div>
</div>
<div>
<input type="submit" value="Registrarse"
class="w-full bg-lime-400 font-bold text-white py-2 rounded-md hover:bg-lime-500 transition-colors">
</div>
<p class="text-center text-sm text-gray-600">
¿Ya tenés una cuenta?
<a href="{{ route('login') }}" class="text-blue-600 hover:underline">
Iniciá sesión acá
</a>.
</p>
</form>
</div>
</div> </div>
</div>
</x-layout> </x-layout>