Редизайн страницы входа и перевод интерфейса на украинский (#5) #6

Merged
lauadmin merged 2 commits from feature/login-page-redesign into main 2026-09-25 13:46:26 +00:00
2 changed files with 247 additions and 40 deletions
Showing only changes of commit 47df3a78dc - Show all commits
+207 -28
View File
@@ -1,68 +1,230 @@
.login-page { .login-page {
--login-accent: #7c3aed;
--login-glass: rgba(255, 255, 255, 0.72);
--login-glass-border: rgba(255, 255, 255, 0.6);
--login-input-bg: rgba(255, 255, 255, 0.85);
position: relative;
min-height: 100svh; min-height: 100svh;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 24px; padding: 24px 16px;
overflow: hidden;
isolation: isolate;
background:
radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, 0.14), transparent 60%),
radial-gradient(900px 500px at 110% 110%, rgba(124, 58, 237, 0.14), transparent 60%),
var(--color-bg);
}
@media (prefers-color-scheme: dark) {
.login-page {
--login-accent: #a78bfa;
--login-glass: rgba(23, 26, 33, 0.7);
--login-glass-border: rgba(255, 255, 255, 0.08);
--login-input-bg: rgba(15, 17, 21, 0.7);
}
}
/* Декоративные размытые пятна на фоне */
.login-backdrop {
position: absolute;
inset: 0;
z-index: -1;
pointer-events: none;
}
.login-blob {
position: absolute;
border-radius: 50%;
filter: blur(70px);
opacity: 0.55;
animation: login-float 18s ease-in-out infinite alternate;
}
.login-blob--a {
width: 380px;
height: 380px;
top: -80px;
left: -60px;
background: var(--color-primary);
}
.login-blob--b {
width: 320px;
height: 320px;
bottom: -90px;
right: -40px;
background: var(--login-accent);
animation-delay: -6s;
}
.login-blob--c {
width: 220px;
height: 220px;
top: 55%;
left: 60%;
background: #06b6d4;
opacity: 0.3;
animation-delay: -12s;
}
@keyframes login-float {
from {
transform: translate3d(0, 0, 0) scale(1);
}
to {
transform: translate3d(40px, 30px, 0) scale(1.1);
}
}
@media (prefers-reduced-motion: reduce) {
.login-blob {
animation: none;
}
} }
.login-card { .login-card {
width: 100%; width: 100%;
max-width: 380px; max-width: 400px;
background: var(--color-surface); background: var(--login-glass);
border: 1px solid var(--color-border); border: 1px solid var(--login-glass-border);
border-radius: 12px; border-radius: 20px;
box-shadow: var(--shadow-card); box-shadow:
padding: 32px; 0 20px 50px -12px rgba(16, 24, 40, 0.25),
0 1px 2px rgba(16, 24, 40, 0.06);
backdrop-filter: blur(18px) saturate(140%);
-webkit-backdrop-filter: blur(18px) saturate(140%);
padding: 40px 32px 32px;
animation: login-enter 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes login-enter {
from {
opacity: 0;
transform: translateY(12px) scale(0.98);
}
}
@media (max-width: 420px) {
.login-card {
padding: 32px 20px 24px;
border-radius: 16px;
}
} }
.login-header { .login-header {
margin-bottom: 24px; margin-bottom: 28px;
text-align: center; text-align: center;
} }
.login-logo {
width: 56px;
height: 56px;
margin: 0 auto 16px;
display: grid;
place-items: center;
border-radius: 16px;
color: #fff;
background: linear-gradient(135deg, var(--color-primary), var(--login-accent));
box-shadow: 0 10px 24px -8px var(--color-primary);
}
.login-header h1 { .login-header h1 {
font-size: 22px; font-size: 26px;
margin-bottom: 4px; font-weight: 700;
letter-spacing: -0.02em;
margin-bottom: 6px;
background: linear-gradient(135deg, var(--color-text) 30%, var(--color-primary));
-webkit-background-clip: text;
background-clip: text;
color: transparent;
} }
.login-header p { .login-header p {
color: var(--color-text-muted); color: var(--color-text-muted);
font-size: 14px; font-size: 15px;
} }
.login-field { .login-field {
margin-bottom: 16px; margin-bottom: 18px;
} }
.login-field label { .login-field label {
display: block; display: block;
font-size: 13px; font-size: 13px;
font-weight: 500; font-weight: 600;
margin-bottom: 6px; margin-bottom: 8px;
color: var(--color-text); color: var(--color-text);
} }
.login-field input { .login-field input {
width: 100%; width: 100%;
padding: 10px 12px; height: 46px;
padding: 0 14px;
border: 1px solid var(--color-border); border: 1px solid var(--color-border);
border-radius: 8px; border-radius: 12px;
background: var(--color-bg); background: var(--login-input-bg);
color: var(--color-text); color: var(--color-text);
font-size: 14px; font-size: 15px;
outline: none; outline: none;
transition: border-color 0.15s ease; transition:
border-color 0.15s ease,
box-shadow 0.15s ease;
}
.login-field input::placeholder {
color: var(--color-text-muted);
opacity: 0.7;
} }
.login-field input:focus { .login-field input:focus {
border-color: var(--color-primary); border-color: var(--color-primary);
box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 18%, transparent);
} }
.login-field input:disabled { .login-field input:disabled {
opacity: 0.6; opacity: 0.6;
} }
.login-password {
position: relative;
}
.login-password input {
padding-right: 46px;
}
.login-toggle {
position: absolute;
top: 50%;
right: 6px;
transform: translateY(-50%);
width: 34px;
height: 34px;
display: grid;
place-items: center;
border: none;
border-radius: 8px;
background: transparent;
color: var(--color-text-muted);
cursor: pointer;
transition:
color 0.15s ease,
background-color 0.15s ease;
}
.login-toggle:hover {
color: var(--color-text);
background: color-mix(in srgb, var(--color-text) 8%, transparent);
}
.login-toggle:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 1px;
}
.login-error { .login-error {
display: flex; display: flex;
gap: 8px; gap: 8px;
@@ -70,23 +232,29 @@
background: var(--color-danger-bg); background: var(--color-danger-bg);
border: 1px solid var(--color-danger-border); border: 1px solid var(--color-danger-border);
color: var(--color-danger); color: var(--color-danger);
border-radius: 8px; border-radius: 12px;
padding: 10px 12px; padding: 10px 14px;
font-size: 13px; font-size: 13px;
margin-bottom: 16px; margin-bottom: 18px;
} }
.login-submit { .login-submit {
width: 100%; width: 100%;
padding: 11px 16px; height: 48px;
margin-top: 8px;
padding: 0 16px;
border: none; border: none;
border-radius: 8px; border-radius: 12px;
background: var(--color-primary); background: linear-gradient(135deg, var(--color-primary), var(--login-accent));
color: #fff; color: #fff;
font-size: 14px; font-size: 15px;
font-weight: 600; font-weight: 600;
cursor: pointer; cursor: pointer;
transition: background-color 0.15s ease; box-shadow: 0 10px 24px -10px var(--color-primary);
transition:
transform 0.15s ease,
box-shadow 0.15s ease,
filter 0.15s ease;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@@ -94,7 +262,18 @@
} }
.login-submit:hover:not(:disabled) { .login-submit:hover:not(:disabled) {
background: var(--color-primary-hover); transform: translateY(-1px);
filter: brightness(1.06);
box-shadow: 0 14px 28px -10px var(--color-primary);
}
.login-submit:active:not(:disabled) {
transform: translateY(0);
}
.login-submit:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
} }
.login-submit:disabled { .login-submit:disabled {
+31 -3
View File
@@ -19,6 +19,7 @@ export function LoginPage() {
const [email, setEmail] = useState('') const [email, setEmail] = useState('')
const [password, setPassword] = useState('') const [password, setPassword] = useState('')
const [showPassword, setShowPassword] = useState(false)
const [submitting, setSubmitting] = useState(false) const [submitting, setSubmitting] = useState(false)
const [formError, setFormError] = useState<string | null>(null) const [formError, setFormError] = useState<string | null>(null)
@@ -45,10 +46,22 @@ export function LoginPage() {
return ( return (
<div className="login-page"> <div className="login-page">
<div className="login-backdrop" aria-hidden="true">
<span className="login-blob login-blob--a" />
<span className="login-blob login-blob--b" />
<span className="login-blob login-blob--c" />
</div>
<div className="login-card"> <div className="login-card">
<div className="login-header"> <div className="login-header">
<h1>lux_fiscal</h1> <div className="login-logo" aria-hidden="true">
<p>Вход в систему фискализации заказов</p> <svg viewBox="0 0 24 24" width="26" height="26" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<path d="M12 3l7 4v5c0 4.5-3 8-7 9-4-1-7-4.5-7-9V7l7-4z" />
<path d="M9 12l2 2 4-4" />
</svg>
</div>
<h1>Assistant System</h1>
<p>Вхід у систему</p>
</div> </div>
<form onSubmit={handleSubmit} noValidate> <form onSubmit={handleSubmit} noValidate>
@@ -74,9 +87,10 @@ export function LoginPage() {
<div className="login-field"> <div className="login-field">
<label htmlFor={passwordId}>Пароль</label> <label htmlFor={passwordId}>Пароль</label>
<div className="login-password">
<input <input
id={passwordId} id={passwordId}
type="password" type={showPassword ? 'text' : 'password'}
autoComplete="current-password" autoComplete="current-password"
required required
value={password} value={password}
@@ -84,6 +98,20 @@ export function LoginPage() {
onChange={(e) => setPassword(e.target.value)} onChange={(e) => setPassword(e.target.value)}
placeholder="••••••••" placeholder="••••••••"
/> />
<button
type="button"
className="login-toggle"
onClick={() => setShowPassword((v) => !v)}
aria-label={showPassword ? 'Скрыть пароль' : 'Показать пароль'}
aria-pressed={showPassword}
>
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z" />
<circle cx="12" cy="12" r="3" />
{showPassword && <path d="M3 3l18 18" />}
</svg>
</button>
</div>
</div> </div>
<button type="submit" className="login-submit" disabled={submitting}> <button type="submit" className="login-submit" disabled={submitting}>