Skip to content

Commit

Permalink
gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinPy committed Jun 26, 2017
1 parent bb1e91d commit 4b5b289
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<title>KonamiJS</title>
</head>
<body>

<p id="comment">See console log</p>
<p id="konami"></p>

<script type="text/javascript">
function konami() {

const arr = [];
const konami = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13];

document.addEventListener('keyup', function(e) {
arr.push(e.keyCode);
if (arr.length >= 12) arr.shift();
console.log(arr);
if (arr.toString() === konami.toString()) cheatMode();
});

}

function cheatMode() {
document.querySelector('#konami').innerHTML += "KONAMI ";
}

konami();
</script>
</body>
</html>

0 comments on commit 4b5b289

Please sign in to comment.