mirror of
https://github.com/NeonGamerBot-QK/saahild.com.git
synced 2024-11-22 12:43:39 +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";
|
import "./style.css";
|
||||||
|
|
||||||
export default function Background() {
|
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 (
|
return (
|
||||||
<div style={{ filter: 'blur(10px)'}}>
|
<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" : ""}></li>
|
||||||
|
|
|
@ -6,10 +6,13 @@ export function runTitle() {
|
||||||
if(document.title !== 'Come Back :(') {
|
if(document.title !== 'Come Back :(') {
|
||||||
title0 = document.title
|
title0 = document.title
|
||||||
}
|
}
|
||||||
|
window.document.documentElement.className = "duration-500 ease-in-out "
|
||||||
if (document.hasFocus()) {
|
if (document.hasFocus()) {
|
||||||
document.title = title0 || "Saahild.com"
|
document.title = title0 || "Saahild.com"
|
||||||
|
window.document.documentElement.style.filter = ""
|
||||||
} else {
|
} else {
|
||||||
document.title = 'Come Back :('
|
document.title = 'Come Back :('
|
||||||
|
window.document.documentElement.style.filter = "blur(30px)"
|
||||||
}
|
}
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue