Skip to content

Commit 6667358

Browse files
committed
1 parent 67e7dae commit 6667358

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
34
<head>
45
<meta charset="UTF-8">
56
<title>Key Detection</title>
67
<script type="text/javascript" src="https://www.cornify.com/js/cornify.js"></script>
78
</head>
9+
810
<body>
9-
<script>
10-
</script>
11+
<script>
12+
const seq = "fakeha";
13+
const pressed = [];
14+
let test = "";
15+
16+
window.addEventListener("keyup", (e) => {
17+
pressed.push(e.key);
18+
pressed.splice(-seq.length - 1, pressed.length - seq.length);
19+
test = pressed.join("");
20+
21+
if (test.includes(seq)) {
22+
console.log("youre correct");
23+
//pressed.splice(0);
24+
cornify_add();
25+
}
26+
27+
console.log(e.key);
28+
29+
})
30+
</script>
1131
</body>
12-
</html>
32+
33+
</html>

0 commit comments

Comments
 (0)