added sidebar to pc version again

This commit is contained in:
2025-05-08 16:38:15 +02:00
parent d4a6948762
commit d0676e2051
6 changed files with 22 additions and 9 deletions

View File

@@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<link rel="icon" href="https://raw.githubusercontent.com/MaukiNet/.github/main/assets/4542221e59746b200f7d3d2c96cf9210.png"> <link rel="icon" href="https://www.hwg-wadern.de/fileadmin/hwg/lay/favicons/favicon-96x96.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head> </head>
<body> <body>

View File

@@ -20,7 +20,7 @@ export default {
<div class="md:flex md:justify-between"> <div class="md:flex md:justify-between">
<div class="mb-6 md:mb-0"> <div class="mb-6 md:mb-0">
<a href="https://coasterdb.miaurizius.de" class="flex items-center"> <a href="https://coasterdb.miaurizius.de" class="flex items-center">
<img src="https://raw.githubusercontent.com/MaukiNet/.github/main/assets/4542221e59746b200f7d3d2c96cf9210.png" class="mr-3 h-8 rounded-full" alt="Mauki Logo" /> <img src="https://www.hwg-wadern.de/fileadmin/hwg/lay/favicons/favicon-96x96.png" class="mr-3 h-8 rounded-full" alt="Mauki Logo" />
<span class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">CoasterDB</span> <span class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">CoasterDB</span>
</a> </a>
</div> </div>

View File

@@ -14,7 +14,7 @@ export default {
<nav class="bg-white border-gray-200 px-4 lg:px-6 py-2.5 dark:bg-gray-800"> <nav class="bg-white border-gray-200 px-4 lg:px-6 py-2.5 dark:bg-gray-800">
<div class="flex flex-wrap justify-between items-center mx-auto max-w-screen-xl"> <div class="flex flex-wrap justify-between items-center mx-auto max-w-screen-xl">
<a href="/" class="flex items-center"> <a href="/" class="flex items-center">
<img src="https://raw.githubusercontent.com/MaukiNet/.github/main/assets/4542221e59746b200f7d3d2c96cf9210.png" class="mr-3 h-6 sm:h-9 rounded-full" alt="MaukiLogo" /> <img src="https://www.hwg-wadern.de/fileadmin/hwg/lay/favicons/favicon-96x96.png" class="mr-3 h-6 sm:h-9 rounded-full" alt="MaukiLogo" />
<span class="self-center text-xl font-semibold whitespace-nowrap dark:text-white">CoasterDB</span> <span class="self-center text-xl font-semibold whitespace-nowrap dark:text-white">CoasterDB</span>
</a> </a>
<div class="flex items-center lg:order-2"> <div class="flex items-center lg:order-2">

View File

@@ -25,7 +25,7 @@ export default {
</button> </button>
<a href="/" class="flex items-center justify-between mr-4"> <a href="/" class="flex items-center justify-between mr-4">
<img <img
src="https://raw.githubusercontent.com/MaukiNet/.github/main/assets/4542221e59746b200f7d3d2c96cf9210.png" src="https://www.hwg-wadern.de/fileadmin/hwg/lay/favicons/favicon-96x96.png"
class="mr-3 h-8 rounded-full" class="mr-3 h-8 rounded-full"
alt="CoasterDB Logo" alt="CoasterDB Logo"
/> />

View File

@@ -5,6 +5,16 @@ export default {
}, },
mounted() { mounted() {
// Initialen Zustand setzen basierend auf sessionStorage
const savedState = sessionStorage.getItem('sidebarState');
if (savedState) {
const sidebar = document.getElementById('drawer-navigation');
if (sidebar) {
sidebar.classList.toggle('-translate-x-full', savedState === 'closed');
sidebar.classList.toggle('translate-x-0', savedState === 'open');
}
}
function processAjaxData(urlPath:string) { function processAjaxData(urlPath:string) {
window.history.pushState({"html":null,"pageTitle":document.title},"", urlPath); window.history.pushState({"html":null,"pageTitle":document.title},"", urlPath);
} }
@@ -76,7 +86,7 @@ export default {
<template> <template>
<aside <aside
class="hidden fixed top-0 left-0 z-40 w-64 h-screen pt-14 transition-transform duration-200 ease-in-out bg-white border-r border-gray-200 md:translate-x-0 dark:bg-gray-800 dark:border-gray-700" class="fixed top-0 left-0 z-40 w-64 h-screen pt-14 transition-transform duration-200 ease-in-out bg-white border-r border-gray-200 md:translate-x-0 dark:bg-gray-800 dark:border-gray-700"
aria-label="Sidenav" aria-label="Sidenav"
id="drawer-navigation" id="drawer-navigation"
> >

View File

@@ -12,13 +12,16 @@ export default {
sidebarOpen: false sidebarOpen: false
} }
}, },
mounted() {
// Zustand beim Laden wiederherstellen
const savedState = sessionStorage.getItem('sidebarState');
this.sidebarOpen = savedState ? savedState === 'open' : false;
},
methods: { methods: {
toggleSidebar() { toggleSidebar() {
this.sidebarOpen = !this.sidebarOpen; this.sidebarOpen = !this.sidebarOpen;
const sidebar = document.getElementById('drawer-navigation'); // Zustand speichern
if (sidebar) { sessionStorage.setItem('sidebarState', this.sidebarOpen ? 'open' : 'closed');
sidebar.classList.toggle('-translate-x-full', !this.sidebarOpen);
}
} }
} }
} }