You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
front/src/app/components/login-page/login-page.component.html

136 lines
5.1 KiB

<!-- Fond assombri -->
<div
class="fixed inset-0 bg-gray-900 bg-opacity-50 w-full h-full transition-opacity duration-300 ease-in-out z-40"
[ngClass]="{
'opacity-0 pointer-events-none': !isLoginModalOpen,
'opacity-100': isLoginModalOpen
}"
(click)="closeLoginModal()"
></div>
<!-- Main modal -->
<div
id="authentication-modal"
tabindex="-1"
aria-hidden="true"
[ngClass]="{
'opacity-0 scale-50 pointer-events-none': !isLoginModalOpen,
'opacity-100 scale-100': isLoginModalOpen
}"
class="fixed top-0 right-0 left-0 z-50 flex justify-center items-center w-full h-full transition-transform duration-300 ease-in-out"
>
<div class="relative p-4 w-full max-w-md max-h-full">
<!-- Modal content -->
<div
class="relative bg-white rounded-lg shadow dark:bg-gray-700 transition-transform duration-300 ease-in-out"
>
<!-- Modal header -->
<div
class="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600"
>
<h3 class="text-xl font-semibold text-gray-900 dark:text-white">
Se connecter à Memory Map
</h3>
<button
type="button"
(click)="closeLoginModal()"
class="end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white"
>
<svg
class="w-3 h-3"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 14 14"
>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"
/>
</svg>
<span class="sr-only">Fermer la fenêtre</span>
</button>
</div>
<!-- Modal body -->
<div class="p-4 md:p-5" *ngIf="isLoginModalOpen">
<form [formGroup]="userForm" class="space-y-4">
<div>
<label
for="login"
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>Identifiant</label
>
<input
formControlName="login"
type="text"
name="login"
id="login"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
placeholder="ex: captain24"
required
/>
</div>
<div>
<label
for="password"
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
>Mot de passe</label
>
<input
formControlName="password"
type="password"
name="password"
id="password"
placeholder="••••••••"
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
required
/>
</div>
<div class="flex justify-between">
<div class="flex items-start">
<div class="flex items-center h-5">
<input
id="remember"
type="checkbox"
value=""
class="w-4 h-4 border border-gray-300 rounded bg-gray-50 focus:ring-3 focus:ring-blue-300 dark:bg-gray-600 dark:border-gray-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800"
/>
</div>
<label
for="remember"
class="ms-2 text-sm font-medium text-gray-900 dark:text-gray-300"
>Se souvenir de moi
</label>
</div>
<a
href="#"
class="text-sm text-blue-700 hover:underline dark:text-blue-500"
>Mot de passe oublié ?</a
>
</div>
<div *ngIf="errorMessage" class="text-red-500 text-sm">
{{ errorMessage }}
</div>
<button
(click)="login()"
class="w-full text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
>
Se connecter
</button>
<div class="text-sm font-medium text-gray-500 dark:text-gray-300">
Vous n'êtes pas encore inscrit ?
<a
(click)="openRegisterModal()"
class="text-blue-700 hover:underline dark:text-blue-500"
>Créer un compte</a
>
</div>
</form>
</div>
</div>
</div>
</div>