Initialisieren

This commit is contained in:
2026-07-23 21:59:15 +02:00
commit 2d961adad4
76 changed files with 14318 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
"use client";
import { useSyncExternalStore } from "react";
const QUERY = "(prefers-reduced-motion: reduce)";
function subscribe(callback: () => void) {
const mq = window.matchMedia(QUERY);
mq.addEventListener("change", callback);
return () => mq.removeEventListener("change", callback);
}
function getSnapshot() {
return window.matchMedia(QUERY).matches;
}
function getServerSnapshot() {
return false;
}
/** true, wenn der Nutzer reduzierte Bewegung wünscht (A11y-Gate). */
export function usePrefersReducedMotion() {
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
}