mirror of
https://github.com/NeonGamerBot-QK/saahild.com.git
synced 2024-11-21 20:33:40 +00:00
Fix lint errors for src/scripts/oneko_easteregg.ts
This commit is contained in:
parent
574772205f
commit
4aa6179dae
1 changed files with 17 additions and 17 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue