Files
PostTracker/web/index.html
2025-11-16 13:02:05 +01:00

162 lines
4.3 KiB
HTML

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Post Tracker</title>
<link rel="icon" type="image/png" sizes="32x32" href="assets/app-icon-64.png">
<link rel="icon" type="image/png" sizes="192x192" href="assets/app-icon-192.png">
<link rel="apple-touch-icon" href="assets/app-icon-192.png">
<link rel="stylesheet" href="style.css">
<style>
body {
margin: 0;
font-family: 'Inter', system-ui, -apple-system, sans-serif;
background: #f4f5f7;
color: #111827;
}
.shell {
min-height: 100vh;
display: flex;
flex-direction: column;
background: #f4f5f7;
}
.site-header {
background: #ffffff;
border-bottom: 1px solid #e5e7eb;
padding: 16px 24px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 20px;
position: sticky;
top: 0;
z-index: 100;
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}
.site-header__brand h1 {
margin: 0;
font-size: 20px;
}
.site-header__nav {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
.site-header__nav-btn {
border: 1px solid transparent;
background: transparent;
padding: 10px 18px;
border-radius: 999px;
font-size: 14px;
font-weight: 600;
color: #111827;
cursor: pointer;
transition: all 0.2s;
}
.site-header__nav-btn:hover {
background: #eef2ff;
border-color: #c7d2fe;
}
.site-header__nav-btn.active {
background: #111827;
color: #ffffff;
border-color: #111827;
}
.shell-main {
flex: 1;
min-height: 0;
}
#appFrame {
width: 100%;
height: calc(100vh - 72px);
border: none;
}
@media (max-width: 640px) {
.site-header {
flex-direction: column;
align-items: flex-start;
}
#appFrame {
height: calc(100vh - 140px);
}
}
</style>
</head>
<body>
<div class="shell">
<header class="site-header">
<div class="site-header__brand">
<h1>📋 Post Tracker</h1>
<p style="margin: 0; font-size: 13px; color: #6b7280;">Alle Bereiche über diese Navigation laden</p>
</div>
<nav class="site-header__nav">
<button type="button" class="site-header__nav-btn" data-view-target="posts">Beiträge</button>
<button type="button" class="site-header__nav-btn" data-view-target="dashboard">Dashboard</button>
<button type="button" class="site-header__nav-btn" data-view-target="settings">⚙️ Einstellungen</button>
<button type="button" class="site-header__nav-btn" data-view-target="bookmarks">🔖 Bookmarks</button>
</nav>
</header>
<main class="shell-main">
<iframe id="appFrame" src="" title="Post Tracker Inhalt" loading="lazy"></iframe>
</main>
</div>
<script>
(function () {
const frame = document.getElementById('appFrame');
const buttons = Array.from(document.querySelectorAll('[data-view-target]'));
const viewUrls = {
posts: 'posts.html',
dashboard: 'dashboard.html',
settings: 'settings.html',
bookmarks: 'bookmarks.html'
};
const queryParams = new URLSearchParams(window.location.search);
const initial = queryParams.get('view');
const defaultView = initial && viewUrls[initial] ? initial : 'posts';
function setView(view) {
buttons.forEach((button) => {
button.classList.toggle('active', button.dataset.viewTarget === view);
});
const targetUrl = viewUrls[view] || viewUrls.posts;
if (frame.src !== targetUrl) {
frame.src = targetUrl;
}
const params = new URLSearchParams(window.location.search);
if (view === 'posts') {
params.delete('view');
} else {
params.set('view', view);
}
const url = params.toString() ? `?${params.toString()}` : window.location.pathname;
window.history.replaceState({}, document.title, url);
}
buttons.forEach((button) => {
button.addEventListener('click', () => {
setView(button.dataset.viewTarget);
});
});
setView(defaultView);
})();
</script>
</body>
</html>