mirror of
https://github.com/litruv/lit.ruv.wtf.git
synced 2026-07-25 19:26:03 +10:00
Add terminal commands for enhanced functionality
- Implemented 'about' command to provide information about the terminal. - Created 'banner' command to display a welcome message based on terminal width. - Added 'bluesky' command to fetch and display recent posts from Bluesky. - Introduced 'clear' command to clear the terminal screen. - Developed 'color' command to change the terminal's color scheme. - Added 'contact' command to display contact information. - Implemented 'date' command to show the current date and time. - Created 'echo' command to echo back user messages. - Added 'github' command to simulate opening the GitHub repository. - Implemented 'help' command to list available commands. - Developed 'history' command to show command history. - Added 'privacy' command to display the privacy policy. - Implemented 'whoami' command to show user information.
This commit is contained in:
38
website/scripts/commands/color.js
Normal file
38
website/scripts/commands/color.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Color command - Change color scheme
|
||||
*/
|
||||
export default {
|
||||
description: 'Change color scheme',
|
||||
execute: (term, writeClickable, VERSION, args) => {
|
||||
const scheme = args[0] || '';
|
||||
const schemes = {
|
||||
green: { bg: '#001800', fg: '#00ff00', border: '#0f0' },
|
||||
amber: { bg: '#1a0f00', fg: '#ffb000', border: '#ffb000' },
|
||||
blue: { bg: '#000818', fg: '#00a0ff', border: '#00a0ff' },
|
||||
white: { bg: '#0a0a0a', fg: '#e0e0e0', border: '#999' }
|
||||
};
|
||||
|
||||
if (!scheme || !schemes[scheme]) {
|
||||
return [
|
||||
'',
|
||||
' Available color schemes:',
|
||||
' • green - Classic green terminal',
|
||||
' • amber - Amber monochrome',
|
||||
' • blue - IBM blue',
|
||||
' • white - White phosphor',
|
||||
'',
|
||||
' Usage: color [scheme]',
|
||||
''
|
||||
].join('\r\n');
|
||||
}
|
||||
|
||||
const colors = schemes[scheme];
|
||||
term.options.theme.background = colors.bg;
|
||||
term.options.theme.foreground = colors.fg;
|
||||
document.querySelector('.container').style.borderColor = colors.border;
|
||||
document.querySelector('.container').style.background = colors.bg;
|
||||
document.body.style.color = colors.fg;
|
||||
|
||||
return `\r\n Color scheme changed to: ${scheme}\r\n`;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user