mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-24 01:24:44 +00:00
STUPID SEXY TIMELINE (#16420)
This commit is contained in:
9
packages/ui/src/hooks/use-reduced-motion.ts
Normal file
9
packages/ui/src/hooks/use-reduced-motion.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { createSignal } from "solid-js"
|
||||
|
||||
export const prefersReducedMotion = /* @__PURE__ */ (() => {
|
||||
if (typeof window === "undefined") return () => false
|
||||
const mql = window.matchMedia("(prefers-reduced-motion: reduce)")
|
||||
const [reduced, setReduced] = createSignal(mql.matches)
|
||||
mql.addEventListener("change", () => setReduced(mql.matches))
|
||||
return reduced
|
||||
})()
|
||||
Reference in New Issue
Block a user