Новый правки компоентов
This commit is contained in:
parent
abcb294a7c
commit
ae08bcdcb7
2 changed files with 51 additions and 11 deletions
|
|
@ -70,7 +70,7 @@ import { SITE_URL } from '@constants';
|
||||||
if (!email) return;
|
if (!email) return;
|
||||||
|
|
||||||
submitBtn.disabled = true;
|
submitBtn.disabled = true;
|
||||||
submitBtn.textContent = 'Отправка...';
|
submitBtn.classList.add('loading');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/api/auth/request-password-reset', {
|
const response = await fetch('/api/auth/request-password-reset', {
|
||||||
|
|
@ -87,15 +87,18 @@ import { SITE_URL } from '@constants';
|
||||||
} else {
|
} else {
|
||||||
const errorEl = document.getElementById('email-error');
|
const errorEl = document.getElementById('email-error');
|
||||||
if (errorEl) errorEl.textContent = data.error || 'Ошибка';
|
if (errorEl) errorEl.textContent = data.error || 'Ошибка';
|
||||||
|
submitBtn.disabled = false;
|
||||||
|
submitBtn.classList.remove('loading');
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (formError) {
|
if (formError) {
|
||||||
formError.textContent = 'Ошибка соединения';
|
formError.textContent = 'Ошибка соединения';
|
||||||
formError.classList.remove('hidden');
|
formError.classList.remove('hidden');
|
||||||
}
|
}
|
||||||
|
submitBtn.disabled = false;
|
||||||
|
submitBtn.classList.remove('loading');
|
||||||
} finally {
|
} finally {
|
||||||
submitBtn.disabled = false;
|
submitBtn.disabled = false;
|
||||||
submitBtn.textContent = 'Отправить ссылку';
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -197,6 +200,31 @@ import { SITE_URL } from '@constants';
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn-submit.loading {
|
||||||
|
position: relative;
|
||||||
|
color: transparent !important;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-submit.loading::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -10px;
|
||||||
|
margin-top: -10px;
|
||||||
|
border: 2px solid #ffffff;
|
||||||
|
border-radius: 50%;
|
||||||
|
border-top-color: transparent;
|
||||||
|
animation: spin 0.8s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
to { transform: rotate(360deg); }
|
||||||
|
}
|
||||||
|
|
||||||
.auth-messages {
|
.auth-messages {
|
||||||
margin-top: 1.5rem;
|
margin-top: 1.5rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
|
||||||
|
|
@ -57,15 +57,27 @@ const error = Astro.url.searchParams.get('error');
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="confirmPassword">Подтвердите пароль</label>
|
<label for="confirmPassword">Подтвердите пароль</label>
|
||||||
<input
|
<div class="password-wrapper">
|
||||||
type="password"
|
<input
|
||||||
id="confirmPassword"
|
type="password"
|
||||||
name="confirmPassword"
|
id="confirmPassword"
|
||||||
placeholder="••••••••"
|
name="confirmPassword"
|
||||||
required
|
placeholder="••••••••"
|
||||||
minlength="8"
|
required
|
||||||
maxlength="12"
|
minlength="8"
|
||||||
/>
|
maxlength="12"
|
||||||
|
/>
|
||||||
|
<button type="button" class="toggle-password" data-target="confirmPassword">
|
||||||
|
<svg class="eye-open" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
|
||||||
|
<circle cx="12" cy="12" r="3"></circle>
|
||||||
|
</svg>
|
||||||
|
<svg class="eye-closed" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path>
|
||||||
|
<line x1="1" y1="1" x2="23" y2="23"></line>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<span class="error-message" id="confirm-error"></span>
|
<span class="error-message" id="confirm-error"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue