RFID Implementierung

This commit is contained in:
Carsten Graf
2025-09-20 01:04:00 +02:00
parent 1ed3a30340
commit 7e9705902e
10 changed files with 715 additions and 554 deletions

View File

@@ -15,7 +15,8 @@
<div>
<div class="banner-text">⚠️ Niedrige Batterie erkannt!</div>
<div class="banner-devices" id="battery-devices">
Deine Geräte mit niedriger Batterie: <span id="low-battery-list"></span>
Deine Geräte mit niedriger Batterie:
<span id="low-battery-list"></span>
</div>
</div>
</div>
@@ -47,9 +48,7 @@
<div id="learning-display" class="learning-mode" style="display: none">
<h3>📚 Lernmodus aktiv</h3>
<p>
Drücke jetzt den Button für: <span id="learning-button"></span>
</p>
<p>Drücke jetzt den Button für: <span id="learning-button"></span></p>
</div>
<div class="timer-container">
@@ -193,24 +192,18 @@
}
// Namen-Handling
if (
(data.firstname == "" || data.lastname == "") &&
data.lane == "start1"
) {
if ((data.name == "" || !data.name) && data.lane == "start1") {
name1 = "";
}
if (
(data.firstname == "" || data.lastname == "") &&
data.lane == "start2"
) {
if ((data.name == "" || !data.name) && data.lane == "start2") {
name2 = "";
}
if (data.firstname && data.lastname && data.lane) {
if (data.name && data.lane) {
if (data.lane === "start1") {
name1 = `${data.firstname} ${data.lastname}`;
name1 = data.name;
} else if (data.lane === "start2") {
name2 = `${data.firstname} ${data.lastname}`;
name2 = data.name;
}
updateDisplay();
}
@@ -482,14 +475,17 @@
updateLaneDisplay();
})
.catch((error) =>
console.error("Fehler beim Laden der Lane-Schwierigkeits-Konfiguration:", error)
console.error(
"Fehler beim Laden der Lane-Schwierigkeits-Konfiguration:",
error
)
);
}
function updateLaneDisplay() {
const lane1Title = document.querySelector('.lane h2');
const lane2Title = document.querySelectorAll('.lane h2')[1];
const lane1Title = document.querySelector(".lane h2");
const lane2Title = document.querySelectorAll(".lane h2")[1];
if (laneConfigType === 0) {
// Identische Lanes
lane1Title.textContent = "🏊‍♀️ Bahn 1";
@@ -498,9 +494,11 @@
// Unterschiedliche Lanes
const lane1Icon = lane1DifficultyType === 0 ? "🟢" : "🔴";
const lane2Icon = lane2DifficultyType === 0 ? "🟢" : "🔴";
const lane1Difficulty = lane1DifficultyType === 0 ? "Leicht" : "Schwer";
const lane2Difficulty = lane2DifficultyType === 0 ? "Leicht" : "Schwer";
const lane1Difficulty =
lane1DifficultyType === 0 ? "Leicht" : "Schwer";
const lane2Difficulty =
lane2DifficultyType === 0 ? "Leicht" : "Schwer";
lane1Title.textContent = `${lane1Icon} Bahn 1 (${lane1Difficulty})`;
lane2Title.textContent = `${lane2Icon} Bahn 2 (${lane2Difficulty})`;
}