Add null konami code
Committed 0e307a
--- a/canopy/static/enliven.js
+++ b/canopy/static/enliven.js
import { _, cookies, go, upgradeLink } from '/static/web.js'
let mode = 'site'
+const konamiCharacters = [38, 40, 37, 39, 65, 66, 13]
+const konamiSolution = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13]
+let konamiQueue = ['', '', '', '', '', '', '', '', '', '', '']
// TODO $.load(...)
document.addEventListener('DOMContentLoaded', ev => {
}
return
}
+ if (konamiCharacters.indexOf(ev.keyCode) != -1) {
+ konamiQueue = konamiQueue.slice(1).concat([ev.keyCode]) // FIFO
+ if (JSON.stringify(konamiQueue) == JSON.stringify(konamiSolution)) {
+ console.log('KONAMI')
+ return
+ }
+ }
if (following) {
if (ev.key == 'Escape') {
hideFollowLinks()