+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
diff --git a/src/main.js b/src/main.js
index 96c976a..3721951 100644
--- a/src/main.js
+++ b/src/main.js
@@ -821,14 +821,16 @@ function setStatus(text, type = 'default') {
// Show/hide settings
async function showSettings() {
- settingsPanel.style.display = 'block';
- chatView.style.display = 'none';
+ const overlay = document.getElementById('settings-overlay');
+ settingsPanel.classList.add('open');
+ overlay.classList.add('show');
await loadCharacterSettings();
}
function hideSettings() {
- settingsPanel.style.display = 'none';
- chatView.style.display = 'flex';
+ const overlay = document.getElementById('settings-overlay');
+ settingsPanel.classList.remove('open');
+ overlay.classList.remove('show');
}
// Tab switching
@@ -1015,6 +1017,7 @@ function handleAvatarRemove() {
function setupAppControls() {
document.getElementById('settings-btn').addEventListener('click', showSettings);
document.getElementById('close-settings-btn').addEventListener('click', hideSettings);
+ document.getElementById('settings-overlay').addEventListener('click', hideSettings);
document.getElementById('clear-btn').addEventListener('click', clearHistory);
characterSelect.addEventListener('change', handleCharacterSwitch);
newCharacterBtn.addEventListener('click', handleNewCharacter);
@@ -1028,6 +1031,14 @@ function setupAppControls() {
document.getElementById('remove-avatar-btn').addEventListener('click', handleAvatarRemove);
document.getElementById('import-character-btn').addEventListener('click', handleImportCharacter);
document.getElementById('export-character-btn').addEventListener('click', handleExportCharacter);
+
+ // Setup collapsible sections
+ document.querySelectorAll('.settings-section-header').forEach(header => {
+ header.addEventListener('click', () => {
+ const section = header.parentElement;
+ section.classList.toggle('collapsed');
+ });
+ });
}
// Keyboard shortcuts
diff --git a/src/styles.css b/src/styles.css
index 5cc08e9..29fc753 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -832,28 +832,56 @@ body {
}
}
-/* Settings Panel */
+/* Settings Panel - Slide-in Sidebar */
.settings-panel {
- position: absolute;
+ position: fixed;
+ top: 0;
+ right: -500px;
+ width: 500px;
+ height: 100vh;
+ background: var(--bg-primary);
+ border-left: 1px solid var(--border);
+ box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
+ z-index: 1000;
+ overflow-y: auto;
+ padding: 20px;
+ transition: right 0.3s ease;
+}
+
+.settings-panel.open {
+ right: 0;
+}
+
+/* Settings overlay backdrop */
+.settings-overlay {
+ position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
- background: var(--bg-primary);
- z-index: 1000;
- overflow-y: auto;
- padding: 60px 20px 20px;
+ background: rgba(0, 0, 0, 0.5);
+ z-index: 999;
+ opacity: 0;
+ pointer-events: none;
+ transition: opacity 0.3s ease;
+}
+
+.settings-overlay.show {
+ opacity: 1;
+ pointer-events: auto;
}
.settings-header {
display: flex;
justify-content: space-between;
align-items: center;
- margin-bottom: 20px;
+ margin-bottom: 24px;
+ padding-bottom: 16px;
+ border-bottom: 1px solid var(--border);
}
.settings-header h2 {
- font-size: 20px;
+ font-size: 24px;
font-weight: 600;
color: var(--text-primary);
margin: 0;
@@ -863,9 +891,6 @@ body {
display: flex;
gap: 8px;
margin-bottom: 24px;
- max-width: 400px;
- margin-left: auto;
- margin-right: auto;
}
.tab-btn {
@@ -902,13 +927,68 @@ body {
}
.settings-form {
- max-width: 400px;
- margin: 0 auto;
display: flex;
flex-direction: column;
gap: 20px;
}
+/* Collapsible sections */
+.settings-section {
+ border: 1px solid var(--border);
+ border-radius: 8px;
+ overflow: hidden;
+ background: var(--bg-secondary);
+}
+
+.settings-section-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 12px 16px;
+ background: var(--bg-tertiary);
+ cursor: pointer;
+ user-select: none;
+ transition: background 0.2s ease;
+}
+
+.settings-section-header:hover {
+ background: var(--border);
+}
+
+.settings-section-title {
+ font-size: 14px;
+ font-weight: 600;
+ color: var(--text-primary);
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+
+.settings-section-icon {
+ width: 16px;
+ height: 16px;
+ transition: transform 0.2s ease;
+}
+
+.settings-section.collapsed .settings-section-icon {
+ transform: rotate(-90deg);
+}
+
+.settings-section-content {
+ padding: 16px;
+ display: flex;
+ flex-direction: column;
+ gap: 16px;
+ max-height: 2000px;
+ overflow: hidden;
+ transition: max-height 0.3s ease, padding 0.3s ease;
+}
+
+.settings-section.collapsed .settings-section-content {
+ max-height: 0;
+ padding: 0 16px;
+}
+
.form-group {
display: flex;
flex-direction: column;
@@ -1095,6 +1175,11 @@ body {
}
.settings-panel {
- padding: 60px 16px 16px;
+ width: 100%;
+ right: -100%;
+ }
+
+ .settings-panel.open {
+ right: 0;
}
}