old file structure
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
function onKonamiCode(callback) {
|
||||
let input = "";
|
||||
const konami =
|
||||
"arrowuparrowuparrowdownarrowdownarrowleftarrowrightarrowleftarrowrightba";
|
||||
document.addEventListener("keydown", (e) => {
|
||||
input = (input + e.key.toLowerCase()).slice(-konami.length);
|
||||
if (input === konami) callback();
|
||||
});
|
||||
}
|
||||
|
||||
onKonamiCode(() => {
|
||||
const body = document.body;
|
||||
const header = document.getElementById("header");
|
||||
|
||||
if (body.style.backgroundColor === "white") {
|
||||
body.style.backgroundColor = "black";
|
||||
header.style.color = "white";
|
||||
} else {
|
||||
body.style.backgroundColor = "white";
|
||||
header.style.color = "black";
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user