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