From a2937cc17b284384abc0d3d982cea46b7ee5c8d7 Mon Sep 17 00:00:00 2001 From: nessi Date: Tue, 3 Feb 2026 09:34:08 +0100 Subject: [PATCH] Add a help modal to the application. A new modal for help has been implemented to guide users in navigating the app. It includes detailed instructions, explanations for status symbols and note-taking, and is accessible via a new "Help" button in the UI. Styling updates and utility functions for the modal have also been added. --- frontend/src/App.jsx | 185 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 176 insertions(+), 9 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 292ab8f..fb7a2ab 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -89,9 +89,9 @@ function AdminPanel() { {open && (
e.stopPropagation()}> -
+
Neuen User anlegen
- +
@@ -144,6 +144,9 @@ export default function App() { const [gameId, setGameId] = useState(null); const [sheet, setSheet] = useState(null); + // ✅ Hilfe Modal State + const [helpOpen, setHelpOpen] = useState(false); + const load = async () => { const m = await api("/auth/me"); setMe(m); @@ -300,6 +303,8 @@ export default function App() { return "#20140c"; }; + const closeHelp = () => setHelpOpen(false); + return (
@@ -317,14 +322,15 @@ export default function App() { {me.role === "admin" && } + {/* Spiel + Hilfe */}
Spiel
-
+
+ +
+ {/* Hilfe Modal */} + {helpOpen && ( +
+
e.stopPropagation()}> +
+
Hilfe
+ +
+ +
+
1) Namen anklicken (Status)
+
+ Tippe auf einen Namen, um den Status zu wechseln. Reihenfolge: +
+ +
+
+ +
Grün = bestätigt / fix richtig
+
+
+ X +
Rot = ausgeschlossen / fix falsch
+
+
+ ? +
Grau = unsicher / „vielleicht“
+
+
+ +
Leer = unknown / noch nicht bewertet
+
+
+ +
+ +
2) i / m / s Button (Notiz)
+
+ Rechts pro Zeile gibt es einen Button, der durch diese Werte rotiert: +
+ +
+
+ i +
i = „Ich habe diese Geheimkarte“
+
+
+ m +
m = „Geheimkarte aus dem mittleren Deck“
+
+
+ s +
s = „Ein anderer Spieler hat diese Karte“
+
+
+ +
= keine Notiz
+
+
+ +
+ +
+ + Tipp: Jeder Spieler sieht nur seine eigenen Notizen – andere Spieler können nicht in deinen Zettel schauen. +
+
+
+
+ )} + + {/* Sheet */}
{sections.map((sec) => (
@@ -350,7 +437,6 @@ export default function App() { background: getRowBg(e.status), }} > - {/* ✅ Klick Cycle */}
cycleStatus(e)} style={{ @@ -364,12 +450,10 @@ export default function App() { {e.label}
- {/* ✅ NUR 1 Status-Spalte */}
{getStatusSymbol(e.status)}
- {/* i/m/s */} @@ -437,7 +521,7 @@ const styles = { }, row: { display: "grid", - gridTemplateColumns: "1fr 46px 56px", // ✅ Name | Status | i/m/s + gridTemplateColumns: "1fr 46px 56px", gap: 8, padding: "10px 12px", alignItems: "center", @@ -463,6 +547,15 @@ const styles = { background: "linear-gradient(180deg, rgba(255,255,255,0.55), rgba(0,0,0,0.06))", cursor: "pointer", }, + helpBtn: { + padding: "10px 12px", + borderRadius: 12, + border: "1px solid rgba(0,0,0,0.25)", + background: "linear-gradient(180deg, rgba(255,255,255,0.75), rgba(0,0,0,0.06))", + fontWeight: 1000, + cursor: "pointer", + whiteSpace: "nowrap", + }, input: { width: "100%", padding: 10, @@ -521,7 +614,7 @@ const styles = { }, modalCard: { width: "100%", - maxWidth: 520, + maxWidth: 560, borderRadius: 18, border: "1px solid rgba(0,0,0,0.25)", background: "linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.42))", @@ -529,4 +622,78 @@ const styles = { padding: 14, backdropFilter: "blur(6px)", }, + modalHeader: { + display: "flex", + justifyContent: "space-between", + alignItems: "center", + gap: 10, + }, + modalCloseBtn: { + width: 38, + height: 38, + borderRadius: 12, + border: "1px solid rgba(0,0,0,0.25)", + background: "linear-gradient(180deg, rgba(255,255,255,0.85), rgba(0,0,0,0.06))", + fontWeight: 1000, + cursor: "pointer", + lineHeight: "38px", + textAlign: "center", + }, + + // Help modal content + helpBody: { + marginTop: 10, + paddingTop: 4, + maxHeight: "70vh", + overflow: "auto", + }, + helpSectionTitle: { + fontWeight: 1000, + color: "#20140c", + marginTop: 10, + marginBottom: 6, + }, + helpText: { + color: "#20140c", + opacity: 0.9, + lineHeight: 1.35, + }, + helpList: { + marginTop: 10, + display: "grid", + gap: 8, + }, + helpListRow: { + display: "grid", + gridTemplateColumns: "42px 1fr", + gap: 10, + alignItems: "center", + }, + helpBadge: { + display: "inline-flex", + alignItems: "center", + justifyContent: "center", + width: 38, + height: 38, + borderRadius: 12, + border: "1px solid rgba(0,0,0,0.18)", + fontWeight: 1100, + fontSize: 18, + }, + helpMiniTag: { + display: "inline-flex", + alignItems: "center", + justifyContent: "center", + width: 38, + height: 38, + borderRadius: 12, + border: "1px solid rgba(0,0,0,0.18)", + background: "rgba(255,255,255,0.55)", + fontWeight: 1100, + }, + helpDivider: { + margin: "14px 0", + height: 1, + background: "rgba(0,0,0,0.12)", + }, };