-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path12.js
32 lines (32 loc) · 954 Bytes
/
12.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function konamiCode() {
console.log(
"%c What's my Username?",
"font-size:50px; color:gold; background:black"
);
console.log(
"%c Close the consle",
"font-size:50px; color:black; background:gold"
);
console.log(
"%c Type it on webpage",
"font-size:50px; color:gold; background:black"
);
const secretPass = "karna98";
const pressedArray = [];
document.addEventListener("keyup", (e) => {
pressedArray.push(e.key);
console.log(pressedArray);
pressedArray.splice(
-secretPass.length - 1,
pressedArray.length - secretPass.length
);
console.log(pressedArray);
if (pressedArray.join("").includes(secretPass)) {
try {
cornify_add();
} catch (error) {}
pressedArray.length = 0;
}
});
}
window.addEventListener("DOMContentLoaded", konamiCode);