From e76f18b0a83614e472d11db3ce077e29661a1a92 Mon Sep 17 00:00:00 2001 From: Kato Date: Fri, 4 Sep 2026 20:15:30 +0000 Subject: [PATCH] Move language toggle, profile and logout into hamburger menu next to brand --- css/styles.css | 25 ++++++++++++++++++++++++- index.html | 35 +++++++++++++++++++++-------------- js/main.js | 30 +++++++++++++++++++++++++++--- 3 files changed, 72 insertions(+), 18 deletions(-) diff --git a/css/styles.css b/css/styles.css index 855d0c3..ad78609 100644 --- a/css/styles.css +++ b/css/styles.css @@ -24,7 +24,30 @@ a:hover { text-decoration: underline; } align-items: center; padding: 24px 0; } -.brand { font-size: 1.75rem; font-weight: 800; } +.brand { font-size: 1.75rem; font-weight: 800; display: flex; align-items: center; gap: 12px; position: relative; } +.hamburger-btn { + background: none; border: none; cursor: pointer; padding: 4px; + display: flex; align-items: center; justify-content: center; +} +.hamburger-btn svg { width: 24px; height: 24px; fill: var(--black); } +.hamburger-menu { + position: absolute; top: 100%; right: 0; + background: var(--white); border: 1px solid var(--gray2); + border-radius: 8px; padding: 16px; min-width: 200px; + box-shadow: 0 4px 12px rgba(0,0,0,.1); z-index: 100; + display: flex; flex-direction: column; gap: 12px; +} +.hamburger-menu.hidden { display: none; } +.menu-section { display: flex; flex-direction: column; gap: 8px; } +.menu-btn { + padding: 8px 12px; font-size: .85rem; border-radius: 6px; + display: flex; align-items: center; gap: 6px; + background: none; border: none; cursor: pointer; + font-weight: 600; color: var(--black); text-align: left; + width: 100%; +} +.menu-btn:hover { background: var(--gray1); } +.menu-btn svg { width: 16px; height: 16px; fill: currentColor; } .lang-select { display: flex; gap: 8px; background: var(--gray1); padding: 4px; border-radius: 8px; diff --git a/index.html b/index.html index ec82a97..1c99e43 100644 --- a/index.html +++ b/index.html @@ -14,20 +14,27 @@
- Paraguay LLC & SRL – Austausch & Community -
- - -
-
diff --git a/js/main.js b/js/main.js index 54797c8..8fe1c0d 100644 --- a/js/main.js +++ b/js/main.js @@ -4,6 +4,28 @@ document.addEventListener('DOMContentLoaded', () => { loadUsers(); loadWiki(); } + + // Hamburger menu toggle + const hamburger = document.getElementById('hamburger-btn'); + const menu = document.getElementById('hamburger-menu'); + if (hamburger && menu) { + hamburger.addEventListener('click', (e) => { + e.stopPropagation(); + menu.classList.toggle('hidden'); + }); + // Close menu when clicking outside + document.addEventListener('click', (e) => { + if (!menu.contains(e.target) && e.target !== hamburger && !hamburger.contains(e.target)) { + menu.classList.add('hidden'); + } + }); + // Close menu on Escape + document.addEventListener('keydown', (e) => { + if (e.key === 'Escape') { + menu.classList.add('hidden'); + } + }); + } }); function getCookie(name) { @@ -44,20 +66,21 @@ function checkSession() { const login = document.getElementById('login-panel'); const newsletter = document.getElementById('newsletter-panel'); const notebook = document.getElementById('notebook-panel'); + const menuActions = document.getElementById('menu-user-actions'); if (sessionid) { // User is logged in via n8n cookie if (intro) intro.classList.add('hidden'); if (news) news.classList.add('hidden'); if (login) login.classList.add('hidden'); if (notebook) notebook.classList.remove('hidden'); - document.querySelectorAll('.user-actions').forEach(el => el.classList.remove('hidden')); + if (menuActions) menuActions.classList.remove('hidden'); if (newsletter) newsletter.classList.remove('hidden'); } else { // User is not logged in if (notebook) notebook.classList.add('hidden'); if (login) login.classList.remove('hidden'); if (newsletter) newsletter.classList.remove('hidden'); - document.querySelectorAll('.user-actions').forEach(el => el.classList.add('hidden')); + if (menuActions) menuActions.classList.add('hidden'); } } @@ -190,7 +213,8 @@ async function submitLoginData() { document.getElementById('profile-username').value = document.getElementById('telegram-user').value; document.getElementById('profile-name').value = document.getElementById('full-name').value; document.getElementById('profile-llc').value = document.getElementById('llc-name').value; - document.querySelectorAll('.user-actions').forEach(el => el.classList.remove('hidden')); + const menuActions = document.getElementById('menu-user-actions'); + if (menuActions) menuActions.classList.remove('hidden'); alert('Erfolgreich angemeldet! Willkommen!'); } else { alert('Fehler bei der Anmeldung.');