diff --git a/src/bg/main.tsx b/src/bg/main.tsx index 85fcdcf3..8ed82189 100644 --- a/src/bg/main.tsx +++ b/src/bg/main.tsx @@ -1,7 +1,27 @@ +import { useEffect, useRef } from "react"; import "./style.css"; + export default function Background() { +const domRef = useRef(null) + + useEffect (() => { + const inter = setInterval(() => { +if(document.hasFocus() && domRef.current) { + //@ts-expect-error + domRef.current.style.filter = "blur(10px)" +} else { + //@ts-ignore + domRef.current.style.filter = ""; +} + }) + + return () => { + clearInterval(inter) + } + }, []); + return ( -
+