feat: add responsive mobile navigation, fix horizontal scroll overflow, and add toggleable real corporate login view with demo autofill
This commit is contained in:
@@ -22,6 +22,11 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
overflow-x: hidden;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: var(--font-family);
|
||||
background-color: var(--bg-primary);
|
||||
@@ -30,6 +35,9 @@ body {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-x: hidden;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.container {
|
||||
@@ -51,6 +59,7 @@ body {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 50;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.nav-content {
|
||||
@@ -60,6 +69,51 @@ body {
|
||||
height: 64px;
|
||||
}
|
||||
|
||||
/* Mobile Toggle Hamburger */
|
||||
.mobile-toggle {
|
||||
display: none;
|
||||
background: transparent;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
padding: 8px;
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
z-index: 100;
|
||||
transition: background 0.2s, border-color 0.2s;
|
||||
}
|
||||
|
||||
.mobile-toggle:hover, .mobile-toggle:focus-visible {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border-color: var(--accent);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.mobile-toggle .bar {
|
||||
width: 20px;
|
||||
height: 2px;
|
||||
background-color: var(--text-main);
|
||||
border-radius: 2px;
|
||||
transition: transform 0.25s ease, opacity 0.25s ease;
|
||||
}
|
||||
|
||||
.mobile-toggle.open .bar:nth-child(1) {
|
||||
transform: translateY(7px) rotate(45deg);
|
||||
}
|
||||
|
||||
.mobile-toggle.open .bar:nth-child(2) {
|
||||
opacity: 0;
|
||||
transform: scaleX(0);
|
||||
}
|
||||
|
||||
.mobile-toggle.open .bar:nth-child(3) {
|
||||
transform: translateY(-7px) rotate(-45deg);
|
||||
}
|
||||
|
||||
.brand {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
@@ -1177,6 +1231,317 @@ body {
|
||||
.empty-icon {
|
||||
font-size: 3rem;
|
||||
margin-bottom: 16px;
|
||||
/* Demo Toggle & Credentials Box */
|
||||
.demo-toggle-wrapper {
|
||||
margin: 16px 0 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn-demo-toggle {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px dashed var(--border-color);
|
||||
border-radius: 9999px;
|
||||
color: var(--text-muted);
|
||||
padding: 6px 14px;
|
||||
font-size: 0.82rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.btn-demo-toggle:hover {
|
||||
background: rgba(56, 189, 248, 0.1);
|
||||
color: var(--accent);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.demo-credentials-card {
|
||||
background: rgba(56, 189, 248, 0.06);
|
||||
border: 1px solid rgba(56, 189, 248, 0.25);
|
||||
border-radius: var(--radius-md);
|
||||
padding: 14px 16px;
|
||||
margin-bottom: 20px;
|
||||
animation: fadeInNav 0.2s ease forwards;
|
||||
}
|
||||
|
||||
.demo-card-header {
|
||||
font-size: 0.85rem;
|
||||
color: var(--accent);
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.demo-creds-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.demo-cred-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: rgba(11, 15, 25, 0.6);
|
||||
border: 1px solid var(--border-color);
|
||||
padding: 8px 12px;
|
||||
border-radius: 6px;
|
||||
font-size: 0.85rem;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.demo-cred-item code {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
color: var(--text-main);
|
||||
font-size: 0.82rem;
|
||||
}
|
||||
|
||||
.btn-fill-small {
|
||||
padding: 4px 10px;
|
||||
background: rgba(56, 189, 248, 0.15);
|
||||
border: 1px solid rgba(56, 189, 248, 0.35);
|
||||
color: var(--accent);
|
||||
border-radius: 6px;
|
||||
font-size: 0.78rem;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: all 0.15s;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.btn-fill-small:hover {
|
||||
background: var(--accent);
|
||||
color: #0b0f19;
|
||||
}
|
||||
|
||||
/* ================= COMPREHENSIVE RESPONSIVE MOBILE STYLES ================= */
|
||||
@media (max-width: 768px) {
|
||||
.mobile-toggle {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.nav-links {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 64px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: calc(100vh - 64px);
|
||||
background: rgba(11, 15, 25, 0.98);
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
flex-direction: column;
|
||||
padding: 24px 20px 40px;
|
||||
gap: 16px;
|
||||
overflow-y: auto;
|
||||
z-index: 90;
|
||||
align-items: stretch;
|
||||
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
|
||||
.nav-links.open {
|
||||
display: flex;
|
||||
animation: fadeInNav 0.22s ease forwards;
|
||||
}
|
||||
|
||||
.nav-links a {
|
||||
font-size: 1.05rem;
|
||||
padding: 12px 14px;
|
||||
border-radius: var(--radius-md);
|
||||
display: block;
|
||||
text-align: left;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.nav-links a:hover {
|
||||
background: rgba(56, 189, 248, 0.1);
|
||||
border-color: rgba(56, 189, 248, 0.25);
|
||||
}
|
||||
|
||||
.user-greeting {
|
||||
padding: 12px 14px;
|
||||
font-size: 0.95rem;
|
||||
display: block;
|
||||
text-align: left;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 0 14px;
|
||||
}
|
||||
|
||||
/* Header & Top Actions in Admin */
|
||||
.admin-header {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.admin-header h1 {
|
||||
font-size: 1.35rem;
|
||||
}
|
||||
|
||||
.admin-actions-top {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.admin-actions-top button,
|
||||
.admin-actions-top a {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
font-size: 0.8rem;
|
||||
padding: 9px 6px;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
/* Tabs Navigation */
|
||||
.admin-nav-tabs {
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
gap: 4px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.admin-tab-btn {
|
||||
padding: 10px 14px;
|
||||
font-size: 0.88rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* Events Ribbon */
|
||||
.events-ribbon {
|
||||
padding: 10px 14px;
|
||||
gap: 10px;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.events-ribbon-list {
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Event Action Bar */
|
||||
.event-action-bar {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 12px;
|
||||
padding: 14px 16px;
|
||||
}
|
||||
|
||||
.event-actions-right {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.event-actions-right button {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Stats Cards */
|
||||
.stats-grid {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
padding: 14px 12px;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
/* Admin Cards & Tables */
|
||||
.admin-columns {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
.admin-card {
|
||||
padding: 18px 14px;
|
||||
}
|
||||
|
||||
.shopping-table-wrapper,
|
||||
.orders-table-wrapper {
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.data-table th, .data-table td {
|
||||
padding: 8px 6px;
|
||||
font-size: 0.82rem;
|
||||
}
|
||||
|
||||
/* Form rows on mobile */
|
||||
.form-row-2, .form-row-3 {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
/* Order Page Banner & Grid */
|
||||
.banner {
|
||||
padding: 18px 14px;
|
||||
}
|
||||
|
||||
.banner h1 {
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
|
||||
.banner-top-row {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.form-grid {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.product-card {
|
||||
padding: 14px 12px;
|
||||
}
|
||||
|
||||
.product-info h3 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.modal-card {
|
||||
width: 95%;
|
||||
padding: 20px 16px;
|
||||
max-height: 90vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.footer-inner {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
gap: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeInNav {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-8px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* ================= PRINT MEDIA QUERY (1-PAGE A4) ================= */
|
||||
|
||||
+27
-2
@@ -14,9 +14,14 @@
|
||||
<a href="/" class="brand">
|
||||
🥨 <span>Schmankerl</span> <small class="tenant-badge">{{ tenant.name if tenant else 'Portal' }}</small>
|
||||
</a>
|
||||
<nav class="nav-links">
|
||||
<button class="mobile-toggle" aria-label="Menü öffnen" id="mobileNavToggle" aria-expanded="false">
|
||||
<span class="bar"></span>
|
||||
<span class="bar"></span>
|
||||
<span class="bar"></span>
|
||||
</button>
|
||||
<nav class="nav-links" id="navLinks">
|
||||
{% if current_user %}
|
||||
<a href="/">Brotzeit bestellen</a>
|
||||
<a href="/">🥨 Brotzeit bestellen</a>
|
||||
{% if current_user.role == 'admin' %}
|
||||
<a href="/admin" class="nav-admin">👨🍳 Einkäufer-Cockpit</a>
|
||||
{% endif %}
|
||||
@@ -43,5 +48,25 @@
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
const navToggle = document.getElementById('mobileNavToggle');
|
||||
const navLinks = document.getElementById('navLinks');
|
||||
if (navToggle && navLinks) {
|
||||
navToggle.addEventListener('click', () => {
|
||||
const isOpen = navLinks.classList.toggle('open');
|
||||
navToggle.classList.toggle('open', isOpen);
|
||||
navToggle.setAttribute('aria-expanded', isOpen);
|
||||
document.body.style.overflow = isOpen ? 'hidden' : '';
|
||||
});
|
||||
navLinks.querySelectorAll('a').forEach(link => {
|
||||
link.addEventListener('click', () => {
|
||||
navLinks.classList.remove('open');
|
||||
navToggle.classList.remove('open');
|
||||
navToggle.setAttribute('aria-expanded', 'false');
|
||||
document.body.style.overflow = '';
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+85
-23
@@ -27,37 +27,53 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- 1-Click Demo Login Box -->
|
||||
<div class="demo-login-card">
|
||||
<h3>🚀 1-Klick Demo-Zugang</h3>
|
||||
<p class="card-hint">Wähle eine Rolle zum sofortigen Ausprobieren:</p>
|
||||
<div class="demo-btn-grid">
|
||||
<form action="/login/quick" method="POST">
|
||||
<input type="hidden" name="role" value="user">
|
||||
<button type="submit" class="btn-demo">
|
||||
👤 <strong>Mitarbeiter</strong><br>
|
||||
<small>Brotzeit bestellen & Übersicht</small>
|
||||
</button>
|
||||
</form>
|
||||
<form action="/login/quick" method="POST">
|
||||
<input type="hidden" name="role" value="admin">
|
||||
<button type="submit" class="btn-demo admin">
|
||||
👨🍳 <strong>Einkäufer / Admin</strong><br>
|
||||
<small>Sammelliste & Kasse verwalten</small>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% if tenant and tenant.slug == 'demo' %}
|
||||
<!-- Demo Switch & Credentials Box -->
|
||||
<div class="demo-toggle-wrapper">
|
||||
<button type="button" class="btn-demo-toggle" id="btnToggleDemo" onclick="toggleDemoBox()">
|
||||
<span id="demoToggleIcon">🧪</span> <span id="demoToggleText">Demo-Zugangsdaten einblenden</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="demoCredentialsBox" class="demo-credentials-card" style="display: none;">
|
||||
<div class="demo-card-header">
|
||||
<strong>🧪 Demo-Zugangsdaten (Klick auf „Ausfüllen“):</strong>
|
||||
</div>
|
||||
<div class="demo-creds-list">
|
||||
<div class="demo-cred-item">
|
||||
<div>
|
||||
<span class="badge-role admin">👨🍳 Admin</span>
|
||||
<code>admin@waiswuaschd.de</code>
|
||||
<span class="text-muted" style="font-size: 0.8rem;">(PW: <code>admin123</code>)</span>
|
||||
</div>
|
||||
<button type="button" class="btn-fill-small" onclick="fillCredentials('admin@waiswuaschd.de', 'admin123')">
|
||||
✍️ Ausfüllen
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="demo-cred-item">
|
||||
<div>
|
||||
<span class="badge-role">👤 Mitarbeiter</span>
|
||||
<code>maxi@waiswuaschd.de</code>
|
||||
<span class="text-muted" style="font-size: 0.8rem;">(PW: <code>demo123</code>)</span>
|
||||
</div>
|
||||
<button type="button" class="btn-fill-small" onclick="fillCredentials('maxi@waiswuaschd.de', 'demo123')">
|
||||
✍️ Ausfüllen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Login Form -->
|
||||
<form action="/login" method="POST" id="formLogin" class="auth-form" style="margin-top: 1.5rem;">
|
||||
<form action="/login" method="POST" id="formLogin" class="auth-form">
|
||||
<div class="input-group">
|
||||
<label for="login_email">E-Mail-Adresse</label>
|
||||
<input type="email" id="login_email" name="email" required placeholder="name@firma.de">
|
||||
<input type="email" id="login_email" name="email" required placeholder="name@firma.de" autocomplete="username">
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<label for="login_password">Passwort</label>
|
||||
<input type="password" id="login_password" name="password" required placeholder="••••••••">
|
||||
<input type="password" id="login_password" name="password" required placeholder="••••••••" autocomplete="current-password">
|
||||
</div>
|
||||
<button type="submit" class="btn-submit">Anmelden</button>
|
||||
</form>
|
||||
@@ -84,4 +100,50 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function fillCredentials(email, pw) {
|
||||
const emailInput = document.getElementById('login_email');
|
||||
const pwInput = document.getElementById('login_password');
|
||||
emailInput.value = email;
|
||||
pwInput.value = pw;
|
||||
emailInput.focus();
|
||||
emailInput.style.boxShadow = '0 0 0 2px var(--accent)';
|
||||
pwInput.style.boxShadow = '0 0 0 2px var(--accent)';
|
||||
setTimeout(() => {
|
||||
emailInput.style.boxShadow = '';
|
||||
pwInput.style.boxShadow = '';
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function toggleDemoBox() {
|
||||
const box = document.getElementById('demoCredentialsBox');
|
||||
const text = document.getElementById('demoToggleText');
|
||||
const icon = document.getElementById('demoToggleIcon');
|
||||
if (box.style.display === 'none' || !box.style.display) {
|
||||
box.style.display = 'block';
|
||||
text.innerText = 'Demo-Hilfe ausblenden (Reale Firmenansicht)';
|
||||
icon.innerText = '🏢';
|
||||
localStorage.setItem('schmankerl_show_demo', '1');
|
||||
} else {
|
||||
box.style.display = 'none';
|
||||
text.innerText = 'Demo-Zugangsdaten einblenden';
|
||||
icon.innerText = '🧪';
|
||||
localStorage.setItem('schmankerl_show_demo', '0');
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
if (localStorage.getItem('schmankerl_show_demo') === '1') {
|
||||
const box = document.getElementById('demoCredentialsBox');
|
||||
const text = document.getElementById('demoToggleText');
|
||||
const icon = document.getElementById('demoToggleIcon');
|
||||
if (box && text && icon) {
|
||||
box.style.display = 'block';
|
||||
text.innerText = 'Demo-Hilfe ausblenden (Reale Firmenansicht)';
|
||||
icon.innerText = '🏢';
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user