Improve login and initial user setup screen appearance (#1336)
This commit is contained in:
+82
-19
@@ -1,37 +1,100 @@
|
||||
<div class="change-password-container">
|
||||
<div class="change-password-wrapper">
|
||||
<p-card class="change-password-card p-fluid">
|
||||
<div class="change-password-card-wrapper">
|
||||
<div class="change-password-card-border">
|
||||
<div class="change-password-card">
|
||||
<div class="change-password-header">
|
||||
<div class="logo-wrapper">
|
||||
<div class="icon-circle">
|
||||
<i class="pi pi-key"></i>
|
||||
</div>
|
||||
</div>
|
||||
<h1 class="change-password-title">Change Password</h1>
|
||||
<p class="change-password-subtitle">Update your password to keep your account secure</p>
|
||||
</div>
|
||||
|
||||
<ng-template pTemplate="content">
|
||||
<form #changePasswordForm="ngForm" (ngSubmit)="changePassword()">
|
||||
<div class="p-field">
|
||||
<label for="currentPassword">Current Password</label>
|
||||
<p-password id="currentPassword" [(ngModel)]="currentPassword" name="currentPassword" [feedback]="false" required fluid></p-password>
|
||||
<form class="change-password-form" #changePasswordForm="ngForm" (ngSubmit)="changePassword()">
|
||||
<div class="form-field">
|
||||
<label for="currentPassword" class="form-label">
|
||||
<i class="pi pi-lock"></i>
|
||||
<span>Current Password</span>
|
||||
</label>
|
||||
<p-password
|
||||
id="currentPassword"
|
||||
name="currentPassword"
|
||||
required
|
||||
[(ngModel)]="currentPassword"
|
||||
[feedback]="false"
|
||||
placeholder="Enter your current password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
autocomplete="current-password"
|
||||
></p-password>
|
||||
</div>
|
||||
|
||||
<div class="p-field">
|
||||
<label for="newPassword">New Password</label>
|
||||
<p-password id="newPassword" [(ngModel)]="newPassword" name="newPassword" [feedback]="false" required fluid></p-password>
|
||||
<div class="form-field">
|
||||
<label for="newPassword" class="form-label">
|
||||
<i class="pi pi-lock-open"></i>
|
||||
<span>New Password</span>
|
||||
</label>
|
||||
<p-password
|
||||
id="newPassword"
|
||||
name="newPassword"
|
||||
required
|
||||
[(ngModel)]="newPassword"
|
||||
[feedback]="false"
|
||||
placeholder="Enter your new password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
autocomplete="new-password"
|
||||
></p-password>
|
||||
</div>
|
||||
|
||||
<div class="p-field">
|
||||
<label for="confirmNewPassword">Confirm New Password</label>
|
||||
<p-password id="confirmNewPassword" [(ngModel)]="confirmNewPassword" name="confirmNewPassword" [feedback]="false" required fluid></p-password>
|
||||
<div class="form-field">
|
||||
<label for="confirmNewPassword" class="form-label">
|
||||
<i class="pi pi-check-circle"></i>
|
||||
<span>Confirm New Password</span>
|
||||
</label>
|
||||
<p-password
|
||||
id="confirmNewPassword"
|
||||
name="confirmNewPassword"
|
||||
required
|
||||
[(ngModel)]="confirmNewPassword"
|
||||
[feedback]="false"
|
||||
placeholder="Confirm your new password"
|
||||
[toggleMask]="true"
|
||||
[fluid]="true"
|
||||
autocomplete="new-password"
|
||||
></p-password>
|
||||
@if (!passwordsMatch && confirmNewPassword) {
|
||||
<p-message severity="error" text="New passwords do not match."></p-message>
|
||||
<small class="field-error">
|
||||
<i class="pi pi-exclamation-circle"></i>
|
||||
New passwords do not match
|
||||
</small>
|
||||
}
|
||||
</div>
|
||||
|
||||
<p-button type="submit" label="Change Password" icon="pi pi-key" class="p-fluid"></p-button>
|
||||
<p-button
|
||||
fluid
|
||||
type="submit"
|
||||
label="Update Password"
|
||||
icon="pi pi-check"
|
||||
[disabled]="!changePasswordForm.valid || !passwordsMatch"
|
||||
class="change-password-button"
|
||||
/>
|
||||
|
||||
@if (errorMessage) {
|
||||
<p-message severity="error" text="{{ errorMessage }}"></p-message>
|
||||
<div class="message-container error-message">
|
||||
<p-message severity="error">{{ errorMessage }}</p-message>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (successMessage) {
|
||||
<p-message severity="success" text="{{ successMessage }}"></p-message>
|
||||
<div class="message-container success-message">
|
||||
<p-message severity="success">{{ successMessage }}</p-message>
|
||||
</div>
|
||||
}
|
||||
</form>
|
||||
</ng-template>
|
||||
</p-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+65
-3
@@ -1,28 +1,90 @@
|
||||
@use '../../styles/auth-shared' as auth;
|
||||
|
||||
.change-password-container {
|
||||
@apply flex items-center justify-center min-h-screen bg-gradient-to-br from-blue-900 via-cyan-600 to-blue-400 relative;
|
||||
@include auth.auth-container;
|
||||
}
|
||||
|
||||
.change-password-wrapper {
|
||||
@apply flex flex-col items-center gap-6 absolute top-1/4 transform -translate-y-1/4;
|
||||
}
|
||||
|
||||
.change-password-card-wrapper {
|
||||
@include auth.auth-card-wrapper(500px, -6rem);
|
||||
}
|
||||
|
||||
.change-password-card-border {
|
||||
@include auth.auth-card-border;
|
||||
}
|
||||
|
||||
.change-password-card {
|
||||
@include auth.auth-card;
|
||||
}
|
||||
|
||||
.app-title {
|
||||
@apply text-5xl font-extrabold text-white drop-shadow-lg;
|
||||
text-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.change-password-card {
|
||||
@apply w-96 shadow-lg rounded-xl bg-opacity-90 backdrop-blur-lg;
|
||||
.change-password-header {
|
||||
@include auth.auth-header;
|
||||
}
|
||||
|
||||
.logo-wrapper {
|
||||
@include auth.auth-logo;
|
||||
}
|
||||
|
||||
.icon-circle {
|
||||
@include auth.auth-icon-circle;
|
||||
}
|
||||
|
||||
.change-password-title {
|
||||
@include auth.auth-title;
|
||||
}
|
||||
|
||||
.change-password-subtitle {
|
||||
@include auth.auth-subtitle;
|
||||
}
|
||||
|
||||
form {
|
||||
@apply flex flex-col gap-4;
|
||||
}
|
||||
|
||||
.change-password-form {
|
||||
@include auth.auth-form;
|
||||
}
|
||||
|
||||
.p-field {
|
||||
@apply flex flex-col gap-2;
|
||||
}
|
||||
|
||||
.form-field {
|
||||
@include auth.form-field;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
@include auth.form-label;
|
||||
}
|
||||
|
||||
.field-error {
|
||||
@include auth.field-error;
|
||||
}
|
||||
|
||||
p-button {
|
||||
@apply mt-4;
|
||||
}
|
||||
|
||||
.change-password-button {
|
||||
@include auth.auth-button;
|
||||
}
|
||||
|
||||
.message-container {
|
||||
@include auth.message-container;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
@include auth.error-message;
|
||||
}
|
||||
|
||||
.success-message {
|
||||
@include auth.success-message;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import {Component, inject} from '@angular/core';
|
||||
import {Button} from 'primeng/button';
|
||||
import {Card} from 'primeng/card';
|
||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||
import {Message} from 'primeng/message';
|
||||
|
||||
import {Password} from 'primeng/password';
|
||||
import {MessageService, PrimeTemplate} from 'primeng/api';
|
||||
import {MessageService} from 'primeng/api';
|
||||
import {UserService} from '../../../features/settings/user-management/user.service';
|
||||
import {AuthService} from '../../service/auth.service';
|
||||
|
||||
@@ -14,13 +13,11 @@ import {AuthService} from '../../service/auth.service';
|
||||
standalone: true,
|
||||
imports: [
|
||||
Button,
|
||||
Card,
|
||||
FormsModule,
|
||||
Message,
|
||||
Password,
|
||||
PrimeTemplate,
|
||||
ReactiveFormsModule
|
||||
],
|
||||
],
|
||||
templateUrl: './change-password.component.html',
|
||||
styleUrl: './change-password.component.scss'
|
||||
})
|
||||
|
||||
+2
-2
@@ -58,7 +58,7 @@
|
||||
|
||||
.hash-group {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
border-radius: 8px;
|
||||
padding: 1rem;
|
||||
margin: 0.5rem 0;
|
||||
@@ -120,7 +120,7 @@
|
||||
padding: 0.75rem;
|
||||
border-radius: 6px;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid var(--p-content-border-color);
|
||||
transition: all 0.2s ease;
|
||||
margin-left: 1rem;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
width: 100%;
|
||||
padding: 8px 12px;
|
||||
font-size: 16px;
|
||||
border: 1px solid var(--text-color-secondary);
|
||||
border: 1px solid var(--text-secondary-color);
|
||||
border-radius: 4px;
|
||||
margin-bottom: 15px;
|
||||
box-sizing: border-box;
|
||||
@@ -27,6 +27,6 @@
|
||||
}
|
||||
|
||||
.icon-search::placeholder {
|
||||
color: var(--text-color-secondary);
|
||||
color: var(--text-secondary-color);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@@ -1,31 +1,30 @@
|
||||
<div class="flex items-center justify-center min-h-screen min-w-[100vw] overflow-hidden"
|
||||
style="background: linear-gradient(60deg, var(--primary-color) 0%, #1e3a8a 100%);">
|
||||
<div class="flex flex-col items-center justify-center -mt-48 w-[90%] sm:w-auto sm:min-w-[400px] md:min-w-[500px]">
|
||||
<div class="w-full" style="border-radius: 56px; padding: 0.3rem; background: linear-gradient(180deg, var(--primary-color) 10%, rgba(33, 150, 243, 0) 30%)">
|
||||
<div class="w-full bg-surface-900 pt-8 pb-14 px-8 sm:px-12" style="border-radius: 53px">
|
||||
<div class="text-center mb-8">
|
||||
<svg class="mb-8 w-14 h-14 mx-auto" viewBox="0 0 126 126" fill="var(--primary-color)" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M59 4.79297C71.5051 11.5557 80 24.7854 80 40C80 40.5959 79.987 41.1888 79.9609 41.7783C79.8609 44.0406 81.7355 46 84 46C106.091 46 124 63.9086 124 86C124 108.091 106.091 126 84 126H10C4.47715 126 0 121.523 0 116V39.0068L0.0126953 38.9941C0.357624 25.0252 7.86506 12.8347 19 5.95215V63.832C19 64.8345 20.0676 65.4391 20.9121 64.9902L21.0771 64.8867L38.2227 52.3428C38.6819 52.0068 39.3064 52.0068 39.7656 52.3428L56.9229 64.8945L57.0879 64.998C57.9324 65.447 59 64.8423 59 63.8398V4.79297Z"/>
|
||||
<path
|
||||
d="M40 0C43.8745 0 47.6199 0.552381 51.1631 1.58008V50.9697L44.3926 46.0176L44.0879 45.8037C40.9061 43.6679 36.7098 43.7393 33.5957 46.0176L26.8369 50.9619V2.21875C30.9593 0.782634 35.3881 0 40 0Z"
|
||||
fill="white"/>
|
||||
</svg>
|
||||
<div class="text-3xl font-medium mb-4">Welcome to Booklore</div>
|
||||
<span class="font-medium">Sign in to continue</span>
|
||||
<div class="login-container">
|
||||
<div class="login-card-wrapper">
|
||||
<div class="login-card-border">
|
||||
<div class="login-card">
|
||||
<div class="login-header">
|
||||
<div class="logo-wrapper">
|
||||
<svg class="logo-icon" viewBox="0 0 126 126" fill="var(--primary-color)" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M59 4.79297C71.5051 11.5557 80 24.7854 80 40C80 40.5959 79.987 41.1888 79.9609 41.7783C79.8609 44.0406 81.7355 46 84 46C106.091 46 124 63.9086 124 86C124 108.091 106.091 126 84 126H10C4.47715 126 0 121.523 0 116V39.0068L0.0126953 38.9941C0.357624 25.0252 7.86506 12.8347 19 5.95215V63.832C19 64.8345 20.0676 65.4391 20.9121 64.9902L21.0771 64.8867L38.2227 52.3428C38.6819 52.0068 39.3064 52.0068 39.7656 52.3428L56.9229 64.8945L57.0879 64.998C57.9324 65.447 59 64.8423 59 63.8398V4.79297Z"/>
|
||||
<path
|
||||
d="M40 0C43.8745 0 47.6199 0.552381 51.1631 1.58008V50.9697L44.3926 46.0176L44.0879 45.8037C40.9061 43.6679 36.7098 43.7393 33.5957 46.0176L26.8369 50.9619V2.21875C30.9593 0.782634 35.3881 0 40 0Z"
|
||||
fill="white"/>
|
||||
</svg>
|
||||
</div>
|
||||
<h1 class="login-title">Welcome Back</h1>
|
||||
<p class="login-subtitle">Sign in to continue your journey</p>
|
||||
</div>
|
||||
|
||||
@if (showOidcBypassInfo) {
|
||||
<div class="mb-4 p-3 rounded-md bg-yellow-900/30 border border-yellow-600/50 w-full">
|
||||
<div class="flex flex-col items-center">
|
||||
<div class="flex items-center gap-2 text-yellow-200 text-sm mb-2">
|
||||
<div class="oidc-warning">
|
||||
<div class="warning-content">
|
||||
<div class="warning-header">
|
||||
<i class="pi pi-exclamation-triangle"></i>
|
||||
<span class="font-medium">OIDC Authentication Issues Detected</span>
|
||||
<span>OIDC Authentication Issues</span>
|
||||
</div>
|
||||
<p class="text-xs text-yellow-300 mb-3 text-center">
|
||||
{{ oidcBypassMessage }}
|
||||
</p>
|
||||
<div class="flex gap-4">
|
||||
<p class="warning-message">{{ oidcBypassMessage }}</p>
|
||||
<div class="warning-actions">
|
||||
<p-button
|
||||
size="small"
|
||||
severity="warn"
|
||||
@@ -45,9 +44,12 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
<form class="flex flex-col gap-4 w-full" #loginForm="ngForm" (ngSubmit)="login()">
|
||||
<div class="flex flex-col gap-2">
|
||||
<label for="username" class="text-lg font-medium">Username</label>
|
||||
<form class="login-form" #loginForm="ngForm" (ngSubmit)="login()">
|
||||
<div class="form-field">
|
||||
<label for="username" class="form-label">
|
||||
<i class="pi pi-user"></i>
|
||||
<span>Username</span>
|
||||
</label>
|
||||
<input
|
||||
fluid
|
||||
pInputText
|
||||
@@ -56,13 +58,16 @@
|
||||
required
|
||||
[(ngModel)]="username"
|
||||
placeholder="Enter your username"
|
||||
class="w-full"
|
||||
class="form-input"
|
||||
autocomplete="username"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
<label for="password" class="text-lg font-medium">Password</label>
|
||||
<div class="form-field">
|
||||
<label for="password" class="form-label">
|
||||
<i class="pi pi-lock"></i>
|
||||
<span>Password</span>
|
||||
</label>
|
||||
<p-password
|
||||
id="password"
|
||||
name="password"
|
||||
@@ -71,7 +76,6 @@
|
||||
[feedback]="false"
|
||||
placeholder="Enter your password"
|
||||
[toggleMask]="true"
|
||||
class="mb-4"
|
||||
[fluid]="true"
|
||||
autocomplete="current-password"
|
||||
></p-password>
|
||||
@@ -80,47 +84,47 @@
|
||||
<p-button
|
||||
fluid
|
||||
type="submit"
|
||||
label="Login"
|
||||
label="Sign In"
|
||||
icon="pi pi-sign-in"
|
||||
[disabled]="!loginForm.valid || !username || !password"
|
||||
class="w-full">
|
||||
class="login-button">
|
||||
</p-button>
|
||||
|
||||
@if (errorMessage) {
|
||||
<p-message severity="error">{{ errorMessage }}</p-message>
|
||||
<div class="error-message">
|
||||
<p-message severity="error">{{ errorMessage }}</p-message>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (oidcEnabled && !isOidcBypassed) {
|
||||
<div class="flex items-center gap-2 my-2">
|
||||
<hr class="flex-grow" style="border: none; border-top: 1px solid var(--border-color);"/>
|
||||
<span class="text-gray-300">or</span>
|
||||
<hr class="flex-grow" style="border: none; border-top: 1px solid var(--border-color);"/>
|
||||
<div class="divider">
|
||||
<span>or continue with</span>
|
||||
</div>
|
||||
|
||||
<p-button
|
||||
fluid
|
||||
severity="info"
|
||||
[label]="isOidcLoginInProgress ? 'Redirecting to ' + oidcName + '...' : 'Login with ' + oidcName"
|
||||
severity="secondary"
|
||||
[label]="isOidcLoginInProgress ? 'Redirecting to ' + oidcName + '...' : oidcName"
|
||||
[icon]="isOidcLoginInProgress ? 'pi pi-spin pi-spinner' : 'pi pi-id-card'"
|
||||
[disabled]="isOidcLoginInProgress"
|
||||
(click)="loginWithOidc()"
|
||||
class="w-full bg-gray-800 text-white hover:bg-gray-700"/>
|
||||
class="oidc-button"/>
|
||||
|
||||
<div class="text-center">
|
||||
<div class="help-text">
|
||||
<button
|
||||
type="button"
|
||||
class="text-xs text-gray-400 hover:text-gray-300 underline"
|
||||
class="text-link"
|
||||
(click)="bypassOidc()">
|
||||
Having trouble with {{ oidcName }}? Use local login only
|
||||
Having trouble with {{ oidcName }}? Use local login
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (oidcEnabled && isOidcBypassed) {
|
||||
<div class="text-center mt-4">
|
||||
<div class="help-text">
|
||||
<button
|
||||
type="button"
|
||||
class="text-xs text-blue-400 hover:text-blue-300 underline"
|
||||
class="text-link primary"
|
||||
(click)="enableOidc()">
|
||||
Re-enable {{ oidcName }} login
|
||||
</button>
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
@use '../../styles/auth-shared' as auth;
|
||||
|
||||
.login-container {
|
||||
@include auth.auth-container;
|
||||
}
|
||||
|
||||
.login-card-wrapper {
|
||||
@include auth.auth-card-wrapper(460px, -8rem);
|
||||
}
|
||||
|
||||
.login-card-border {
|
||||
@include auth.auth-card-border;
|
||||
}
|
||||
|
||||
.login-card {
|
||||
@include auth.auth-card;
|
||||
}
|
||||
|
||||
.login-header {
|
||||
@include auth.auth-header;
|
||||
}
|
||||
|
||||
.logo-wrapper {
|
||||
@include auth.auth-logo;
|
||||
}
|
||||
|
||||
.logo-icon {
|
||||
@include auth.auth-logo-icon;
|
||||
}
|
||||
|
||||
.login-title {
|
||||
@include auth.auth-title;
|
||||
}
|
||||
|
||||
.login-subtitle {
|
||||
@include auth.auth-subtitle;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.oidc-warning {
|
||||
margin-bottom: 1.5rem;
|
||||
padding: 1rem;
|
||||
border-radius: 0.75rem;
|
||||
background: rgba(245, 158, 11, 0.1);
|
||||
border: 1px solid rgba(245, 158, 11, 0.3);
|
||||
animation: fadeIn 0.3s ease-out;
|
||||
}
|
||||
|
||||
.warning-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.warning-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
color: #fbbf24;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
|
||||
i {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.warning-message {
|
||||
font-size: 0.75rem;
|
||||
color: #fcd34d;
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.warning-actions {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.login-form {
|
||||
@include auth.auth-form(1.5rem);
|
||||
}
|
||||
|
||||
.form-field {
|
||||
@include auth.form-field;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
@include auth.form-label;
|
||||
}
|
||||
|
||||
.form-input {
|
||||
@include auth.form-input;
|
||||
}
|
||||
|
||||
.login-button {
|
||||
@include auth.auth-button;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
@include auth.error-message;
|
||||
}
|
||||
|
||||
.divider {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
margin: 1.5rem 0;
|
||||
|
||||
&::before,
|
||||
&::after {
|
||||
content: '';
|
||||
flex: 1;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
|
||||
span {
|
||||
padding: 0 1rem;
|
||||
font-size: 0.875rem;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.oidc-button {
|
||||
::ng-deep button {
|
||||
height: 2.75rem;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid rgba(255, 255, 255, 0.15);
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-color: rgba(255, 255, 255, 0.25);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.help-text {
|
||||
text-align: center;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.text-link {
|
||||
background: none;
|
||||
border: none;
|
||||
font-size: 0.8rem;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
transition: color 0.2s ease;
|
||||
padding: 0;
|
||||
|
||||
&:hover {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
&.primary {
|
||||
color: var(--primary-color);
|
||||
|
||||
&:hover {
|
||||
color: #60a5fa;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,42 +1,50 @@
|
||||
<div class="flex items-center justify-center min-h-screen min-w-[100vw] overflow-hidden"
|
||||
style="background: linear-gradient(60deg, var(--primary-color) 0%, #1e3a8a 100%);">
|
||||
<div class="flex flex-col items-center justify-center -mt-48">
|
||||
<div style="border-radius: 56px; padding: 0.3rem; background: linear-gradient(180deg, var(--primary-color) 10%, rgba(33, 150, 243, 0) 30%)">
|
||||
<div class="w-full bg-surface-900 py-16 px-8 sm:px-16" style="border-radius: 53px">
|
||||
<div class="text-center mb-8">
|
||||
<svg class="mb-8 w-16 h-16 mx-auto" viewBox="0 0 126 126" fill="var(--primary-color)" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M59 4.79297C71.5051 11.5557 80 24.7854 80 40C80 40.5959 79.987 41.1888 79.9609 41.7783C79.8609 44.0406 81.7355 46 84 46C106.091 46 124 63.9086 124 86C124 108.091 106.091 126 84 126H10C4.47715 126 0 121.523 0 116V39.0068L0.0126953 38.9941C0.357624 25.0252 7.86506 12.8347 19 5.95215V63.832C19 64.8345 20.0676 65.4391 20.9121 64.9902L21.0771 64.8867L38.2227 52.3428C38.6819 52.0068 39.3064 52.0068 39.7656 52.3428L56.9229 64.8945L57.0879 64.998C57.9324 65.447 59 64.8423 59 63.8398V4.79297Z"/>
|
||||
<path
|
||||
d="M40 0C43.8745 0 47.6199 0.552381 51.1631 1.58008V50.9697L44.3926 46.0176L44.0879 45.8037C40.9061 43.6679 36.7098 43.7393 33.5957 46.0176L26.8369 50.9619V2.21875C30.9593 0.782634 35.3881 0 40 0Z"
|
||||
fill="white"/>
|
||||
</svg>
|
||||
<div class="text-3xl font-medium mb-4">Welcome to Booklore</div>
|
||||
<span class="text-xl">Setup Initial Admin Account</span>
|
||||
<div class="setup-container">
|
||||
<div class="setup-card-wrapper">
|
||||
<div class="setup-card-border">
|
||||
<div class="setup-card">
|
||||
<div class="setup-header">
|
||||
<div class="logo-wrapper">
|
||||
<svg class="logo-icon" viewBox="0 0 126 126" fill="var(--primary-color)" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M59 4.79297C71.5051 11.5557 80 24.7854 80 40C80 40.5959 79.987 41.1888 79.9609 41.7783C79.8609 44.0406 81.7355 46 84 46C106.091 46 124 63.9086 124 86C124 108.091 106.091 126 84 126H10C4.47715 126 0 121.523 0 116V39.0068L0.0126953 38.9941C0.357624 25.0252 7.86506 12.8347 19 5.95215V63.832C19 64.8345 20.0676 65.4391 20.9121 64.9902L21.0771 64.8867L38.2227 52.3428C38.6819 52.0068 39.3064 52.0068 39.7656 52.3428L56.9229 64.8945L57.0879 64.998C57.9324 65.447 59 64.8423 59 63.8398V4.79297Z"/>
|
||||
<path
|
||||
d="M40 0C43.8745 0 47.6199 0.552381 51.1631 1.58008V50.9697L44.3926 46.0176L44.0879 45.8037C40.9061 43.6679 36.7098 43.7393 33.5957 46.0176L26.8369 50.9619V2.21875C30.9593 0.782634 35.3881 0 40 0Z"
|
||||
fill="white"/>
|
||||
</svg>
|
||||
</div>
|
||||
<h1 class="setup-title">Welcome to Booklore</h1>
|
||||
<p class="setup-subtitle">Setup your initial admin account to get started</p>
|
||||
</div>
|
||||
|
||||
<form class="flex flex-col gap-4" [formGroup]="setupForm" (ngSubmit)="onSubmit()">
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
<label for="username" class="text-lg font-medium">Username</label>
|
||||
<form class="setup-form" [formGroup]="setupForm" (ngSubmit)="onSubmit()">
|
||||
<div class="form-field">
|
||||
<label for="username" class="form-label">
|
||||
<i class="pi pi-user"></i>
|
||||
<span>Username</span>
|
||||
</label>
|
||||
<input
|
||||
pInputText
|
||||
id="username"
|
||||
name="username"
|
||||
required
|
||||
formControlName="username"
|
||||
placeholder="Enter your username"
|
||||
class="w-full md:w-[30rem]"
|
||||
placeholder="Choose a username"
|
||||
class="form-input"
|
||||
autocomplete="username"
|
||||
/>
|
||||
@if (setupForm.get('username')?.invalid && setupForm.get('username')?.touched) {
|
||||
<small class="text-red-500">
|
||||
Username is required.
|
||||
<small class="field-error">
|
||||
<i class="pi pi-exclamation-circle"></i>
|
||||
Username is required
|
||||
</small>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
<label for="name" class="text-lg font-medium">Name</label>
|
||||
<div class="form-field">
|
||||
<label for="name" class="form-label">
|
||||
<i class="pi pi-id-card"></i>
|
||||
<span>Full Name</span>
|
||||
</label>
|
||||
<input
|
||||
pInputText
|
||||
id="name"
|
||||
@@ -44,68 +52,85 @@
|
||||
required
|
||||
formControlName="name"
|
||||
placeholder="Enter your full name"
|
||||
class="w-full md:w-[30rem]"
|
||||
class="form-input"
|
||||
autocomplete="name"
|
||||
/>
|
||||
@if (setupForm.get('name')?.invalid && setupForm.get('name')?.touched) {
|
||||
<small class="text-red-500">
|
||||
Name is required.
|
||||
<small class="field-error">
|
||||
<i class="pi pi-exclamation-circle"></i>
|
||||
Name is required
|
||||
</small>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
<label for="email" class="text-lg font-medium">Email</label>
|
||||
<div class="form-field">
|
||||
<label for="email" class="form-label">
|
||||
<i class="pi pi-envelope"></i>
|
||||
<span>Email Address</span>
|
||||
</label>
|
||||
<input
|
||||
pInputText
|
||||
id="email"
|
||||
name="email"
|
||||
type="email"
|
||||
required
|
||||
formControlName="email"
|
||||
placeholder="Enter your email"
|
||||
class="w-full md:w-[30rem]"
|
||||
placeholder="Enter your email address"
|
||||
class="form-input"
|
||||
autocomplete="email"
|
||||
/>
|
||||
@if (setupForm.get('email')?.invalid && setupForm.get('email')?.touched) {
|
||||
<small class="text-red-500">
|
||||
Valid email is required.
|
||||
<small class="field-error">
|
||||
<i class="pi pi-exclamation-circle"></i>
|
||||
Valid email is required
|
||||
</small>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
<label for="password" class="text-lg font-medium">Password</label>
|
||||
<div class="form-field">
|
||||
<label for="password" class="form-label">
|
||||
<i class="pi pi-lock"></i>
|
||||
<span>Password</span>
|
||||
</label>
|
||||
<input
|
||||
pInputText
|
||||
id="password"
|
||||
name="password"
|
||||
type="password"
|
||||
required
|
||||
formControlName="password"
|
||||
placeholder="Enter new password"
|
||||
class="w-full md:w-[30rem]"
|
||||
placeholder="Create a secure password"
|
||||
class="form-input"
|
||||
autocomplete="new-password"
|
||||
/>
|
||||
@if (setupForm.get('password')?.invalid && setupForm.get('password')?.touched) {
|
||||
<small class="text-red-500">
|
||||
Minimum 6 characters required.
|
||||
<small class="field-error">
|
||||
<i class="pi pi-exclamation-circle"></i>
|
||||
Minimum 6 characters required
|
||||
</small>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-3 mt-4">
|
||||
<p-button
|
||||
fluid
|
||||
type="submit"
|
||||
[label]="loading ? 'Creating…' : 'Create Admin Account'"
|
||||
[disabled]="loading || setupForm.invalid"
|
||||
icon="pi pi-user-plus"
|
||||
>
|
||||
</p-button>
|
||||
<p-button
|
||||
fluid
|
||||
type="submit"
|
||||
[label]="loading ? 'Creating Account...' : 'Create Admin Account'"
|
||||
[icon]="loading ? 'pi pi-spin pi-spinner' : 'pi pi-user-plus'"
|
||||
[disabled]="loading || setupForm.invalid"
|
||||
class="setup-button"
|
||||
/>
|
||||
|
||||
@if (error) {
|
||||
<p-message severity="error" text="{{ error }}"></p-message>
|
||||
}
|
||||
@if (success) {
|
||||
<p-message severity="success" text="Admin account created! Redirecting…"></p-message>
|
||||
}
|
||||
</div>
|
||||
@if (error) {
|
||||
<div class="message-container error-message">
|
||||
<p-message severity="error">{{ error }}</p-message>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (success) {
|
||||
<div class="message-container success-message">
|
||||
<p-message severity="success">Admin account created successfully! Redirecting...</p-message>
|
||||
</div>
|
||||
}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
@use '../../styles/auth-shared' as auth;
|
||||
|
||||
.setup-container {
|
||||
@include auth.auth-container;
|
||||
}
|
||||
|
||||
.setup-card-wrapper {
|
||||
@include auth.auth-card-wrapper(540px, -6rem);
|
||||
}
|
||||
|
||||
.setup-card-border {
|
||||
@include auth.auth-card-border;
|
||||
}
|
||||
|
||||
.setup-card {
|
||||
@include auth.auth-card;
|
||||
}
|
||||
|
||||
.setup-header {
|
||||
@include auth.auth-header;
|
||||
}
|
||||
|
||||
.logo-wrapper {
|
||||
@include auth.auth-logo;
|
||||
}
|
||||
|
||||
.logo-icon {
|
||||
@include auth.auth-logo-icon;
|
||||
}
|
||||
|
||||
.setup-title {
|
||||
@include auth.auth-title;
|
||||
}
|
||||
|
||||
.setup-subtitle {
|
||||
@include auth.auth-subtitle;
|
||||
}
|
||||
|
||||
.setup-form {
|
||||
@include auth.auth-form;
|
||||
}
|
||||
|
||||
.form-field {
|
||||
@include auth.form-field;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
@include auth.form-label;
|
||||
}
|
||||
|
||||
.form-input {
|
||||
@include auth.form-input;
|
||||
}
|
||||
|
||||
.field-error {
|
||||
@include auth.field-error;
|
||||
}
|
||||
|
||||
.setup-button {
|
||||
@include auth.auth-button;
|
||||
}
|
||||
|
||||
.message-container {
|
||||
@include auth.message-container;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
@include auth.error-message;
|
||||
}
|
||||
|
||||
.success-message {
|
||||
@include auth.success-message;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user