From c5d6284448daa1ac000e5b3a07c1d33a3e54d5d7 Mon Sep 17 00:00:00 2001 From: Rikki Date: Sat, 19 Apr 2025 19:17:36 +0800 Subject: =?UTF-8?q?add=20rainbow=20command=20=F0=9F=8C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.js | 11 ++++++++--- styles/main.css | 11 ++++++++++- 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: ${email} (${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 { -- cgit v1.2.3