Anti-Cheat: Tab-Wechsel beendet den Lauf; Admin-Panel breiter
- visibilitychange -> gameOver, sobald der Tab versteckt/gewechselt wird (verhindert das "Pausieren im Hintergrund"-Spicken, da rAF im Hintergrund gedrosselt wird) - Admin .wrap max-width 1000 -> 1240 (Spielertabelle weniger gequetscht) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
body { margin:0; background:var(--bg); color:var(--text); font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif; }
|
body { margin:0; background:var(--bg); color:var(--text); font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif; }
|
||||||
a { color:var(--pink); }
|
a { color:var(--pink); }
|
||||||
h1 { color:var(--pink); margin:0; font-size:22px; }
|
h1 { color:var(--pink); margin:0; font-size:22px; }
|
||||||
.wrap { max-width:1000px; margin:0 auto; padding:18px; }
|
.wrap { max-width:1240px; margin:0 auto; padding:18px; }
|
||||||
input, button, select { font:inherit; }
|
input, button, select { font:inherit; }
|
||||||
input[type=password], input[type=text], input[type=number] {
|
input[type=password], input[type=text], input[type=number] {
|
||||||
background:var(--panel2); border:1px solid var(--border); color:var(--text);
|
background:var(--panel2); border:1px solid var(--border); color:var(--text);
|
||||||
|
|||||||
@@ -165,6 +165,12 @@ function stopModeWatch() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Anti-Cheat: Tab-Wechsel/Verstecken beendet den laufenden Lauf sofort (sonst pausiert
|
||||||
|
// der Browser die Spielschleife im Hintergrund -> man koennte in Ruhe "spicken").
|
||||||
|
document.addEventListener('visibilitychange', () => {
|
||||||
|
if (document.hidden && state && state.running) gameOver();
|
||||||
|
});
|
||||||
|
|
||||||
function fieldSize() {
|
function fieldSize() {
|
||||||
const r = $('field').getBoundingClientRect();
|
const r = $('field').getBoundingClientRect();
|
||||||
return { w: r.width, h: r.height };
|
return { w: r.width, h: r.height };
|
||||||
|
|||||||
Reference in New Issue
Block a user