1
0
mirror of https://github.com/hexolan/konami-code-snippets.git synced 2026-05-20 11:39:22 +01:00
Files
konami-code-snippets/examples/redirect.html
T
hexolan e5b03ce4fd feat(package): minifying js
feat(src): refactor for library usage

refactor: move examples to root dir
2026-04-03 17:24:21 +01:00

25 lines
805 B
HTML

<html>
<head>
<title>Konami Code Snippets: Redirect</title>
</head>
<body>
<p>Enter the 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>