Fix lint errors for src/bg/main.tsx

This commit is contained in:
zeon-neon[bot] 2024-06-18 00:48:59 +00:00 committed by GitHub
parent 43c06bdb8a
commit cd6a228134
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,32 +1,32 @@
import { useEffect, useRef } from "react"; import { useEffect, useRef } from 'react'
import "./style.css"; import './style.css'
export default function Background() { export default function Background () {
const domRef = useRef(null) 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 = ''
}
})
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 () => { return () => {
clearInterval(inter) clearInterval(inter)
} }
}, []); }, [])
return ( return (
<div style={{ filter: 'blur(10px)' }} ref={domRef}> <div style={{ filter: 'blur(10px)' }} ref={domRef}>
<ul className="background"> <ul className='background'>
{new Array(49).join('.').split('.').map((_,i) => { {new Array(49).join('.').split('.').map((_, i) => {
return <li key={i} className={i % 2 === 0 ? "bg-effect" : ""}></li> return <li key={i} className={i % 2 === 0 ? 'bg-effect' : ''} />
})} })}
</ul> </ul>
</div> </div>
) )
} }