Animate the local backup password fields when protection is toggled

This commit is contained in:
Sucukdeluxe committed 2026-09-26 11:38:13 +02:00
1 parent 0a463694a1
commit 6c82f8c0a9
2 files changed
+33 -5

No files matched your search

+8 -3
View File
@@ -6808,7 +6808,8 @@ function renderSettings() {
</span>
<input type="checkbox" id="protectLocalBackupInput">
</label>
<div class="local-backup-password-fields" id="localBackupPasswordFields" hidden>
<div class="local-backup-password-collapse" id="localBackupPasswordFields" aria-hidden="true" inert>
<div class="local-backup-password-fields">
<label class="local-backup-field" for="localBackupPasswordInput">
<span>Passwort</span>
<input type="password" class="key-input" id="localBackupPasswordInput" minlength="8" maxlength="1024" autocomplete="new-password" placeholder="Mindestens 8 Zeichen">
@@ -6818,6 +6819,7 @@ function renderSettings() {
<input type="password" class="key-input" id="localBackupPasswordConfirmInput" minlength="8" maxlength="1024" autocomplete="new-password" placeholder="Passwort erneut eingeben">
</label>
</div>
</div>
<footer class="online-backup-footer backup-file-actions">
<button class="btn btn-secondary" id="importBackupBtn" data-settings-search-entry data-settings-search-section="Lokales Datei-Backup" data-settings-search-label="Datei importieren">Datei importieren</button>
<button class="btn btn-primary" id="exportBackupBtn" data-settings-search-entry data-settings-search-section="Lokales Datei-Backup" data-settings-search-label="Datei exportieren">Datei exportieren</button>
@@ -7256,8 +7258,11 @@ function renderSettings() {
document.getElementById('protectLocalBackupInput').addEventListener('change', (event) => {
const fields = document.getElementById('localBackupPasswordFields');
if (!fields) return;
fields.hidden = !event.target.checked;
if (event.target.checked) document.getElementById('localBackupPasswordInput')?.focus();
const open = event.target.checked;
fields.classList.toggle('is-open', open);
fields.setAttribute('aria-hidden', open ? 'false' : 'true');
fields.inert = !open;
if (open) document.getElementById('localBackupPasswordInput')?.focus();
});
document.getElementById('createOnlineBackupBtn').addEventListener('click', () => doOnlineBackupCreate());
renderManagedOnlineBackups();
+25 -2
View File
@@ -2552,10 +2552,31 @@ select.hs-input { max-width: none; width: auto; min-width: 140px; }
cursor: pointer;
}
.local-backup-password-collapse {
display: grid;
align-self: start;
grid-template-rows: 0fr;
margin-top: -14px;
opacity: 0;
visibility: hidden;
transition: grid-template-rows 240ms cubic-bezier(.2, .8, .2, 1), margin-top 240ms cubic-bezier(.2, .8, .2, 1), opacity 180ms ease, visibility 0s linear 240ms;
}
.local-backup-password-collapse.is-open {
grid-template-rows: 1fr;
margin-top: 0;
opacity: 1;
visibility: visible;
transition-delay: 0s;
}
.local-backup-password-fields {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px;
min-height: 0;
overflow: clip;
overflow-clip-margin: 4px;
}
.local-backup-field {
@@ -2574,8 +2595,10 @@ select.hs-input { max-width: none; width: auto; min-width: 140px; }
font-size: 14px;
}
.local-backup-password-fields[hidden] {
display: none;
@media (prefers-reduced-motion: reduce) {
.local-backup-password-collapse {
transition: none;
}
}
.upload-speed-sparkline {