summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRikki <i@rikki.moe>2025-04-19 19:17:36 +0800
committerRikki <i@rikki.moe>2025-04-19 19:17:36 +0800
commitc5d6284448daa1ac000e5b3a07c1d33a3e54d5d7 (patch)
tree1984b8026dbe0971f72f2f1f88feb9b10f0ccc16
parent3e0f7d661fcc0c7edde60bb68554a97f2260c7ff (diff)
add rainbow command 🌈HEADmaster
-rw-r--r--scripts/main.js11
-rw-r--r--styles/main.css11
2 files changed, 18 insertions, 4 deletions
diff --git a/scripts/main.js b/scripts/main.js
index 443959f..071ccb9 100644
--- a/scripts/main.js
+++ b/scripts/main.js
@@ -16,13 +16,13 @@ const COMMANDS = [
];
// Built-in handlers not in COMMANDS
-const BUILTIN_COMMANDS = ['su', 'sudo', 'shutdown', 'reboot', 'echo', 'df', 'pwd', 'cat', 'top', 'rm', 'ls', 'oiia'];
+const BUILTIN_COMMANDS = ['su', 'sudo', 'shutdown', 'reboot', 'echo', 'df', 'pwd', 'cat', 'top', 'rm', 'ls', 'oiia', 'rainbow'];
// Consolidated for autocomplete
const ALL_COMMANDS = [
...COMMANDS.map(cmd => cmd.name),
...BUILTIN_COMMANDS
-];
+].sort();
const ROASTS = {
sudo: [
@@ -360,7 +360,6 @@ async function showOutput(command, args) {
} catch (err) {
createErrorText('Failed to play sound: ' + err.message);
}
-
clearInterval(iv);
break;
case 'email':
@@ -371,6 +370,12 @@ async function showOutput(command, args) {
const duration = performance.now() - start;
createText(`The email address is: <a href=\"mailto:${email}\" target=\"_blank\">${email}</a> (${duration.toFixed(2)}ms)`);
break;
+ case 'rainbow':
+ trueValue(command);
+ createText('You want a rainbow? Here you go: 🌈');
+ // change the background color to a rainbow gradient
+ document.body.style.background = 'linear-gradient(238deg, #fd8800, #fd008f, #9700fd, #003dfd, #05c7e6, #4bd58d)';
+ break;
default:
await handleLinkCommands(command);
break;
diff --git a/styles/main.css b/styles/main.css
index 017154f..6fcbe8c 100644
--- a/styles/main.css
+++ b/styles/main.css
@@ -32,13 +32,22 @@ a {
color: rgb(238, 238, 238);
}
-body {
+{{/* body {
background-color: #393A59;
height: 100vh;
font-family: 'Fira Code', monospace;
display: flex;
align-items: center;
justify-content: center;
+} */}}
+
+body {
+ height: 100vh;
+ font-family: 'Fira Code', monospace;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background-color: #393A59;
}
.container {