mirror of
https://github.com/NeonGamerBot-QK/saahild.com.git
synced 2024-11-22 04:43:38 +00:00
Scripts definition
This commit is contained in:
parent
fcc04890fe
commit
04ee7a0588
2 changed files with 24 additions and 1 deletions
|
@ -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 (
|
||||
<div style={{ filter: 'blur(10px)'}}>
|
||||
<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>
|
||||
|
|
|
@ -6,10 +6,13 @@ export function runTitle() {
|
|||
if(document.title !== 'Come Back :(') {
|
||||
title0 = document.title
|
||||
}
|
||||
window.document.documentElement.className = "duration-500 ease-in-out "
|
||||
if (document.hasFocus()) {
|
||||
document.title = title0 || "Saahild.com"
|
||||
window.document.documentElement.style.filter = ""
|
||||
} else {
|
||||
document.title = 'Come Back :('
|
||||
window.document.documentElement.style.filter = "blur(30px)"
|
||||
}
|
||||
}, 200)
|
||||
|
||||
|
|
Loading…
Reference in a new issue