adventskalender/shared/js/lock.js aktualisiert
This commit is contained in:
@@ -52,18 +52,28 @@ function _checkDoorUnlocked(day) {
|
||||
// DEV-Konsole aufbauen (nur bei ?dev)
|
||||
// ===============================
|
||||
function createDevConsole() {
|
||||
// schauen, ob schon ein Reset-Button existiert (von save-progress.js)
|
||||
const existingReset = document.getElementById("dev-reset");
|
||||
// gemeinsames Panel holen oder anlegen
|
||||
let panel = document.getElementById("dev-panel");
|
||||
if (!panel) {
|
||||
panel = document.createElement("div");
|
||||
panel.id = "dev-panel";
|
||||
panel.style.cssText = `
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
right: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
z-index: 9999;
|
||||
`;
|
||||
document.body.appendChild(panel);
|
||||
}
|
||||
|
||||
const box = document.createElement("div");
|
||||
box.className = "dev-console";
|
||||
box.style.cssText = `
|
||||
background: rgba(0,0,0,0.8);
|
||||
color: #f1e1a6;
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
right: 10px;
|
||||
z-index: 9999;
|
||||
padding: 10px;
|
||||
border: 1px solid #c8aa49;
|
||||
border-radius: 8px;
|
||||
@@ -98,7 +108,6 @@ function createDevConsole() {
|
||||
`;
|
||||
b.onclick = () => {
|
||||
localStorage.setItem(`${STORAGE_BASE}_simday`, String(i));
|
||||
// Anzeige bleibt nur korrekt, wenn wir neu laden
|
||||
location.reload();
|
||||
};
|
||||
grid.appendChild(b);
|
||||
@@ -147,14 +156,8 @@ function createDevConsole() {
|
||||
|
||||
box.appendChild(actions);
|
||||
|
||||
// An passender Stelle einfügen
|
||||
if (existingReset) {
|
||||
existingReset.insertAdjacentElement("afterend", box);
|
||||
// etwas Abstand, damit sich Reset und Dev nicht überlagern
|
||||
box.style.bottom = "60px";
|
||||
} else {
|
||||
document.body.appendChild(box);
|
||||
}
|
||||
// endgültig ins Panel
|
||||
panel.appendChild(box);
|
||||
}
|
||||
|
||||
// ===============================
|
||||
|
||||
Reference in New Issue
Block a user