1 parent 869536d commit 8c9b9f7Copy full SHA for 8c9b9f7
1 file changed
12 - Key Sequence Detection/index-MY.html
@@ -0,0 +1,24 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+<head>
4
+ <meta charset="UTF-8">
5
+ <title>Key Detection</title>
6
+ <script type="text/javascript" src="http://www.cornify.com/js/cornify.js"></script>
7
+</head>
8
+<body>
9
+<script>
10
+ const secretCode = 'iddqd';
11
+ const pressed = [];
12
+
13
+ window.addEventListener('keyup', (e) => {
14
+ console.log(e.key);
15
+ pressed.push(e.key);
16
+ pressed.splice(-secretCode.length - 1, pressed.length - secretCode.length);
17
+ if(pressed.join('').includes(secretCode)) {
18
+ cornify_add();
19
+ }
20
+ console.log(pressed);
21
+ });
22
+</script>
23
+</body>
24
+</html>
0 commit comments