mirror of
https://github.com/NeonGamerBot-QK/saahild.com.git
synced 2024-11-22 04:43:38 +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 "./style.css";
|
||||
import { useEffect, useRef } from 'react'
|
||||
import './style.css'
|
||||
|
||||
export default function Background() {
|
||||
const domRef = useRef(null)
|
||||
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 = "";
|
||||
}
|
||||
})
|
||||
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)
|
||||
clearInterval(inter)
|
||||
}
|
||||
}, []);
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div style={{ filter: 'blur(10px)' }} ref={domRef}>
|
||||
<ul className="background">
|
||||
{new Array(49).join('.').split('.').map((_,i) => {
|
||||
return <li key={i} className={i % 2 === 0 ? "bg-effect" : ""}></li>
|
||||
})}
|
||||
</ul>
|
||||
</div>
|
||||
<div style={{ filter: 'blur(10px)' }} ref={domRef}>
|
||||
<ul className='background'>
|
||||
{new Array(49).join('.').split('.').map((_, i) => {
|
||||
return <li key={i} className={i % 2 === 0 ? 'bg-effect' : ''} />
|
||||
})}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
Loading…
Reference in a new issue