P42 Dashboard: erster Stand
FastAPI-Backend und React-Frontend mit Konten, Sendungsverfolgung, Projekt-Artikeln, Vorrat & Einkauf mit Rezeptabgleich, Reise-Weltkarte, Kanban-Projekten mit Priorität, Server-Monitoring und den Designs Matrix und Blackwall. Betrieb per Docker hinter nginx (siehe DEPLOY.md). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
dd58b3d1f8
75 files changed
+11418
No files matched your search
@@ -0,0 +1,30 @@
|
||||
// Schalter für Hintergrund-Animationen (Matrix-Regen, blinkender Cursor), pro Browser gemerkt.
|
||||
// Bei "Bewegung reduzieren" im System ist die Animation ohnehin aus.
|
||||
const KEY = 'p42.calm';
|
||||
const EVENT = 'p42:motion';
|
||||
|
||||
const systemReduced = () => window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||
|
||||
export function isCalm() {
|
||||
if (systemReduced()) return true;
|
||||
try { return localStorage.getItem(KEY) === '1'; } catch { return false; }
|
||||
}
|
||||
|
||||
export function setCalm(calm) {
|
||||
try { localStorage.setItem(KEY, calm ? '1' : '0'); } catch { /* ignorieren */ }
|
||||
apply();
|
||||
}
|
||||
|
||||
export function onMotionChange(fn) {
|
||||
window.addEventListener(EVENT, fn);
|
||||
return () => window.removeEventListener(EVENT, fn);
|
||||
}
|
||||
|
||||
export const motionLocked = systemReduced;
|
||||
|
||||
function apply() {
|
||||
document.documentElement.classList.toggle('calm', isCalm());
|
||||
window.dispatchEvent(new Event(EVENT));
|
||||
}
|
||||
|
||||
apply();
|
||||
Reference in new issue
Block a user