diff --git a/static/css/assistant.css b/static/css/assistant.css index 20ac518..0d5f490 100644 --- a/static/css/assistant.css +++ b/static/css/assistant.css @@ -1,7 +1,7 @@ /* ChatGPT Assistent Styles - Verbesserte Version */ #chatgpt-assistant { font-family: 'Inter', sans-serif; - bottom: 4.5rem; + bottom: 5.5rem; } #assistant-chat { @@ -11,7 +11,7 @@ border-radius: 0.75rem; overflow: hidden; max-width: calc(100vw - 2rem); - max-height: 80vh !important; + max-height: 75vh !important; } #assistant-toggle { @@ -182,12 +182,12 @@ body:not(.dark) .typing-indicator span { @media (max-width: 640px) { #assistant-chat { width: calc(100vw - 2rem) !important; - max-height: 70vh !important; + max-height: 65vh !important; } #chatgpt-assistant { right: 1rem; - bottom: 5rem; + bottom: 6rem; } } @@ -233,4 +233,15 @@ body.dark .assistant-message { background-color: rgba(31, 41, 55, 0.5) !important; color: #F9FAFB !important; border-left: 3px solid #8B5CF6; +} + +/* Chat-Assistent-Position im Footer-Bereich anpassen */ +.chat-assistant { + max-height: 75vh; + bottom: 1.5rem; +} + +.chat-assistant .chat-messages { + max-height: calc(75vh - 180px); + overflow-y: auto; } \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 0335dc4..d4bd0a0 100644 --- a/templates/base.html +++ b/templates/base.html @@ -285,6 +285,7 @@ this.darkMode = !this.darkMode; this.applyDarkMode(); + // Server über Änderung informieren fetch('/api/set_dark_mode', { method: 'POST', headers: { @@ -295,11 +296,10 @@ .then(response => response.json()) .then(data => { if (data.success) { + // Event auslösen für andere Komponenten document.dispatchEvent(new CustomEvent('darkModeToggled', { detail: { isDark: this.darkMode } })); - } else { - console.error('Fehler beim Speichern der Dark Mode-Einstellung:', data.error); } }) .catch(error => { @@ -365,13 +365,16 @@
{% if current_user.is_authenticated %} @@ -700,15 +703,34 @@ } window.MindMap.toggleDarkMode = function() { - const isDark = document.body.classList.contains('dark'); - applyDarkModeClasses(!isDark); + const isDark = document.documentElement.classList.contains('dark'); + const newIsDark = !isDark; + + // DOM aktualisieren + applyDarkModeClasses(newIsDark); + + // Alpine.js Status aktualisieren (falls verfügbar) + const appEl = document.querySelector('body'); + if (appEl && appEl.__x) { + appEl.__x.$data.darkMode = newIsDark; + } // Server aktualisieren fetch('/api/set_dark_mode', { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ darkMode: !isDark }) - }).catch(console.error); + body: JSON.stringify({ darkMode: newIsDark }) + }) + .then(response => response.json()) + .then(data => { + if (data.success) { + // Event für andere Komponenten auslösen + document.dispatchEvent(new CustomEvent('darkModeToggled', { + detail: { isDark: newIsDark } + })); + } + }) + .catch(console.error); }; // Initialisierung beim Laden diff --git a/templates/edit_mindmap.html b/templates/edit_mindmap.html new file mode 100644 index 0000000..e69de29