mirror of
https://github.com/NeonGamerBot-QK/saahild.com.git
synced 2025-07-20 04:39:04 +00:00
commit zeon:ai_comments
This commit is contained in:
parent
43aa586dff
commit
ea762d0060
9 changed files with 396 additions and 3 deletions
27
lib/jsscripts/changing_title.ts
Normal file
27
lib/jsscripts/changing_title.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
let title0: null | string = null
|
||||
let interId: any = null
|
||||
const isDev = process.env.NODE_ENV !== 'production'
|
||||
|
||||
export function runTitle() {
|
||||
if (interId) clearInterval(interId)
|
||||
interId = setInterval(() => {
|
||||
if (document.title !== 'Come Back :(') {
|
||||
title0 = document.title
|
||||
}
|
||||
window.document.documentElement.className = "duration-500 ease-in-out "
|
||||
if (document.hasFocus()) {
|
||||
|
||||
document.title = title0?.toLowerCase() === "react app" ? "Saahild.com" : (title0 ?? "Saahild.com")
|
||||
window.document.documentElement.style.filter = ""
|
||||
} else {
|
||||
document.title = 'Come Back :('
|
||||
if (!isDev) window.document.documentElement.style.filter = "blur(30px)"
|
||||
}
|
||||
}, 200)
|
||||
|
||||
}
|
||||
export function stopTitle() {
|
||||
if (!interId) return false;
|
||||
return clearInterval(interId)
|
||||
}
|
||||
// runTitle()
|
Loading…
Add table
Add a link
Reference in a new issue