You've already forked konami-code-snippets
mirror of
https://github.com/hexolan/konami-code-snippets.git
synced 2026-05-20 03:29:22 +01:00
8c64c67c80
fix: library usage
25 lines
804 B
HTML
25 lines
804 B
HTML
<html>
|
|
<head>
|
|
<title>Konami Code Snippets: Nolib Usage</title>
|
|
</head>
|
|
<body>
|
|
<p>Konami Code</p>
|
|
|
|
<script>
|
|
const keySequence = ["ArrowUp", "ArrowUp", "ArrowDown", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowLeft", "ArrowRight", "b", "a"];
|
|
let sequenceStep = 0;
|
|
|
|
document.addEventListener("keydown", function (e) {
|
|
if (keySequence[sequenceStep] === e.key) {
|
|
sequenceStep += 1;
|
|
|
|
if (sequenceStep === keySequence.length) {
|
|
window.location.href = `https://github.com/hexolan/konami-code-snippets`;
|
|
}
|
|
} else {
|
|
sequenceStep = 0;
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |