Files
SnowLuma/.pnpm-store/v11/files/e8/089df02c0e13e4a1904610b77517382caa6c29a311bb561b79e9c02b1ca58f42d4c7eb7af6634177f2b6f1800dd7124dc451116622b02c2784d3b620a58380
TanTan 2a69b23b47
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

21 lines
778 B
Plaintext

import { hasReducedMotionListener, prefersReducedMotion } from './state.mjs';
const isBrowser = typeof window !== "undefined";
function initPrefersReducedMotion() {
hasReducedMotionListener.current = true;
if (!isBrowser)
return;
if (window.matchMedia) {
const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)");
const setReducedMotionPreferences = () => (prefersReducedMotion.current = motionMediaQuery.matches);
motionMediaQuery.addEventListener("change", setReducedMotionPreferences);
setReducedMotionPreferences();
}
else {
prefersReducedMotion.current = false;
}
}
export { hasReducedMotionListener, initPrefersReducedMotion, prefersReducedMotion };
//# sourceMappingURL=index.mjs.map