Fix lint errors for src/scripts/oneko_easteregg.ts

This commit is contained in:
zeon-neon[bot] 2024-08-02 14:47:12 +00:00 committed by GitHub
parent 574772205f
commit 4aa6179dae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,26 +1,26 @@
import "./easteregg.css" import './easteregg.css'
export function startEasterEgg() { export function startEasterEgg () {
const el = document.createElement('div') const el = document.createElement('div')
el.innerHTML = "" el.innerHTML = ''
el.className = `easter-egg hidden` el.className = `easter-egg hidden`
document.body.append(el) document.body.append(el)
return { return {
destroy: () => { destroy: () => {
el.remove() el.remove()
}, },
toggle: () => el.classList.toggle('hidden') toggle: () => el.classList.toggle('hidden')
}
} }
} export function listenForEasterEgg () {
export function listenForEasterEgg() { const oneko2 = startEasterEgg()
const oneko2 = startEasterEgg() window.addEventListener('keydown', (k) => {
window.addEventListener('keydown', (k) => {
if(k.shiftKey && k.altKey) oneko2.toggle()
})
window.addEventListener('keyup', (k) => {
if (k.shiftKey && k.altKey) oneko2.toggle() if (k.shiftKey && k.altKey) oneko2.toggle()
}) })
window.addEventListener('keyup', (k) => {
if (k.shiftKey && k.altKey) oneko2.toggle()
})
} }
// expose to window // expose to window
// LATER: there is a way to type this im just lazy atm // LATER: there is a way to type this im just lazy atm
//@ts-ignore // @ts-ignore
window.easter_egg = startEasterEgg window.easter_egg = startEasterEgg