mirror of
https://github.com/NeonGamerBot-QK/saahild.com.git
synced 2024-11-13 00:42:23 +00:00
Fix lint errors for src/bg/main.tsx
This commit is contained in:
parent
43c06bdb8a
commit
cd6a228134
1 changed files with 26 additions and 26 deletions
|
@ -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>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue