mirror of
https://github.com/NeonGamerBot-QK/saahild.com.git
synced 2025-07-20 12:49:04 +00:00
enhancement(lint): Fix lint errors for lib/jsscripts/changing_title.ts
Co-authored-by: NeonGamerBot-QK <neon@saahild.com> Signed-off-by: zeon-neon[bot] <136533918+zeon-neon[bot]@users.noreply.github.com>
This commit is contained in:
parent
9c3821712f
commit
f69c4aa8cb
1 changed files with 28 additions and 27 deletions
|
@ -1,27 +1,28 @@
|
||||||
let title0: null | string = null
|
let title0: null | string = null;
|
||||||
let interId: any = null
|
let interId: any = null;
|
||||||
const isDev = process.env.NODE_ENV !== 'production'
|
const isDev = process.env.NODE_ENV !== "production";
|
||||||
|
|
||||||
export function runTitle() {
|
export function runTitle() {
|
||||||
if (interId) clearInterval(interId)
|
if (interId) clearInterval(interId);
|
||||||
interId = setInterval(() => {
|
interId = setInterval(() => {
|
||||||
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 "
|
window.document.documentElement.className = "duration-500 ease-in-out ";
|
||||||
if (document.hasFocus()) {
|
if (document.hasFocus()) {
|
||||||
|
document.title =
|
||||||
document.title = title0?.toLowerCase() === "react app" ? "Saahild.com" : (title0 ?? "Saahild.com")
|
title0?.toLowerCase() === "react app"
|
||||||
window.document.documentElement.style.filter = ""
|
? "Saahild.com"
|
||||||
|
: (title0 ?? "Saahild.com");
|
||||||
|
window.document.documentElement.style.filter = "";
|
||||||
} else {
|
} else {
|
||||||
document.title = 'Come Back :('
|
document.title = "Come Back :(";
|
||||||
if (!isDev) window.document.documentElement.style.filter = "blur(30px)"
|
if (!isDev) window.document.documentElement.style.filter = "blur(30px)";
|
||||||
}
|
}
|
||||||
}, 200)
|
}, 200);
|
||||||
|
|
||||||
}
|
}
|
||||||
export function stopTitle() {
|
export function stopTitle() {
|
||||||
if (!interId) return false;
|
if (!interId) return false;
|
||||||
return clearInterval(interId)
|
return clearInterval(interId);
|
||||||
}
|
}
|
||||||
// runTitle()
|
// runTitle()
|
Loading…
Add table
Add a link
Reference in a new issue