Ambient²-Prototyp ans Backend angebunden

Die App-Komponente zeigt nur noch an, was GET /api/zustand liefert, und
schickt Stimmen, Vortragsmodus, Jalousie und Demo-Szenario per POST.
Design/CSS unveraendert; ergaenzt um Lichtstimme und Verbindungshinweis.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feature/figma-frontend-js-backend
Matias Mas Viehl 2026-11-17 11:15:35 +01:00
parent 2bf97e247e
commit ae5a23cf39
1 changed files with 204 additions and 258 deletions

View File

@ -14273,117 +14273,34 @@ function requireClient() {
} }
var clientExports = requireClient(); var clientExports = requireClient();
const ReactDOM = /* @__PURE__ */ getDefaultExportFromCjs(clientExports); const ReactDOM = /* @__PURE__ */ getDefaultExportFromCjs(clientExports);
const scenarios = [ // ---- Anbindung an das Backend (backend/server.js) ----
{ id: "normal", label: "Normal", description: "Alle Werte im Zielbereich" }, // Alle Werte, Entscheidungen, Stimmen und der Verlauf kommen von GET /api/zustand.
{ id: "co2", label: "CO₂ zu hoch", description: "Gesundheit priorisiert Lüften" }, // Die Seite berechnet nichts selbst, sie zeigt an und schickt Eingaben per POST.
{ id: "noise", label: "CO₂ + Außenlärm", description: "Frischluft mit Lärmschutz" }, const API_BASIS = location.protocol === "file:" ? "http://localhost:3000" : "";
{ id: "storm", label: "Sturm", description: "Fenster werden gesperrt" }, const ABFRAGE_MS = 1500;
{ id: "presentation", label: "Vortragsmodus", description: "Licht und Jalousien angepasst" }, function clientId() {
{ id: "outlier", label: "Ausreißer-Stimme", description: "Mehrheit bleibt ausschlaggebend" } let id = null;
]; try {
const states = { id = localStorage.getItem("ambient-client");
normal: { if (!id) {
co2: 742, id = Math.random().toString(36).slice(2) + Date.now().toString(36);
temperature: 22.1, localStorage.setItem("ambient-client", id);
noise: 41, }
wind: 9, } catch {
pm: 7, id = id || "tab-" + Math.random().toString(36).slice(2);
window: "Geschlossen",
windowOpen: 0,
blinds: 32,
votes: "8 von 10 zufrieden",
banner: "Raumklima im Zielbereich",
detail: "Temperatur und Luftqualität sind stabil.",
tone: "good",
action: "Zielwerte gehalten",
reason: "Raumklima stabil. Keine Anpassung erforderlich."
},
co2: {
co2: 1268,
temperature: 22.4,
noise: 47,
wind: 11,
pm: 8,
window: "Stoßlüftung",
windowOpen: 78,
blinds: 32,
votes: "7 von 10 zufrieden",
banner: "Frischluftzufuhr hat Vorrang",
detail: "CO₂ liegt über 1.000 ppm. Die Fenster öffnen automatisch.",
tone: "danger",
action: "Stoßlüftung gestartet",
reason: "Luft verbraucht. Gesundheitsschutz erzwingt Frischluft."
},
noise: {
co2: 1374,
temperature: 22.5,
noise: 86,
wind: 8,
pm: 9,
window: "Gekippt",
windowOpen: 18,
blinds: 32,
votes: "6 von 10 zufrieden",
banner: "Frischluft, trotz hoher Außenlautstärke",
detail: "CO₂ erfordert Lüften. Der Lärmschutz begrenzt die Öffnung.",
tone: "warning",
action: "Fenster kurz gekippt",
reason: "Luft verbraucht. Fenster nur kurz gekippt wegen Lärm."
},
storm: {
co2: 812,
temperature: 21.8,
noise: 63,
wind: 71,
pm: 12,
window: "Gesperrt",
windowOpen: 0,
blinds: 55,
votes: "8 von 10 zufrieden",
banner: "Fenster wegen Sturm gesperrt",
detail: "Das Kontext-Veto verhindert manuelles und automatisches Öffnen.",
tone: "warning",
action: "Fenster gesichert",
reason: "Sturmschutz aktiv. Fenster bleiben bis zur Entwarnung verriegelt."
},
presentation: {
co2: 784,
temperature: 22.2,
noise: 39,
wind: 10,
pm: 7,
window: "Geschlossen",
windowOpen: 0,
blinds: 100,
votes: "9 von 10 zufrieden",
banner: "Vortragsmodus aktiv",
detail: "Jalousien geschlossen, Raumautomatik bleibt im Hintergrund aktiv.",
tone: "info",
action: "Vortragsmodus gestartet",
reason: "Vortragsmodus aktiviert. Jalousien für bessere Sicht geschlossen."
},
outlier: {
co2: 768,
temperature: 22,
noise: 42,
wind: 8,
pm: 7,
window: "Geschlossen",
windowOpen: 0,
blinds: 32,
votes: "9 angenehm · 1 zu warm",
banner: "Mehrheitswunsch wird gehalten",
detail: "Eine einzelne abweichende Stimme verändert den Zielwert nicht.",
tone: "good",
action: "Zielwert 22 °C gehalten",
reason: "Ausreißer erkannt. Die Mehrheit bewertet 22 °C als angenehm."
} }
}; return id;
const initialHistory = [ }
{ time: "10:18", title: "Zielwerte gehalten", reason: "Raumklima stabil. Keine Anpassung erforderlich.", tone: "good" }, const CLIENT = clientId();
{ time: "09:52", title: "Kurz gelüftet", reason: "Kurz gelüftet. Zielwert 22 °C wird wieder angesteuert.", tone: "info" }, async function apiPost(pfad, daten) {
{ time: "09:31", title: "Temperaturwunsch begrenzt", reason: "Wunsch liegt außerhalb des zulässigen Bereichs.", tone: "warning" } const antwort = await fetch(API_BASIS + pfad, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(daten) });
]; if (!antwort.ok) throw new Error((await antwort.json().catch(() => ({}))).fehler || `HTTP ${antwort.status}`);
}
function zahl(wert, stellen = 0) {
return wert === null || wert === void 0 ? "–" : wert.toLocaleString("de-DE", { minimumFractionDigits: stellen, maximumFractionDigits: stellen });
}
const VOTE_IDS = { cooler: "kuehler", good: "angenehm", warmer: "waermer" };
const LICHT_IDS = { darker: "dunkler", ok: "passt", brighter: "heller" };
function Icon({ name, size = 20 }) { function Icon({ name, size = 20 }) {
const paths = { const paths = {
air: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ air: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
@ -14461,100 +14378,100 @@ function formatCountdown(ms) {
const seconds = total % 60; const seconds = total % 60;
return `${hours > 0 ? `${String(hours).padStart(2, "0")}:` : ""}${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}`; return `${hours > 0 ? `${String(hours).padStart(2, "0")}:` : ""}${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}`;
} }
function Verbindungshinweis({ fehler }) {
return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "status-banner tone-danger", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "status-symbol", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "info", size: 24 }) }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "status-copy", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "status-title", children: "Backend nicht erreichbar" }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "status-detail", children: [
"Bitte backend/start_node.bat starten (bzw. node backend/server.js). ",
fehler
] })
] })
] });
}
function App() { function App() {
const [role, setRole] = reactExports.useState("dozent"); const [role, setRole] = reactExports.useState(() => {
const [scenario, setScenario] = reactExports.useState("normal"); try {
return localStorage.getItem("ambient-rolle") || "studierende";
} catch {
return "studierende";
}
});
const [z, setZ] = reactExports.useState(null);
const [offset, setOffset] = reactExports.useState(0);
const [fehler, setFehler] = reactExports.useState(null);
const [demoOpen, setDemoOpen] = reactExports.useState(true); const [demoOpen, setDemoOpen] = reactExports.useState(true);
const [duration, setDuration] = reactExports.useState(60);
const [presentationEnd, setPresentationEnd] = reactExports.useState(null);
const [now, setNow] = reactExports.useState(/* @__PURE__ */ new Date()); const [now, setNow] = reactExports.useState(/* @__PURE__ */ new Date());
const [blindPosition, setBlindPosition] = reactExports.useState(32); const laden = reactExports.useCallback(async () => {
const [automationPause, setAutomationPause] = reactExports.useState(null); try {
const [history, setHistory] = reactExports.useState(initialHistory); const antwort = await fetch(`${API_BASIS}/api/zustand?client=${encodeURIComponent(CLIENT)}`, { cache: "no-store" });
const [userVote, setUserVote] = reactExports.useState(null); if (!antwort.ok) throw new Error(`HTTP ${antwort.status}`);
const state = states[scenario]; const daten = await antwort.json();
const presentationActive = presentationEnd !== null && presentationEnd.getTime() > now.getTime(); setOffset(Date.parse(daten.jetzt) - Date.now());
const pauseActive = automationPause !== null && automationPause.getTime() > now.getTime(); setZ(daten);
const effectiveBlinds = presentationActive && !pauseActive ? 100 : blindPosition; setFehler(null);
const presentationUntil = presentationEnd ? formatTime(presentationEnd) : ""; } catch (e) {
const voteCounts = reactExports.useMemo(() => { setFehler(e.message);
const counts = scenario === "outlier" ? { cooler: 0, good: 9, warmer: 0 } : { cooler: 1, good: 7, warmer: 1 }; }
if (userVote) counts[userVote] += 1;
return counts;
}, [scenario, userVote]);
const voteTotal = voteCounts.cooler + voteCounts.good + voteCounts.warmer;
reactExports.useEffect(() => {
const timer = window.setInterval(() => setNow(/* @__PURE__ */ new Date()), 1e3);
return () => window.clearInterval(timer);
}, []); }, []);
reactExports.useEffect(() => { reactExports.useEffect(() => {
if (presentationEnd && presentationEnd.getTime() <= now.getTime()) { laden();
setPresentationEnd(null); const abfrage = window.setInterval(laden, ABFRAGE_MS);
setBlindPosition(32); const uhr = window.setInterval(() => setNow(/* @__PURE__ */ new Date()), 1e3);
if (scenario === "presentation") setScenario("normal"); return () => {
setHistory((items) => [{ window.clearInterval(abfrage);
time: formatTime(now), window.clearInterval(uhr);
title: "Vortragsmodus beendet", };
reason: "Die eingestellte Dauer ist abgelaufen. Die reguläre Raumautomatik übernimmt.", }, [laden]);
tone: "info" const senden = (pfad, daten) => apiPost(pfad, daten).then(laden).catch((e) => setFehler(e.message));
}, ...items].slice(0, 6)); if (!z) {
} return /* @__PURE__ */ jsxRuntimeExports.jsx("main", { className: "app-shell", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "page", children: fehler ? /* @__PURE__ */ jsxRuntimeExports.jsx(Verbindungshinweis, { fehler }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "subtitle", children: "Verbinde mit dem Backend …" }) }) });
}, [now, presentationEnd, scenario]); }
const priority = reactExports.useMemo(() => { const d = z.entscheidung;
if (state.co2 > 1e3) return { number: 1, label: "Gesundheit", icon: "air" }; const w = z.werte;
if (scenario === "storm") return { number: 2, label: "Kontext-Veto", icon: "shield" }; const g = z.grenzwerte;
if (scenario === "outlier") return { number: 3, label: "Mehrheit", icon: "people" }; const co2 = w.eco2.wert;
return { number: 4, label: "Energie", icon: "energy" }; const temperature = w.temperatur.wert;
}, [scenario, state.co2]); const noise = w.laerm.wert;
const chooseScenario = (id) => { const wind = w.wind.wert;
const next = states[id]; const ziel = d.zielTemperatur;
setScenario(id); const co2High = co2 !== null && co2 > g.co2Ppm;
setBlindPosition(next.blinds); const serverNow = now.getTime() + offset;
if (id === "presentation") { const presentationActive = z.vortrag.aktiv;
const end = new Date(Date.now() + duration * 6e4); const presentationEnd = presentationActive ? new Date(Date.parse(z.vortrag.ende) - offset) : null;
setPresentationEnd(end); const presentationUntil = presentationEnd ? formatTime(presentationEnd) : "";
} else { const restMs = presentationActive ? Date.parse(z.vortrag.ende) - serverNow : 0;
setPresentationEnd(null); const pauseUntil = z.jalousiePause ? new Date(Date.parse(z.jalousiePause.bis) - offset) : null;
} const effectiveBlinds = d.jalousie;
setAutomationPause(null); const duration = z.vortrag.dauerMinuten;
setUserVote(null); const priority = d.prioritaet;
setHistory((items) => [ const tone = d.status.ton;
{ time: formatTime(/* @__PURE__ */ new Date()), title: next.action, reason: next.reason, tone: next.tone }, const statusTitle = d.status.titel === "Vortragsmodus aktiv" && presentationActive ? `Vortragsmodus aktiv bis ${presentationUntil}` : d.status.titel;
...items const t = z.stimmen.temperatur;
].slice(0, 6)); const voteCounts = { cooler: t.kuehler, good: t.angenehm, warmer: t.waermer };
}; const voteTotal = voteCounts.cooler + voteCounts.good + voteCounts.warmer;
const togglePresentation = () => { const userVote = Object.keys(VOTE_IDS).find((k) => z.stimmen.eigene && VOTE_IDS[k] === z.stimmen.eigene.temperatur) || null;
if (presentationActive) { const l = z.stimmen.licht;
setPresentationEnd(null); const lightCounts = { darker: l.dunkler, ok: l.passt, brighter: l.heller };
setBlindPosition(32); const userLight = Object.keys(LICHT_IDS).find((k) => z.stimmen.eigene && LICHT_IDS[k] === z.stimmen.eigene.licht) || null;
setHistory((items) => [{ time: formatTime(/* @__PURE__ */ new Date()), title: "Vortragsmodus beendet", reason: "Die reguläre Raumautomatik ist wieder aktiv.", tone: "info" }, ...items].slice(0, 6)); const tempInTarget = temperature !== null && Math.abs(temperature - ziel) <= 1;
} else { const tempState = temperature === null ? "Keine Daten" : tempInTarget ? "Im Ziel" : temperature > ziel ? "Zu warm" : "Zu kalt";
const end = new Date(Date.now() + duration * 6e4); const windowOpen = d.fenster.oeffnung;
setPresentationEnd(end); const windowText = d.fenster.text + (d.lueftung > 0 ? " · Lüftung an" : "") + (d.heizung > 0 ? " · Heizung an" : "");
setBlindPosition(100); const letzterMesswert = z.letzterMesswert ? formatTime(new Date(z.letzterMesswert.zeit)) : null;
setHistory((items) => [{ time: formatTime(/* @__PURE__ */ new Date()), title: "Vortragsmodus gestartet", reason: `Jalousien bis ${formatTime(end)} geschlossen. Schutzregeln bleiben aktiv.`, tone: "info" }, ...items].slice(0, 6)); const vote = (id) => senden("/api/stimme", { client: CLIENT, rolle: role, temperatur: VOTE_IDS[id] });
} const voteLight = (id) => senden("/api/stimme", { client: CLIENT, rolle: role, licht: LICHT_IDS[id] });
}; const chooseScenario = (id) => senden("/api/szenario", { id });
const changeDuration = (minutes) => { const togglePresentation = () => senden("/api/vortragsmodus", { rolle: role, aktiv: !presentationActive });
setDuration(minutes); const changeDuration = (minutes) => senden("/api/vortragsmodus", { rolle: role, dauerMinuten: minutes });
if (presentationActive) { const moveBlinds = (position) => senden("/api/jalousie", { rolle: role, position });
setPresentationEnd(new Date(Date.now() + minutes * 6e4));
}
};
const moveBlinds = (position) => {
const pauseEnd = new Date(Date.now() + 30 * 6e4);
setBlindPosition(position);
setAutomationPause(pauseEnd);
setHistory((items) => [{
time: formatTime(/* @__PURE__ */ new Date()),
title: position === 100 ? "Jalousien manuell geschlossen" : "Jalousien manuell geöffnet",
reason: `Automatik für 30 Minuten pausiert, bis ${formatTime(pauseEnd)}.`,
tone: "warning"
}, ...items].slice(0, 6));
};
const chooseRole = (nextRole) => { const chooseRole = (nextRole) => {
setRole(nextRole); setRole(nextRole);
setUserVote(null); try {
localStorage.setItem("ambient-rolle", nextRole);
} catch {
}
}; };
return /* @__PURE__ */ jsxRuntimeExports.jsxs("main", { className: "app-shell", children: [ return /* @__PURE__ */ jsxRuntimeExports.jsxs("main", { className: "app-shell", children: [
/* @__PURE__ */ jsxRuntimeExports.jsxs("header", { className: "topbar", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("header", { className: "topbar", children: [
@ -14571,10 +14488,11 @@ function App() {
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "live-status", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "live-status", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "live-dot" }), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "live-dot" }),
" System aktiv" fehler ? " Verbindung unterbrochen" : z.sensorOnline ? " Sensor live" : " Sensor offline"
] }) ] })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "page", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "page", children: [
fehler && /* @__PURE__ */ jsxRuntimeExports.jsx(Verbindungshinweis, { fehler }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "page-heading", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "page-heading", children: [
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "eyebrow", children: "Seminarraum 2.14" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "eyebrow", children: "Seminarraum 2.14" }),
@ -14588,14 +14506,17 @@ function App() {
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "outside-chip", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "outside-chip", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "temperature" }), /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "temperature" }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: "14 °C" }), /* @__PURE__ */ jsxRuntimeExports.jsxs("b", { children: [
zahl(w.aussenTemperatur.wert),
" °C"
] }),
" außen" " außen"
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "divider" }), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "divider" }),
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "wind" }), /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "wind" }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
/* @__PURE__ */ jsxRuntimeExports.jsxs("b", { children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("b", { children: [
state.wind, zahl(wind),
" km/h" " km/h"
] }), ] }),
" Wind" " Wind"
@ -14615,21 +14536,21 @@ function App() {
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "countdown-small", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "countdown-small", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "clock", size: 16 }), /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "clock", size: 16 }),
" ", " ",
formatCountdown(presentationEnd.getTime() - now.getTime()) formatCountdown(restMs)
] }) ] })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: `status-banner tone-${state.tone}`, children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: `status-banner tone-${tone}`, children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "status-symbol", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: state.tone === "good" ? "check" : state.tone === "info" ? "presentation" : "info", size: 24 }) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "status-symbol", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: tone === "good" ? "check" : tone === "info" ? "presentation" : "info", size: 24 }) }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "status-copy", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "status-copy", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "status-title", children: presentationActive && state.co2 <= 1e3 && scenario !== "storm" ? `Vortragsmodus aktiv bis ${presentationUntil}` : state.banner }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "status-title", children: statusTitle }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "status-detail", children: state.detail }) /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "status-detail", children: d.status.detail })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "priority-chip", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "priority-chip", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: priority.icon, size: 16 }), /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: priority.icon, size: 16 }),
" Priorität ", " Priorität ",
priority.number, priority.nummer,
": ", ": ",
priority.label priority.text
] }) ] })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "content-grid", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "content-grid", children: [
@ -14642,22 +14563,26 @@ function App() {
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "updated", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "updated", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "live-dot" }), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "live-dot" }),
" Jetzt aktualisiert" fehler ? " Keine Verbindung" : " Jetzt aktualisiert"
] }) ] })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "room-visual", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "room-wall", children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "room-visual", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "room-wall", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ceiling-light one" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ceiling-light one", style: { opacity: 0.35 + 0.65 * d.licht } }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ceiling-light two" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ceiling-light two", style: { opacity: 0.35 + 0.65 * d.licht } }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "screen", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "screen", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "screen-title", children: "RAUM 2.14" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "screen-title", children: "RAUM 2.14" }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "screen-temp", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "screen-temp", children: [
state.temperature.toFixed(1).replace(".", ","), zahl(temperature, 1),
"°" "°"
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "screen-note", children: "Zielwert 22 °C" }) /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "screen-note", children: [
"Zielwert ",
zahl(ziel, ziel % 1 ? 1 : 0),
" °C"
] })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "window-unit left-window", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "window-unit left-window", children: [
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `window-panel open-${state.windowOpen > 0 ? "yes" : "no"}`, children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `window-panel open-${windowOpen > 0 ? "yes" : "no"}`, children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("span", {}), /* @__PURE__ */ jsxRuntimeExports.jsx("span", {}),
/* @__PURE__ */ jsxRuntimeExports.jsx("span", {}), /* @__PURE__ */ jsxRuntimeExports.jsx("span", {}),
/* @__PURE__ */ jsxRuntimeExports.jsx("span", {}) /* @__PURE__ */ jsxRuntimeExports.jsx("span", {})
@ -14665,14 +14590,14 @@ function App() {
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "blind-overlay", style: { height: `${effectiveBlinds}%` } }) /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "blind-overlay", style: { height: `${effectiveBlinds}%` } })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "window-unit right-window", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "window-unit right-window", children: [
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `window-panel open-${state.windowOpen > 0 ? "yes" : "no"}`, children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `window-panel open-${windowOpen > 0 ? "yes" : "no"}`, children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("span", {}), /* @__PURE__ */ jsxRuntimeExports.jsx("span", {}),
/* @__PURE__ */ jsxRuntimeExports.jsx("span", {}), /* @__PURE__ */ jsxRuntimeExports.jsx("span", {}),
/* @__PURE__ */ jsxRuntimeExports.jsx("span", {}) /* @__PURE__ */ jsxRuntimeExports.jsx("span", {})
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "blind-overlay", style: { height: `${effectiveBlinds}%` } }) /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "blind-overlay", style: { height: `${effectiveBlinds}%` } })
] }), ] }),
state.windowOpen > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "airflow", children: [ windowOpen > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "airflow", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "→" }), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "→" }),
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "→" }), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "→" }),
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "→" }) /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "→" })
@ -14692,9 +14617,9 @@ function App() {
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "teacher-desk" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "teacher-desk" }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "room-label window-label", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "room-label window-label", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: state.window === "Gesperrt" ? "lock" : "air", size: 15 }), /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: d.fenster.gesperrt ? "lock" : "air", size: 15 }),
" Fenster: ", " Fenster: ",
state.window windowText
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "room-label blind-label", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "room-label blind-label", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "blinds", size: 15 }), /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "blinds", size: 15 }),
@ -14705,69 +14630,77 @@ function App() {
] }) }) ] }) })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "measure-grid", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "measure-grid", children: [
/* @__PURE__ */ jsxRuntimeExports.jsxs("article", { className: `metric-card ${state.co2 > 1e3 ? "metric-alert" : ""}`, children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("article", { className: `metric-card ${co2High ? "metric-alert" : ""}`, children: [
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-top", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-top", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "air" }) }), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "air" }) }),
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-state", children: state.co2 > 1e3 ? "Zu hoch" : "Gut" }) /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-state", children: co2 === null ? "Keine Daten" : co2High ? "Zu hoch" : "Gut" })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-label", children: "Luftqualität" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-label", children: "Luftqualität" }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-value", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-value", children: [
state.co2.toLocaleString("de-DE"), zahl(co2),
" ", " ",
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: "ppm" }) /* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: "ppm" })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-bar", children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { style: { width: `${Math.min(100, state.co2 / 15)}%` } }) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-bar", children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { style: { width: `${Math.min(100, (co2 || 0) / 15)}%` } }) }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-foot", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-foot", children: [
"Grenzwert 1.000 ppm ", "Grenzwert ",
zahl(g.co2Ppm),
" ppm ",
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "lock", size: 13 }) /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "lock", size: 13 })
] }) ] })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("article", { className: "metric-card", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("article", { className: "metric-card", children: [
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-top", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-top", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "temperature" }) }), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "temperature" }) }),
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-state", children: "Im Ziel" }) /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-state", children: tempState })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-label", children: "Temperatur" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-label", children: "Temperatur" }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-value", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-value", children: [
state.temperature.toFixed(1).replace(".", ","), zahl(temperature, 1),
" ", " ",
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: "°C" }) /* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: "°C" })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-bar neutral", children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { style: { width: "61%" } }) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-bar neutral", children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { style: { width: `${temperature === null ? 0 : Math.min(100, Math.max(0, (temperature - 15) / 15 * 100))}%` } }) }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-foot", children: "Zielbereich 21–23 °C" }) /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-foot", children: [
"Zielbereich ",
zahl(ziel - 1, ziel % 1 ? 1 : 0),
"–",
zahl(ziel + 1, ziel % 1 ? 1 : 0),
" °C"
] })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("article", { className: `metric-card ${state.noise > 75 ? "metric-warning" : ""}`, children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("article", { className: `metric-card ${d.vetos.laerm ? "metric-warning" : ""}`, children: [
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-top", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-top", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "volume" }) }), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "volume" }) }),
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-state", children: state.noise > 75 ? "Außen laut" : "Ruhig" }) /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-state", children: noise === null ? "Keine Daten" : d.vetos.laerm ? "Außen laut" : "Ruhig" })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-label", children: "Außenlärm" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-label", children: "Außenlärm" }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-value", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-value", children: [
state.noise, zahl(noise),
" ", " ",
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: "dB" }) /* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: "dB" })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-bar", children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { style: { width: `${state.noise}%` } }) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-bar", children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { style: { width: `${Math.min(100, noise || 0)}%` } }) }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-foot", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-foot", children: [
"Öffnung wird ggf. begrenzt ", `Ab ${g.laermDb} dB nur gekippt `,
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "shield", size: 13 }) /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "shield", size: 13 })
] }) ] })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("article", { className: `metric-card ${state.wind > 60 ? "metric-warning" : ""}`, children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("article", { className: `metric-card ${d.vetos.wind ? "metric-warning" : ""}`, children: [
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-top", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-top", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "wind" }) }), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "wind" }) }),
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-state", children: state.wind > 60 ? "Sturm" : "Leicht" }) /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "metric-state", children: wind === null ? "Keine Daten" : d.vetos.wind ? "Sturm" : "Leicht" })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-label", children: "Wind" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-label", children: "Wind" }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-value", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-value", children: [
state.wind, zahl(wind),
" ", " ",
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: "km/h" }) /* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: "km/h" })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-bar", children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { style: { width: `${Math.min(100, state.wind)}%` } }) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "metric-bar", children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { style: { width: `${Math.min(100, wind || 0)}%` } }) }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-foot", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "metric-foot", children: [
"Feinstaub ", "Feinstaub ",
state.pm, zahl(w.feinstaub.wert),
" µg/m³" " µg/m³"
] }) ] })
] }) ] })
@ -14795,7 +14728,7 @@ function App() {
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "countdown-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "clock" }) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "countdown-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "clock" }) }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Verbleibende Zeit" }), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Verbleibende Zeit" }),
/* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: formatCountdown(presentationEnd.getTime() - now.getTime()) }) /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: formatCountdown(restMs) })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "until", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "until", children: [
"bis ", "bis ",
@ -14812,10 +14745,10 @@ function App() {
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { className: "icon-button", onClick: () => moveBlinds(100), title: "Jalousien schließen", children: "↓" }) /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { className: "icon-button", onClick: () => moveBlinds(100), title: "Jalousien schließen", children: "↓" })
] }) ] })
] }), ] }),
pauseActive && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pause-note", children: [ pauseUntil && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "pause-note", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "clock", size: 15 }), /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "clock", size: 15 }),
" Automatik pausiert bis ", " Automatik pausiert bis ",
formatTime(automationPause) formatTime(pauseUntil)
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "guard-note", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "guard-note", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "shield", size: 17 }), /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "shield", size: 17 }),
@ -14839,7 +14772,7 @@ function App() {
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vote-question", children: "Wie fühlt sich der Raum für dich an?" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vote-question", children: "Wie fühlt sich der Raum für dich an?" }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vote-actions", "aria-label": "Raumtemperatur bewerten", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vote-actions", "aria-label": "Raumtemperatur bewerten", children: [
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { className: `vote-button cooler ${userVote === "cooler" ? "active" : ""}`, onClick: () => setUserVote("cooler"), children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { className: `vote-button cooler ${userVote === "cooler" ? "active" : ""}`, onClick: () => vote("cooler"), children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "vote-arrow", children: "↓" }), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "vote-arrow", children: "↓" }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: "Kühler" }), /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: "Kühler" }),
@ -14847,7 +14780,7 @@ function App() {
] }), ] }),
userVote === "cooler" && /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "check", size: 14 }) userVote === "cooler" && /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "check", size: 14 })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { className: `vote-button pleasant ${userVote === "good" ? "active" : ""}`, onClick: () => setUserVote("good"), children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { className: `vote-button pleasant ${userVote === "good" ? "active" : ""}`, onClick: () => vote("good"), children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "vote-face", children: "—" }), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "vote-face", children: "—" }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: "Angenehm" }), /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: "Angenehm" }),
@ -14855,7 +14788,7 @@ function App() {
] }), ] }),
userVote === "good" && /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "check", size: 14 }) userVote === "good" && /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "check", size: 14 })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { className: `vote-button warmer ${userVote === "warmer" ? "active" : ""}`, onClick: () => setUserVote("warmer"), children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { className: `vote-button warmer ${userVote === "warmer" ? "active" : ""}`, onClick: () => vote("warmer"), children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "vote-arrow", children: "↑" }), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "vote-arrow", children: "↑" }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: "Wärmer" }), /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: "Wärmer" }),
@ -14869,9 +14802,9 @@ function App() {
" Deine Stimme wurde berücksichtigt." " Deine Stimme wurde berücksichtigt."
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vote-bar", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vote-bar", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "cold", style: { width: `${voteCounts.cooler / voteTotal * 100}%` } }), /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "cold", style: { width: `${voteTotal ? voteCounts.cooler / voteTotal * 100 : 0}%` } }),
/* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "good", style: { width: `${voteCounts.good / voteTotal * 100}%` } }), /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "good", style: { width: `${voteTotal ? voteCounts.good / voteTotal * 100 : 0}%` } }),
/* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "warm", style: { width: `${voteCounts.warmer / voteTotal * 100}%` } }) /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: "warm", style: { width: `${voteTotal ? voteCounts.warmer / voteTotal * 100 : 0}%` } })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vote-labels", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vote-labels", children: [
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
@ -14887,6 +14820,19 @@ function App() {
voteCounts.warmer voteCounts.warmer
] }) ] })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vote-question", children: "Und das Licht?" }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vote-actions", "aria-label": "Licht bewerten", children: [
["darker", "cooler", "↓", "Dunkler"],
["ok", "pleasant", "—", "Passt"],
["brighter", "warmer", "↑", "Heller"]
].map(([id, farbe, zeichen, text]) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { className: `vote-button ${farbe} ${userLight === id ? "active" : ""}`, onClick: () => voteLight(id), children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: id === "ok" ? "vote-face" : "vote-arrow", children: zeichen }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: text }),
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: lightCounts[id] })
] }),
userLight === id && /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "check", size: 14 })
] }, id)) }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "fairness-note", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "fairness-note", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "info", size: 16 }), /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "info", size: 16 }),
" Die Stimme des Dozenten zählt wie jede andere." " Die Stimme des Dozenten zählt wie jede andere."
@ -14900,16 +14846,16 @@ function App() {
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "history" }) /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "history" })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "timeline", children: history.slice(0, 4).map((entry, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "timeline-row", children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "timeline", children: z.verlauf.slice(0, 4).map((entry, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "timeline-row", children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `timeline-dot ${entry.tone}` }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `timeline-dot ${entry.ton}` }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "timeline-content", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "timeline-content", children: [
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: entry.title }), /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: entry.titel }),
/* @__PURE__ */ jsxRuntimeExports.jsx("time", { children: entry.time }) /* @__PURE__ */ jsxRuntimeExports.jsx("time", { children: entry.uhrzeit })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: entry.reason }) /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: entry.grund })
] }) ] })
] }, `${entry.time}-${entry.title}-${index}`)) }) ] }, `${entry.zeit}-${entry.titel}-${index}`)) })
] }) ] })
] }) ] })
] }), ] }),
@ -14919,20 +14865,20 @@ function App() {
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "demo-spark", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "spark", size: 17 }) }), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "demo-spark", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "spark", size: 17 }) }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: "Demo-Szenarien" }), /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: "Demo-Szenarien" }),
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: "Systemreaktionen direkt simulieren" }) /* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: "Werte im Backend überschreiben – gilt auch für den Unity-Zwilling" })
] }) ] })
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "demo-current", children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "demo-current", children: [
"Aktiv: ", "Aktiv: ",
scenarios.find((item) => item.id === scenario)?.label z.szenarien.find((item) => item.id === z.szenario)?.text
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `chevron ${demoOpen ? "up" : ""}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "chevron" }) }) /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `chevron ${demoOpen ? "up" : ""}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "chevron" }) })
] }), ] }),
demoOpen && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "scenario-grid", children: scenarios.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { className: `scenario-button ${scenario === item.id ? "active" : ""}`, onClick: () => chooseScenario(item.id), children: [ demoOpen && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "scenario-grid", children: z.szenarien.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { className: `scenario-button ${z.szenario === item.id ? "active" : ""}`, onClick: () => chooseScenario(item.id), children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "scenario-check", children: scenario === item.id && /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "check", size: 14 }) }), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "scenario-check", children: z.szenario === item.id && /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "check", size: 14 }) }),
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
/* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: item.label }), /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: item.text }),
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: item.description }) /* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: item.beschreibung })
] }) ] })
] }, item.id)) }) ] }, item.id)) })
] }), ] }),
@ -14941,7 +14887,7 @@ function App() {
/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "shield", size: 15 }), /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { name: "shield", size: 15 }),
" Automatische Steuerung nach Gesundheit, Kontext, Mehrheit und Energie" " Automatische Steuerung nach Gesundheit, Kontext, Mehrheit und Energie"
] }), ] }),
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Letzte Sensorkalibrierung: heute, 07:30" }) /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: letzterMesswert ? `Letzter Sensor-Messwert: ${letzterMesswert}` : "Noch kein Sensor-Messwert empfangen" })
] }) ] })
] }) ] })
] }); ] });