This commit is contained in:
2025-08-31 12:52:17 +02:00
parent dbf53a9c30
commit d1c9d27219
4 changed files with 88 additions and 23 deletions

14
assets/app.js Normal file
View File

@@ -0,0 +1,14 @@
// Kleine UX-Helferlein keine externen Abhängigkeiten nötig.
(function(){
// Confirm bei Ausbuchen-Buttons (nur mit .danger)
document.addEventListener('click', function(e){
const btn = e.target.closest('button.btn.danger');
if(!btn) return;
const form = btn.closest('form');
if(!form) return;
if(!confirm('Einheit wirklich ausbuchen?')){
e.preventDefault();
e.stopPropagation();
}
});
})();

View File

@@ -1,29 +1,76 @@
:root { --gap: 16px; --radius: 12px; --muted: #6b7280; }
:root {
--gap: 16px; --radius: 14px; --muted: #6b7280; --bg: #f6f7fb; --card: #ffffff; --ink: #0f172a;
--brand: #6366f1; --brand-600:#4f46e5; --danger:#ef4444; --line:#e5e7eb;
}
* { box-sizing: border-box; }
body { font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, Noto Sans, "Apple Color Emoji", "Segoe UI Emoji"; margin:0; background:#f6f7fb; }
.container { max-width: 1100px; margin: 0 auto; padding: 16px; }
header.container { display:flex; align-items:center; justify-content:space-between; }
header h1 { margin:0; font-size: 20px; }
nav a { margin-right: 12px; text-decoration:none; color:#111827; }
nav a:hover { text-decoration: underline; }
.card { background:white; padding:16px; border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,0.06); margin-bottom:16px; }
.grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--gap); }
.product { display:flex; gap:12px; border: 1px solid #e5e7eb; border-radius: var(--radius); padding:10px; background:#fff; color:inherit; text-decoration:none; }
.product img { width:72px; height:72px; object-fit:cover; border-radius:8px; border:1px solid #eee; }
.placeholder { width:72px; height:72px; background:#eef2ff; border:1px dashed #c7d2fe; display:flex; align-items:center; justify-content:center; border-radius:8px; color:#6366f1; font-size:12px; }
.meta .name { font-weight:600; }
html { scroll-behavior: smooth; }
body { font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, Noto Sans, "Apple Color Emoji", "Segoe UI Emoji"; margin:0; background:var(--bg); color:var(--ink); }
.container { max-width: 1150px; margin: 0 auto; padding: 20px; }
/* Header */
header.container { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.brand { display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.3px; }
.brand .logo { width:28px; height:28px; display:grid; place-items:center; border-radius:10px; background:linear-gradient(135deg,var(--brand),#22d3ee); color:white; font-size:16px; }
nav a { margin-right: 14px; text-decoration:none; color:#111827; padding:6px 10px; border-radius:8px; }
nav a:hover { background: rgba(99,102,241,.1); }
/* Cards */
.card { background:var(--card); padding:18px; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,0.06); margin-bottom:18px; border:1px solid var(--line); }
.card h2, .card h3 { margin-top:0; }
/* Grid Product Tiles */
.grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); }
.product { display:flex; gap:12px; border: 1px solid var(--line); border-radius: var(--radius); padding:12px; background:#fff; color:inherit; text-decoration:none; transition: transform .08s ease, box-shadow .2s ease; }
.product:hover { transform: translateY(-2px); box-shadow:0 12px 30px rgba(0,0,0,.08); }
.product img { width:74px; height:74px; object-fit:cover; border-radius:10px; border:1px solid #eee; }
.placeholder { width:74px; height:74px; background:#eef2ff; border:1px dashed #c7d2fe; display:flex; align-items:center; justify-content:center; border-radius:10px; color:#6366f1; font-size:12px; }
.meta .name { font-weight:700; }
.muted { color: var(--muted); }
.stock.warn { color:#dc2626; font-weight:600; }
.actions { margin-top:8px; }
.btn { background:#111827; color:white; border:0; padding:8px 12px; border-radius:8px; cursor:pointer; text-decoration:none; display:inline-block; }
.btn:hover { filter: brightness(1.1); }
.btn.sm { padding:6px 10px; font-size: 14px; }
.btn.danger { background:#dc2626; }
.table { width:100%; border-collapse: collapse; background:white; }
.table th, .table td { border-bottom:1px solid #e5e7eb; padding:8px; text-align:left; }
.badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; border:1px solid var(--line); }
.badge.warn { background:#fff1f2; border-color:#fecdd3; color:#b91c1c; }
.badge.ok { background:#ecfeff; border-color:#a5f3fc; color:#0e7490; }
/* Buttons */
.btn { background:var(--brand); color:white; border:0; padding:10px 14px; border-radius:10px; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:8px; font-weight:600; box-shadow:0 6px 18px rgba(99,102,241,.25); }
.btn:hover { background:var(--brand-600); }
.btn.secondary { background:#111827; box-shadow:0 6px 18px rgba(17,24,39,.2); }
.btn.sm { padding:6px 10px; font-size: 14px; box-shadow:none; }
.btn.ghost { background:transparent; color:var(--brand-600); border:1px solid var(--brand-600); box-shadow:none; }
.btn.danger { background:var(--danger); box-shadow:0 6px 18px rgba(239,68,68,.25); }
.actions { margin-top:8px; display:flex; gap:10px; }
/* Tables */
.table { width:100%; border-collapse: collapse; background:white; border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.table thead th { background:#f8fafc; font-weight:700; font-size:14px; }
.table th, .table td { border-bottom:1px solid var(--line); padding:12px; text-align:left; }
.table tbody tr:hover { background:#fafafa; }
.tinyimg img { width:42px; height:42px; object-fit:cover; border-radius:8px; border:1px solid #eee; }
/* Layout utils */
.flex { display:flex; gap:12px; align-items:center; }
.flex-between { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.form-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap); }
.form-inline { display:flex; gap:12px; align-items:end; flex-wrap:wrap; }
.cover { width:96px; height:96px; object-fit:cover; border-radius:8px; border:1px solid #eee; }
.cover { width:96px; height:96px; object-fit:cover; border-radius:12px; border:1px solid #eee; }
input, select { width:100%; height:38px; border:1px solid var(--line); border-radius:10px; padding:8px 10px; }
/* Footer */
footer.container { color:var(--muted); font-size:14px; }
/* Dark mode
@media (prefers-color-scheme: dark) {
:root { --bg:#0b1220; --card:#0f172a; --ink:#e5e7eb; --line:#1f2937; }
nav a { color:#e5e7eb; }
.product { background:var(--card); }
.table { background:var(--card); }
.table thead th { background:#0b1324; }
.placeholder { background:#1f2a48; border-color:#334155; color:#93c5fd; }
}*/

BIN
kueche.db

Binary file not shown.

View File

@@ -4,12 +4,14 @@
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="theme-color" content="#6366f1"/>
<title>{{block "title" .}}Kücheninventar{{end}}</title>
<link rel="stylesheet" href="/assets/style.css"/>
<script defer src="/assets/app.js"></script>
</head>
<body>
<header class="container">
<h1>🍳 Kücheninventar</h1>
<div class="brand"><span class="logo">🍳</span> <span>Kücheninventar</span></div>
<nav>
<a href="/">Dashboard</a>
<a href="/products">Produkte</a>
@@ -19,7 +21,9 @@
</header>
<main class="container">
{{template "flash" .}}
<div class="content">
{{block "content" .}}{{end}}
</div>
</main>
<footer class="container muted">
<p>© {{now | printf "%d"}} Lokale Demo-App (Go + SQLite). Bilder bleiben lokal.</p>