Add file viewer branding options
This commit is contained in:
31
svelte/src/util/Konami.svelte
Normal file
31
svelte/src/util/Konami.svelte
Normal file
@@ -0,0 +1,31 @@
|
||||
<script>
|
||||
let sequence = [
|
||||
"ArrowUp",
|
||||
"ArrowUp",
|
||||
"ArrowDown",
|
||||
"ArrowDown",
|
||||
"ArrowLeft",
|
||||
"ArrowRight",
|
||||
"ArrowLeft",
|
||||
"ArrowRight",
|
||||
"b",
|
||||
"a",
|
||||
]
|
||||
let index = 0
|
||||
|
||||
const keypress = e => {
|
||||
if (e.key === sequence[index]) {
|
||||
index++
|
||||
} else {
|
||||
index = 0
|
||||
}
|
||||
|
||||
if (index === sequence.length) {
|
||||
index = 0
|
||||
let audio = new Audio("/res/misc/amogus.opus")
|
||||
audio.play()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:window on:keydown={keypress} />
|
Reference in New Issue
Block a user