Oberfläche wie Plancraft: Seitenleiste mit Logo, Blautöne, Status-Etiketten
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
@@ -134,17 +134,18 @@ function tabelle(spalten: { titel: string; wert: (z: Zeile) => string; klasse?:
|
||||
return t;
|
||||
}
|
||||
|
||||
// Kopf wie bei Plancraft: Titel links, Hauptknopf rechts; darunter eine Leiste für Filter
|
||||
function seite(titel: string, knopf?: { text: string; aktion: () => void }): HTMLElement {
|
||||
inhalt.innerHTML = `<h1>${esc(titel)}</h1>`;
|
||||
const leiste = document.createElement("div");
|
||||
leiste.className = "leiste";
|
||||
inhalt.innerHTML = `<div class="kopf"><h1>${esc(titel)}</h1></div>`;
|
||||
if (knopf) {
|
||||
const b = document.createElement("button");
|
||||
b.className = "haupt";
|
||||
b.textContent = knopf.text;
|
||||
b.onclick = knopf.aktion;
|
||||
leiste.appendChild(b);
|
||||
inhalt.firstElementChild!.appendChild(b);
|
||||
}
|
||||
const leiste = document.createElement("div");
|
||||
leiste.className = "leiste";
|
||||
inhalt.appendChild(leiste);
|
||||
return leiste;
|
||||
}
|
||||
@@ -175,10 +176,18 @@ async function kontakte(): Promise<void> {
|
||||
], zeilen, async (z) => (await bearbeiten("kontakte", "Kontakt bearbeiten", KONTAKT_FELDER, z)) && kontakte()));
|
||||
}
|
||||
|
||||
const STATUS: [string, string][] = [
|
||||
["anfrage", "Anfrage"], ["angebot", "Angebot"], ["auftrag", "Auftrag erhalten"], ["ausfuehrung", "Ausführung"],
|
||||
["abgerechnet", "Abgerechnet"], ["gewaehrleistung", "Gewährleistung"], ["abgeschlossen", "Abgeschlossen"],
|
||||
];
|
||||
const STATUS_TEXT = Object.fromEntries(STATUS);
|
||||
const etikett = (status: string) => `<span class="etikett ${esc(status)}">${esc(STATUS_TEXT[status] ?? status)}</span>`;
|
||||
|
||||
async function projekte(): Promise<void> {
|
||||
const kontaktListe = await api<Zeile[]>("kontakte");
|
||||
const felder: Feld[] = [
|
||||
{ name: "nummer", titel: "Nummer", pflicht: true }, { name: "bezeichnung", titel: "Baustelle", pflicht: true },
|
||||
{ name: "status", titel: "Status", art: "auswahl", optionen: STATUS },
|
||||
{ name: "bauherr_id", titel: "Bauherr", art: "auswahl", optionen: [["", "–"], ...kontaktListe.map((k): [string, string] => [k.id, k.name])] },
|
||||
{ name: "umsatz_netto", titel: "Umsatz netto", art: "euro" }, { name: "material_kosten", titel: "Materialkosten", art: "euro" },
|
||||
{ name: "fremd_kosten", titel: "Fremdkosten", art: "euro" }, { name: "sonstige_kosten", titel: "Sonstige Kosten", art: "euro" },
|
||||
@@ -192,15 +201,15 @@ async function projekte(): Promise<void> {
|
||||
const name = Object.fromEntries(kontaktListe.map((k) => [k.id, k.name]));
|
||||
const kostenSumme = (z: Zeile) => z.material_kosten + z.fremd_kosten + z.sonstige_kosten;
|
||||
inhalt.appendChild(tabelle([
|
||||
{ titel: "Nr.", wert: (z) => esc(z.nummer) },
|
||||
{ titel: "Baustelle", wert: (z) => esc(z.bezeichnung) },
|
||||
{ titel: "Bauherr", wert: (z) => esc(name[z.bauherr_id]), klasse: "optional" },
|
||||
{ titel: "Umsatz netto", wert: (z) => euro(z.umsatz_netto), klasse: "zahl" },
|
||||
{ titel: "Name", wert: (z) => `<strong>${esc(z.bezeichnung)}</strong><span class="unter"><span class="nur-schmal">${esc(z.nummer)} · </span>${esc(name[z.bauherr_id] ?? "–")}</span>` },
|
||||
{ titel: "Nummer", wert: (z) => esc(z.nummer), klasse: "optional" },
|
||||
{ titel: "Status", wert: (z) => etikett(z.status) },
|
||||
{ titel: "Umsatz netto", wert: (z) => euro(z.umsatz_netto), klasse: "zahl optional" },
|
||||
{ titel: "Kosten", wert: (z) => euro(kostenSumme(z)), klasse: "zahl optional" },
|
||||
{ titel: "Rohertrag", wert: (z) => euro(z.umsatz_netto - kostenSumme(z)), klasse: "zahl" },
|
||||
{ titel: "Rohertrag", wert: (z) => euro(z.umsatz_netto - kostenSumme(z)), klasse: "zahl optional" },
|
||||
], zeilen, (z) => speichern(ohneNull(z))));
|
||||
const gesamt = zeilen.reduce((s, z) => s + z.umsatz_netto - kostenSumme(z), 0);
|
||||
inhalt.insertAdjacentHTML("beforeend", `<p>Rohertrag gesamt: <strong>${euro(gesamt)}</strong></p>
|
||||
inhalt.insertAdjacentHTML("beforeend", `<p class="anzahl">${zeilen.length} Projekte</p><p>Rohertrag gesamt: <strong>${euro(gesamt)}</strong></p>
|
||||
<p class="hinweis">Projektdetailseite, Einzelposten und Zahlungsplan folgen mit der V70-Übernahme.</p>`);
|
||||
}
|
||||
|
||||
@@ -352,10 +361,23 @@ const REITER: [string, string, () => Promise<void>][] = [
|
||||
["daten", "Daten", daten],
|
||||
];
|
||||
|
||||
// Einfache Strichsymbole (24er Raster), Farbe kommt aus der Schrift
|
||||
const SYMBOLE: Record<string, string> = {
|
||||
uebersicht: '<path d="M3 11l9-7 9 7"/><path d="M5 10v10h14V10"/>',
|
||||
aufgaben: '<path d="M9 11l3 3 8-8"/><path d="M20 12v7a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h11"/>',
|
||||
projekte: '<path d="M3 6a1 1 0 0 1 1-1h5l2 2h9a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z"/>',
|
||||
terminplan: '<rect x="3" y="5" width="18" height="16" rx="1"/><path d="M3 10h18M8 3v4M16 3v4"/>',
|
||||
kontakte: '<circle cx="12" cy="8" r="4"/><path d="M4 21c1-4 4-6 8-6s7 2 8 6"/>',
|
||||
liquiditaet: '<path d="M3 17l6-6 4 4 8-8"/><path d="M15 7h6v6"/>',
|
||||
"laufende-kosten": '<rect x="3" y="6" width="18" height="13" rx="1"/><path d="M3 10h18M7 15h4"/>',
|
||||
daten: '<ellipse cx="12" cy="6" rx="8" ry="3"/><path d="M4 6v12c0 1.7 3.6 3 8 3s8-1.3 8-3V6M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3"/>',
|
||||
};
|
||||
const symbol = (id: string) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${SYMBOLE[id] ?? ""}</svg>`;
|
||||
|
||||
const nav = document.getElementById("reiter")!;
|
||||
nav.innerHTML = REITER.map(([id, titel]) => `<button data-r="${id}">${titel}</button>`).join("");
|
||||
nav.innerHTML = REITER.map(([id, titel]) => `<button data-r="${id}">${symbol(id)}<span>${titel}</span></button>`).join("");
|
||||
nav.addEventListener("click", (ev) => {
|
||||
const r = (ev.target as HTMLElement).dataset.r;
|
||||
const r = ((ev.target as HTMLElement).closest("button[data-r]") as HTMLElement | null)?.dataset.r;
|
||||
if (r) location.hash = r;
|
||||
});
|
||||
|
||||
|
||||
BIN
src/web/bilder/logo.png
Normal file
BIN
src/web/bilder/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@@ -5,13 +5,14 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Betrieb · Schaarschmidt Holzbau</title>
|
||||
<link rel="stylesheet" href="/styles.css">
|
||||
<link rel="icon" href="/bilder/logo.png">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<strong>Schaarschmidt Holzbau</strong>
|
||||
<aside id="seitenleiste">
|
||||
<div id="marke"><img src="/bilder/logo.png" alt="Holzbau Schaarschmidt"></div>
|
||||
<nav id="reiter"></nav>
|
||||
<span id="version"></span>
|
||||
</header>
|
||||
</aside>
|
||||
<main id="inhalt"></main>
|
||||
<div id="dialog-huelle" hidden></div>
|
||||
<script type="module" src="/app.js"></script>
|
||||
|
||||
@@ -1,37 +1,96 @@
|
||||
/* Aufbau ähnlich Plancraft (Henning, 19.10.2026): dunkle Seitenleiste, helle Fläche,
|
||||
weiße Karten, farbige Status-Etiketten. Farben: Blautöne, dazu die Markenfarbe aus dem Logo
|
||||
(--marke dunkles Braun, --holz helles Braun) für Logo und Markierungen. */
|
||||
:root {
|
||||
--bg: #f6f5f2; --fl: #ffffff; --text: #1f1f1d; --leise: #6b6a65; --linie: #dedcd5;
|
||||
--akzent: #8a4b14; --akzent-text: #ffffff; --warn: #b42318;
|
||||
--marke: #451e0c; --holz: #a26e3a;
|
||||
--leiste: #13294a; --leiste-text: #b9c7da; --leiste-aktiv: #234a7c;
|
||||
--bg: #f2f4f8; --fl: #ffffff; --text: #18202c; --leise: #5f6b7a; --linie: #e0e5ec;
|
||||
--akzent: #1d5fa8; --akzent-hover: #174d89; --akzent-text: #ffffff; --akzent-hell: #e4eefa;
|
||||
--warn: #b42318;
|
||||
font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root { --bg: #1b1b1a; --fl: #262624; --text: #ecebe6; --leise: #a3a29b; --linie: #3a3936; --akzent: #d9893f; --akzent-text: #1b1b1a; --warn: #f97066; }
|
||||
:root {
|
||||
--leiste: #0d1a2e; --leiste-aktiv: #1d3a62;
|
||||
--bg: #111822; --fl: #1a2331; --text: #e8edf4; --leise: #9aa7b8; --linie: #2b3747;
|
||||
--akzent: #5a9be0; --akzent-hover: #78b0ea; --akzent-text: #0d1a2e; --akzent-hell: #1d3352; --warn: #f97066;
|
||||
}
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
body { margin: 0; background: var(--bg); color: var(--text); }
|
||||
header { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 10px 16px; background: var(--fl); border-bottom: 1px solid var(--linie); }
|
||||
header nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
|
||||
header nav button { background: none; border: 0; padding: 6px 10px; border-radius: 6px; color: var(--leise); cursor: pointer; font: inherit; }
|
||||
header nav button.aktiv { background: var(--bg); color: var(--text); font-weight: 600; }
|
||||
#version { color: var(--leise); font-size: 12px; }
|
||||
main { padding: 16px; max-width: 1200px; margin: 0 auto; }
|
||||
h1 { font-size: 20px; margin: 4px 0 16px; }
|
||||
.leiste { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
|
||||
button.haupt { background: var(--akzent); color: var(--akzent-text); border: 0; border-radius: 6px; padding: 7px 14px; font: inherit; cursor: pointer; }
|
||||
button.neben { background: var(--fl); color: var(--text); border: 1px solid var(--linie); border-radius: 6px; padding: 6px 12px; font: inherit; cursor: pointer; }
|
||||
table { width: 100%; border-collapse: collapse; background: var(--fl); border: 1px solid var(--linie); border-radius: 8px; overflow: hidden; }
|
||||
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--linie); }
|
||||
th { font-size: 12px; color: var(--leise); font-weight: 600; }
|
||||
body { margin: 0; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }
|
||||
|
||||
/* Seitenleiste */
|
||||
#seitenleiste { width: 200px; flex: none; background: var(--leiste); color: var(--leiste-text); display: flex; flex-direction: column; padding: 14px 10px; position: sticky; top: 0; height: 100vh; }
|
||||
#marke { background: #fff; border-radius: 10px; padding: 10px 14px; margin: 0 4px 18px; display: grid; place-items: center; }
|
||||
#marke img { width: 96px; height: auto; display: block; }
|
||||
#reiter { display: flex; flex-direction: column; gap: 2px; flex: 1; }
|
||||
#reiter button { display: flex; align-items: center; gap: 11px; background: none; border: 0; padding: 9px 10px; border-radius: 8px; color: inherit; cursor: pointer; font: inherit; text-align: left; }
|
||||
#reiter button svg { width: 19px; height: 19px; flex: none; }
|
||||
#reiter button:hover { background: rgb(255 255 255 / 0.06); color: #fff; }
|
||||
#reiter button.aktiv { background: var(--leiste-aktiv); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--holz); }
|
||||
#version { font-size: 12px; padding: 8px 10px 0; opacity: 0.7; }
|
||||
|
||||
/* Inhalt */
|
||||
main { flex: 1; min-width: 0; padding: 22px 28px; max-width: 1280px; }
|
||||
.kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
|
||||
.kopf h1 { font-size: 24px; margin: 0; flex: 1; color: var(--text); }
|
||||
h2 { font-size: 16px; margin: 26px 0 10px; }
|
||||
.leiste { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
|
||||
.leiste select, .leiste input { padding: 8px 10px; border: 1px solid var(--linie); border-radius: 8px; background: var(--fl); color: var(--text); font: inherit; }
|
||||
button.haupt { background: var(--akzent); color: var(--akzent-text); border: 0; border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; }
|
||||
button.haupt:hover { background: var(--akzent-hover); }
|
||||
button.neben, a.neben { display: inline-block; background: var(--fl); color: var(--text); border: 1px solid var(--linie); border-radius: 8px; padding: 8px 14px; font: inherit; cursor: pointer; text-decoration: none; }
|
||||
button.neben:hover, a.neben:hover { border-color: var(--leise); }
|
||||
|
||||
/* Tabellen als Karte */
|
||||
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--fl); border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; }
|
||||
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
|
||||
tbody tr:last-child td { border-bottom: 0; }
|
||||
th { font-size: 13px; color: var(--leise); font-weight: 600; }
|
||||
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
|
||||
td .unter { display: block; color: var(--leise); font-size: 13px; margin-top: 2px; }
|
||||
tr.klickbar { cursor: pointer; }
|
||||
tr.klickbar:hover td { background: var(--bg); }
|
||||
.nur-schmal { display: none; }
|
||||
td { overflow-wrap: break-word; }
|
||||
td.zahl { white-space: nowrap; }
|
||||
.anzahl { color: var(--leise); font-size: 13px; margin: 10px 2px; }
|
||||
|
||||
/* Status-Etiketten */
|
||||
.etikett { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 13px; white-space: nowrap; background: #eef1f5; color: #4a5565; }
|
||||
.etikett.angebot { background: #e4eefa; color: #1d5fa8; }
|
||||
.etikett.auftrag { background: #d7ecfa; color: #0b5f96; }
|
||||
.etikett.ausfuehrung { background: #fcefc3; color: #7a5600; }
|
||||
.etikett.abgerechnet { background: #dcf1f4; color: #0f6674; }
|
||||
.etikett.gewaehrleistung { background: #e6e8fb; color: #3c47a8; }
|
||||
.etikett.abgeschlossen { background: #daf3e3; color: #19703f; }
|
||||
|
||||
.hinweis { color: var(--leise); }
|
||||
.fehler { color: var(--warn); }
|
||||
#dialog-huelle { position: fixed; inset: 0; background: rgb(0 0 0 / 0.35); display: grid; place-items: center; padding: 16px; }
|
||||
|
||||
/* Dialoge */
|
||||
#dialog-huelle { position: fixed; inset: 0; background: rgb(10 20 35 / 0.4); display: grid; place-items: center; padding: 16px; z-index: 10; }
|
||||
#dialog-huelle[hidden] { display: none; }
|
||||
.dialog { background: var(--fl); border-radius: 10px; padding: 18px; width: min(460px, 100%); box-shadow: 0 10px 30px rgb(0 0 0 / 0.25); }
|
||||
.dialog h2 { font-size: 17px; margin: 0 0 12px; }
|
||||
.dialog label { display: block; font-size: 12px; color: var(--leise); margin: 10px 0 3px; }
|
||||
.dialog input, .dialog select, .dialog textarea { width: 100%; padding: 7px 8px; border: 1px solid var(--linie); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
|
||||
.dialog .knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
|
||||
.dialog { background: var(--fl); border-radius: 12px; padding: 22px; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 12px 34px rgb(0 0 0 / 0.25); }
|
||||
.dialog h2 { font-size: 18px; margin: 0 0 14px; }
|
||||
.dialog label { display: block; font-size: 13px; color: var(--leise); margin: 12px 0 4px; }
|
||||
.dialog input, .dialog select, .dialog textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--linie); border-radius: 8px; background: var(--fl); color: var(--text); font: inherit; }
|
||||
.dialog input:focus, .dialog select:focus, .dialog textarea:focus { outline: 2px solid var(--akzent-hell); border-color: var(--akzent); }
|
||||
.dialog .knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
|
||||
.dialog .knoepfe .links { margin-right: auto; }
|
||||
@media (max-width: 640px) { th.optional, td.optional { display: none; } }
|
||||
|
||||
/* Schmale Bildschirme: Leiste oben, waagerecht scrollbar */
|
||||
@media (max-width: 800px) {
|
||||
body { flex-direction: column; }
|
||||
#seitenleiste { width: auto; height: auto; position: static; flex-direction: row; align-items: center; padding: 8px; gap: 6px; overflow-x: auto; }
|
||||
#marke { padding: 4px 6px; margin: 0 4px 0 0; }
|
||||
#marke img { width: 34px; }
|
||||
#version { display: none; }
|
||||
#reiter { flex-direction: row; }
|
||||
#reiter button { padding: 8px 10px; white-space: nowrap; }
|
||||
main { padding: 16px; }
|
||||
th.optional, td.optional { display: none; }
|
||||
.nur-schmal { display: inline; }
|
||||
th, td { padding: 11px 10px; }
|
||||
td .unter { font-size: 12px; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user