A lot of clean up
This commit is contained in:
parent
d89744f46f
commit
931fa141dc
62 changed files with 447 additions and 993 deletions
|
|
@ -7,9 +7,11 @@ if (window.terminal) {
|
|||
|
||||
const commands = Object.keys(window.terminal.commands).sort();
|
||||
commands.forEach((cmd) => {
|
||||
const desc =
|
||||
window.terminal.commands[cmd].description || "No description";
|
||||
window.terminal.print(` ${cmd.padEnd(15)} - ${desc}`);
|
||||
const desc = window.terminal.commands[cmd].description;
|
||||
// Skip commands with no description (hidden commands)
|
||||
if (desc) {
|
||||
window.terminal.print(` ${cmd.padEnd(15)} - ${desc}`);
|
||||
}
|
||||
});
|
||||
window.terminal.print("");
|
||||
});
|
||||
|
|
@ -20,13 +22,13 @@ if (window.terminal) {
|
|||
});
|
||||
|
||||
// Echo command
|
||||
window.terminal.registerCommand(
|
||||
"echo",
|
||||
"Echo text to the terminal",
|
||||
(args) => {
|
||||
window.terminal.print(args.join(" "));
|
||||
},
|
||||
);
|
||||
// window.terminal.registerCommand(
|
||||
// "echo",
|
||||
// "Echo text to the terminal",
|
||||
// (args) => {
|
||||
// window.terminal.print(args.join(" "));
|
||||
// },
|
||||
// );
|
||||
|
||||
// History command
|
||||
window.terminal.registerCommand("history", "Show command history", () => {
|
||||
|
|
|
|||
|
|
@ -83,13 +83,44 @@ if (window.terminal) {
|
|||
// ADD YOUR OWN COMMANDS BELOW THIS LINE
|
||||
// ========================================
|
||||
|
||||
// Hidden WOW command (no description = won't show in help)
|
||||
window.terminal.registerCommand("wow", "", () => {
|
||||
const audio = new Audio("/audio/wow.mp3");
|
||||
audio.play().catch((error) => {
|
||||
window.terminal.printError("Failed to play audio: " + error.message);
|
||||
});
|
||||
const art = `
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⣷⢸⣿⣿⡜⢯⣷⡌⡻⣿⣿⣿⣆⢈⠻⠿⢿⣿⣿⣿⣿⣿⣿⣷⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡁⢳⣿⣿⣿⣿⣿⣿⡜⣿⣿⣧⢀⢻⣷⠰⠈⢿⣿⣿⣧⢣⠉⠑⠪⢙⠿⠿⠿⠿⠿⠿⠿⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣱⡇⡞⣿⣿⣿⣿⣿⣿⡇⣿⣿⡏⡄⣧⠹⡇⠧⠈⢻⣿⣿⡇⢧⢢⠀⠀⠑⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣇⢃⢿⣿⣿⣿⣿⣿⣷⣿⣿⠇⢃⣡⣤⡹⠐⣿⣀⢻⣿⣿⢸⡎⠳⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣾⣿⣿⠘⡸⣿⣿⣿⣿⣿⣿⣿⡿⣰⣿⣿⢟⡷⠈⠋⠃⠎⢿⣿⡏⣿⠀⠘⢆⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⡐⢹⣿⣿⡐⢡⢹⣿⣿⣿⣿⡏⣿⢣⣿⣿⡑⠁⠔⠀⠉⠉⠢⡘⣿⡇⣿⡇⠀⡀⠡⡀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠘⣿⣿⣇⠇⢣⢻⣿⣿⣿⡇⢇⣾⣿⣿⡆⢸⣤⡀⠚⢂⠀⢡⢿⡇⣿⡇⠀⢿⠀⠀⠄⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠠⠹⣿⣿⡘⣆⢣⠻⣿⣿⢈⣾⣿⣿⣿⣶⣸⣏⢀⣬⣋⡼⣠⢸⢹⣿⡇⢠⣼⠙⡄⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⡇⠁⠹⣿⣇⠹⡃⠃⠙⡇⠘⢿⣿⣿⣿⣿⣿⣏⣓⣉⣭⣴⣿⠘⢸⣿⠁⠘⠋⠀⠹⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢷⠀⠀⠈⢿⣇⠂⣷⠄⠐⠀⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢠⢸⡏⠀⢀⣠⣴⣾⣿⣶⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢆⠀⠀⠀⠙⠆⠈⠢⠲⠥⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡞⣸⠁⠀⢸⣿⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠄⠃⠀⠀⠘⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⡏⠹⣿⣿⡿⠫⠊⠀⠀⠀⣶⠀⢻⣿⣿⣿⣿⡿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠛⠻⠿⠿⠿⢋⠀⠀⠀⠀⢀⣼⣿⡆⠈⣿⣿⣿⡟⣱⡷⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢁⣁⡀⠨⣛⠿⠶⠄⢀⣠⣾⣿⣿⣷⠀⢹⣿⡟⣴⠈⢃⣶⠔⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⡄⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠈⣿⣿⡿⠀⡀⣿⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢙⠻⣿⣿⢀⠙⠻⠿⣿⣿⣿⣿⣿⣿⡇⠁⣿⠟⡀⠈⣧⢰⣿⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠿⠴⠮⣥⠻⢧⣤⣄⣀⡉⢩⣭⣍⣃⣀⣩⠎⢀⣼⠉⣼⡯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠁⣛⠓⢒⣒⣢⡭⢁⡈⠿⠿⠟⠹⠛⠁⠀⠀⠀⠰⠃⠂⠀⠀⠀
|
||||
|
||||
`;
|
||||
window.terminal.print(art, "success");
|
||||
});
|
||||
|
||||
// Template for new command:
|
||||
/*
|
||||
window.terminal.registerCommand('commandname', 'Command description', (args) => {
|
||||
// args is an array of arguments
|
||||
// Example: if user types "mycommand hello world"
|
||||
// args will be ['hello', 'world']
|
||||
|
||||
|
||||
// Print output using:
|
||||
window.terminal.print('Regular text');
|
||||
window.terminal.printSuccess('Success message');
|
||||
|
|
|
|||
|
|
@ -1,47 +1,47 @@
|
|||
// Navigation Commands Module
|
||||
if (window.terminal) {
|
||||
// Navigate to URL command
|
||||
window.terminal.registerCommand("goto", "Navigate to a URL", (args) => {
|
||||
if (args.length === 0) {
|
||||
window.terminal.printError("Usage: goto <url>");
|
||||
window.terminal.print("Examples:");
|
||||
window.terminal.print(" goto google.com");
|
||||
window.terminal.print(" goto https://github.com");
|
||||
return;
|
||||
}
|
||||
// window.terminal.registerCommand("goto", "Navigate to a URL", (args) => {
|
||||
// if (args.length === 0) {
|
||||
// window.terminal.printError("Usage: goto <url>");
|
||||
// window.terminal.print("Examples:");
|
||||
// window.terminal.print(" goto google.com");
|
||||
// window.terminal.print(" goto https://github.com");
|
||||
// return;
|
||||
// }
|
||||
|
||||
const url = args[0];
|
||||
window.terminal.printInfo(`Navigating to ${url}...`);
|
||||
// const url = args[0];
|
||||
// window.terminal.printInfo(`Navigating to ${url}...`);
|
||||
|
||||
setTimeout(() => {
|
||||
window.location.href = url.startsWith("http") ? url : `https://${url}`;
|
||||
}, 500);
|
||||
});
|
||||
// setTimeout(() => {
|
||||
// window.location.href = url.startsWith("http") ? url : `https://${url}`;
|
||||
// }, 500);
|
||||
// });
|
||||
|
||||
// Open in new tab command
|
||||
window.terminal.registerCommand("open", "Open URL in new tab", (args) => {
|
||||
if (args.length === 0) {
|
||||
window.terminal.printError("Usage: open <url>");
|
||||
window.terminal.print("Examples:");
|
||||
window.terminal.print(" open google.com");
|
||||
window.terminal.print(" open https://github.com");
|
||||
return;
|
||||
}
|
||||
// window.terminal.registerCommand("open", "Open URL in new tab", (args) => {
|
||||
// if (args.length === 0) {
|
||||
// window.terminal.printError("Usage: open <url>");
|
||||
// window.terminal.print("Examples:");
|
||||
// window.terminal.print(" open google.com");
|
||||
// window.terminal.print(" open https://github.com");
|
||||
// return;
|
||||
// }
|
||||
|
||||
const url = args[0];
|
||||
window.terminal.printInfo(`Opening ${url} in new tab...`);
|
||||
// const url = args[0];
|
||||
// window.terminal.printInfo(`Opening ${url} in new tab...`);
|
||||
|
||||
const fullUrl = url.startsWith("http") ? url : `https://${url}`;
|
||||
window.open(fullUrl, "_blank");
|
||||
});
|
||||
// const fullUrl = url.startsWith("http") ? url : `https://${url}`;
|
||||
// window.open(fullUrl, "_blank");
|
||||
// });
|
||||
|
||||
// Reload page command
|
||||
window.terminal.registerCommand("reload", "Reload the current page", () => {
|
||||
window.terminal.printInfo("Reloading page...");
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 500);
|
||||
});
|
||||
// window.terminal.registerCommand("reload", "Reload the current page", () => {
|
||||
// window.terminal.printInfo("Reloading page...");
|
||||
// setTimeout(() => {
|
||||
// window.location.reload();
|
||||
// }, 500);
|
||||
// });
|
||||
|
||||
// PAGE NAVIGATION
|
||||
|
||||
|
|
@ -57,4 +57,16 @@ if (window.terminal) {
|
|||
window.location.href = "/audio/";
|
||||
},
|
||||
);
|
||||
|
||||
window.terminal.registerCommand("blog", "Read my blog posts", () => {
|
||||
window.location.href = "/blog/";
|
||||
});
|
||||
|
||||
window.terminal.registerCommand(
|
||||
"now",
|
||||
"What I'm doing now and tools I use",
|
||||
() => {
|
||||
window.location.href = "/now/";
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,8 +92,8 @@ if (window.terminal) {
|
|||
});
|
||||
|
||||
// Greet command
|
||||
window.terminal.registerCommand("greet", "Greet the user", (args) => {
|
||||
const name = args.length > 0 ? args.join(" ") : "User";
|
||||
window.terminal.printSuccess(`Hello, ${name}! Welcome to the terminal.`);
|
||||
});
|
||||
// window.terminal.registerCommand("greet", "Greet the user", (args) => {
|
||||
// const name = args.length > 0 ? args.join(" ") : "User";
|
||||
// window.terminal.printSuccess(`Hello, ${name}! Welcome to the terminal.`);
|
||||
// });
|
||||
}
|
||||
|
|
|
|||
42
assets/js/konami.js
Normal file
42
assets/js/konami.js
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
// Konami Code Easter Egg
|
||||
(function () {
|
||||
const konamiCode = [
|
||||
"ArrowUp",
|
||||
"ArrowUp",
|
||||
"ArrowDown",
|
||||
"ArrowDown",
|
||||
"ArrowLeft",
|
||||
"ArrowRight",
|
||||
"ArrowLeft",
|
||||
"ArrowRight",
|
||||
"KeyB",
|
||||
"KeyA",
|
||||
];
|
||||
let konamiIndex = 0;
|
||||
|
||||
// Create audio element
|
||||
const audio = new Audio("/audio/wow.mp3"); // You'll need to add this audio file
|
||||
|
||||
document.addEventListener("keydown", function (e) {
|
||||
// Check if the pressed key matches the next key in the sequence
|
||||
if (e.code === konamiCode[konamiIndex]) {
|
||||
konamiIndex++;
|
||||
|
||||
// If we've completed the sequence
|
||||
if (konamiIndex === konamiCode.length) {
|
||||
// Play the WOW sound
|
||||
audio.currentTime = 0; // Reset to start
|
||||
audio.play();
|
||||
|
||||
// Optional: Add some visual feedback
|
||||
console.log("🎮 Konami Code activated!");
|
||||
|
||||
// Reset the sequence
|
||||
konamiIndex = 0;
|
||||
}
|
||||
} else {
|
||||
// Wrong key, reset the sequence
|
||||
konamiIndex = 0;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
|
@ -16,6 +16,16 @@ class TerminalShell {
|
|||
|
||||
// Boot sequence
|
||||
async boot() {
|
||||
let skipBoot = false;
|
||||
|
||||
// Add listener to skip boot sequence on Enter key
|
||||
const skipBootListener = (e) => {
|
||||
if (e.key === "Enter") {
|
||||
skipBoot = true;
|
||||
}
|
||||
};
|
||||
document.addEventListener("keydown", skipBootListener);
|
||||
|
||||
const bootMessages = [
|
||||
" _ _ _____ ______ __",
|
||||
" | \\ | | ____| _ \\ \\ / /",
|
||||
|
|
@ -39,8 +49,11 @@ class TerminalShell {
|
|||
"",
|
||||
"",
|
||||
];
|
||||
|
||||
for (let i = 0; i < bootMessages.length; i++) {
|
||||
await this.sleep(100);
|
||||
if (!skipBoot) {
|
||||
await this.sleep(100);
|
||||
}
|
||||
const line = document.createElement("div");
|
||||
line.className = "output-line boot-line";
|
||||
line.textContent = bootMessages[i];
|
||||
|
|
@ -49,6 +62,9 @@ class TerminalShell {
|
|||
this.scrollToBottom();
|
||||
}
|
||||
|
||||
// Remove the skip boot listener
|
||||
document.removeEventListener("keydown", skipBootListener);
|
||||
|
||||
this.printHTML(" ");
|
||||
|
||||
// Get latest post info
|
||||
|
|
@ -71,7 +87,7 @@ class TerminalShell {
|
|||
);
|
||||
|
||||
this.printHTML(
|
||||
'<span class="warning">This site is under construction. There\'s not much of interest here yet.</span>',
|
||||
'<span class="warning">This site is under construction. Feel free to look around...</span>',
|
||||
);
|
||||
|
||||
this.inputContainer.classList.remove("hidden");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue