Logout-Button in Navigation

This commit is contained in:
Simona Oswald 2026-04-20 22:18:14 +02:00
parent 28e1647749
commit 540754d7d0
8 changed files with 39 additions and 45 deletions

View File

@ -14,12 +14,6 @@
box-sizing: border-box; box-sizing: border-box;
} }
.site-header {
background: var(--color-bg);
border-top: 2px solid #232323;
border-bottom: 1px solid var(--color-border);
}
.event-create-page { .event-create-page {
width: min(100% - 2rem, var(--max-width)); width: min(100% - 2rem, var(--max-width));
margin: 0 auto; margin: 0 auto;
@ -40,7 +34,7 @@
.step { .step {
display: none; display: none;
padding: var(--space-4) 0 var(--space-7); padding: var(--space-4) 0 var(--space-4);
} }
.submission-success { .submission-success {
@ -242,7 +236,7 @@ textarea:focus {
} }
.option-card--invalid { .option-card--invalid {
border-color: var(--tomato) !important; border-color: var(--error) !important;
box-shadow: 0 0 0 2px rgba(212, 75, 36, 0.14); box-shadow: 0 0 0 2px rgba(212, 75, 36, 0.14);
} }
@ -339,9 +333,10 @@ textarea:focus {
} }
.error-message { .error-message {
order: -1; /* nach oben verschieben */ margin: 0;
text-align: center; text-align: center;
width: 100%; width: 100%;
} }
.progress-wrap { .progress-wrap {
@ -393,25 +388,6 @@ textarea:focus {
gap: var(--space-4); gap: var(--space-4);
} }
.error-message {
min-height: 1.5rem;
margin: 0;
color: var(--color-error);
font-size: 0.95rem;
}
/*.button {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0.9rem 1.35rem;
border-radius: var(--radius-pill);
border: 1px solid var(--color-border);
background: transparent;
color: var(--color-text);
cursor: pointer;
}*/
.button--ghost:hover { .button--ghost:hover {
background: rgba(0, 0, 0, 0.03); background: rgba(0, 0, 0, 0.03);
} }

View File

@ -322,7 +322,6 @@
font-size: 13px; font-size: 13px;
font-weight: 600; font-weight: 600;
letter-spacing: var(--ls-la); letter-spacing: var(--ls-la);
text-transform: uppercase;
} }
.empty-state h3 { .empty-state h3 {

View File

@ -139,8 +139,6 @@ button[type="submit"]:active {
/* --- Hints & errors --- */ /* --- Hints & errors --- */
.error-message { .error-message {
color: var(--error);
font-size: 0.8rem;
margin-top: 5px; margin-top: 5px;
display: none; display: none;
} }

View File

@ -162,7 +162,6 @@
font-size: 0.72rem; font-size: 0.72rem;
font-weight: 700; font-weight: 700;
letter-spacing: var(--ls-la); letter-spacing: var(--ls-la);
text-transform: uppercase;
} }
.profile-event-address { .profile-event-address {
@ -262,7 +261,6 @@
font-size: 0.8rem; font-size: 0.8rem;
font-weight: 600; font-weight: 600;
letter-spacing: var(--ls-la); letter-spacing: var(--ls-la);
text-transform: uppercase;
} }
.profile-empty-state h3 { .profile-empty-state h3 {

View File

@ -30,6 +30,7 @@
--blue: #3489DA; --blue: #3489DA;
--blue-dark: #1D70BF; --blue-dark: #1D70BF;
--error: #FF3B30; --error: #FF3B30;
--error-text: #d91200;
--font-main: 'Jost', sans-serif; --font-main: 'Jost', sans-serif;
--font-size-base: 1rem; --font-size-base: 1rem;
@ -146,7 +147,7 @@ p {
} }
.error-message { .error-message {
color: var(--error); color: var(--error-text);
font-size: 1rem; font-size: 1rem;
} }
@ -379,20 +380,25 @@ p {
.button-small { .button-small {
background: var(--olive); background: var(--olive);
color: var(--butter-light); color: var(--butter-light);
border: none;
font-size: 1.125rem; font-size: 1.125rem;
font-weight: 400;
letter-spacing: var(--ls-sm); letter-spacing: var(--ls-sm);
font-family: var(--font-main);
font-weight: 400;
line-height: 1; line-height: 1;
border-radius: var(--radius-pill);
padding: 10px var(--space-3);
text-decoration: none; text-decoration: none;
cursor: pointer;
padding: var(--space-1) var(--space-4);
border-radius: var(--radius-md);
} }
§
.button-small:hover, .button-small:active, .button-small:hover, .button-small:active,
.button-small:focus-visible { .button-small:focus-visible {
background: var(--olive-dark); background: var(--olive-dark);
color: var(--butter-light); }
.logout-button {
margin-right: -1.25rem;
} }
/* Auth-Links in ausgeloggter Navigation: klarer Aktiv-/Default-Zustand. */ /* Auth-Links in ausgeloggter Navigation: klarer Aktiv-/Default-Zustand. */

View File

@ -386,9 +386,9 @@ function buildMenuItems(value) {
*/ */
function mapEventTypeToCategory(value) { function mapEventTypeToCategory(value) {
const categoryMap = { const categoryMap = {
Brunch: "BRUNCH", Brunch: "Brunch",
Lunch: "LUNCH", Lunch: "Lunch",
Dinner: "DINNER", Dinner: "Dinner",
"Kaffee + Kuchen": "COFFEE" "Kaffee + Kuchen": "COFFEE"
}; };

View File

@ -25,6 +25,12 @@ document.addEventListener('DOMContentLoaded', () => {
} }
} }
// Logout-Funktion
window.logout = function() {
localStorage.removeItem(CURRENT_USER_KEY);
window.location.href = 'index.html';
};
// Baut die Navigation für ausgeloggte Besucher. // Baut die Navigation für ausgeloggte Besucher.
function buildLoggedOutNavigation() { function buildLoggedOutNavigation() {
const loginIsActive = currentPage === 'login.html'; const loginIsActive = currentPage === 'login.html';
@ -85,6 +91,13 @@ document.addEventListener('DOMContentLoaded', () => {
> >
Event erstellen Event erstellen
</a> </a>
<button
class="button-small logout-button"
onclick="logout()"
aria-label="Logout"
>
Logout
</button>
<a <a
class="profile-pill" class="profile-pill"
href="my_profil.html" href="my_profil.html"

View File

@ -19,7 +19,12 @@
<img src="assets/logo_invite.svg" alt="Invite Logo"> <img src="assets/logo_invite.svg" alt="Invite Logo">
</a> </a>
<nav class="nav-tab-links" aria-label="Hauptnavigation"> <nav class="nav-tab-links" aria-label="Hauptnavigation">
<a class="button-small" href="login.html" aria-label="Login">Login</a> <button id="logout-button" class="button-small profile-logout" type="button">
Logout
</button>
<a class="button-small" href="login.html" aria-label="Login">
Login
</a>
</nav> </nav>
</div> </div>
</header> </header>
@ -31,7 +36,6 @@
<h1 id="profile-headline">Mein Profil</h1> <h1 id="profile-headline">Mein Profil</h1>
<p id="profile-subline" class="profile-subline">Hier findest du deine Events, deine Anmeldungen und kannst deine Profildaten verwalten.</p> <p id="profile-subline" class="profile-subline">Hier findest du deine Events, deine Anmeldungen und kannst deine Profildaten verwalten.</p>
</div> </div>
<button id="logout-button" class="button-small profile-logout" type="button">Logout</button>
</section> </section>
<section id="logged-out-state" class="profile-panel hidden" aria-live="polite"> <section id="logged-out-state" class="profile-panel hidden" aria-live="polite">