Centered settings modal

This commit is contained in:
2026-01-08 23:19:44 -05:00
parent 83a1ba393a
commit 61e3bd69ff
2 changed files with 19 additions and 5 deletions

View File

@@ -2405,14 +2405,16 @@ body.dark-mode select option {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100vw;
height: 100%; height: 100vh;
z-index: 10000; z-index: 10000;
background: rgba(0, 0, 0, 0.85); background: rgba(0, 0, 0, 0.85);
backdrop-filter: blur(5px); backdrop-filter: blur(5px);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 1rem;
overflow-y: auto;
} }
.settings-content { .settings-content {
@@ -2421,12 +2423,14 @@ body.dark-mode select option {
border: 2px solid var(--terminal-green); border: 2px solid var(--terminal-green);
box-shadow: 0 0 30px rgba(0, 255, 65, 0.5); box-shadow: 0 0 30px rgba(0, 255, 65, 0.5);
max-width: 800px; max-width: 800px;
width: 90%; width: 100%;
max-height: 90vh; max-height: 85vh;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden;
font-family: var(--font-mono); font-family: var(--font-mono);
padding: 2rem; padding: 2rem;
animation: settingsSlideIn 0.3s ease; animation: settingsSlideIn 0.3s ease;
margin: auto;
} }
@keyframes settingsSlideIn { @keyframes settingsSlideIn {
@@ -2678,3 +2682,11 @@ body.dark-mode select option {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
} }
/* Prevent body scroll when modal is open */
body.modal-open {
overflow: hidden;
position: fixed;
width: 100%;
height: 100%;
}

View File

@@ -110,7 +110,8 @@ async function saveSettings() {
function openSettingsModal() { function openSettingsModal() {
const modal = document.getElementById('settingsModal'); const modal = document.getElementById('settingsModal');
if (modal) { if (modal) {
modal.style.display = 'block'; modal.style.display = 'flex';
document.body.classList.add('modal-open');
loadUserPreferences(); loadUserPreferences();
} }
} }
@@ -119,6 +120,7 @@ function closeSettingsModal() {
const modal = document.getElementById('settingsModal'); const modal = document.getElementById('settingsModal');
if (modal) { if (modal) {
modal.style.display = 'none'; modal.style.display = 'none';
document.body.classList.remove('modal-open');
} }
} }