Skip to content

Commit 93f5da6

Browse files
committed
day12 finished
1 parent c02c6b5 commit 93f5da6

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

12 - Key Sequence Detection/index-START.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@
77
<link rel="icon" href="https://fav.farm/🔥" />
88
</head>
99
<body>
10-
<script></script>
10+
<script>
11+
const pressed = [];
12+
const secretCode = 'cornify';
13+
14+
window.addEventListener('keyup', (e) => {
15+
pressed.push(e.key);
16+
pressed.splice( -secretCode.length - 1, pressed.length - secretCode.length)
17+
18+
if(pressed.join('').includes(secretCode)){
19+
cornify_add()
20+
}
21+
22+
})
23+
</script>
1124
</body>
1225
</html>

0 commit comments

Comments
 (0)