Новый правки в компоненты
This commit is contained in:
parent
ae08bcdcb7
commit
c3ff6bc17b
1 changed files with 28 additions and 3 deletions
|
|
@ -166,13 +166,13 @@ const error = Astro.url.searchParams.get('error');
|
|||
}
|
||||
|
||||
submitBtn.disabled = true;
|
||||
submitBtn.textContent = 'Сохранение...';
|
||||
submitBtn.classList.add('loading');
|
||||
|
||||
try {
|
||||
const response = await fetch('/api/auth/confirm-password-reset', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ token, password, passwordConfirm }),
|
||||
body: JSON.stringify({ token, password, passwordConfirm: confirmPassword }),
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
|
|
@ -188,7 +188,7 @@ const error = Astro.url.searchParams.get('error');
|
|||
if (errorEl) errorEl.textContent = 'Ошибка соединения';
|
||||
} finally {
|
||||
submitBtn.disabled = false;
|
||||
submitBtn.textContent = 'Сохранить пароль';
|
||||
submitBtn.classList.remove('loading');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -367,6 +367,31 @@ const error = Astro.url.searchParams.get('error');
|
|||
box-shadow: 0 8px 20px rgba(206, 159, 64, 0.4);
|
||||
}
|
||||
|
||||
.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); }
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue