diff --git a/src/App.jsx b/src/App.jsx index ddcad9f..fab2810 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -616,6 +616,31 @@ const NotepadWindow = ({ onClose }) => { }; const CommandPromptWindow = ({ onClose }) => { + const [commandInput, setCommandInput] = useState(''); + const [commandOutput, setCommandOutput] = useState(''); + + const handleCommandInput = (event) => { + setCommandInput(event.target.value) + } + + const handleKeyPress = (event) => { + if (event.key === 'Enter') { + const formattedInput = commandInput.toUpperCase() + if (formattedInput.trim() === 'HELP') { + setCommandOutput(`For more information on a specific command, type HELP command-name\nVER Displays the Windows version.`) + } else if (formattedInput.startsWith('HELP ')) { + if (formattedInput.slice(5) === 'VER') { + setCommandOutput(`Displays the Windows version.\n\nVER`) + } + } else if (formattedInput === 'VER') { + setCommandOutput(`Microsoft Windows [Version 6.1.7601]`) + } else { + setCommandOutput(`'${commandInput}' is not recognized as an internal or external command, operable program or batch file.`) + } + setCommandInput('') + } + }; + return ( {
-
-

Command Prompt Window

-

Work in Progress...

+
+
C:\Windows\System32> 
+
diff --git a/src/style.css b/src/style.css index 083ae97..f4223db 100644 --- a/src/style.css +++ b/src/style.css @@ -285,9 +285,35 @@ .commandprompt { background: black !important; - color: white + color: white; + display: flex; + flex-direction: column; + } + + .inputcontainer { + display: flex; + align-items: center; } - .commandprompt > p { - margin: 3px; + #commandinput { + width: 100%; + background: none; + border: none; + border-radius: 0; + box-sizing: border-box; + font: 9pt Segoe UI, SegoeUI, Noto Sans, sans-serif; + padding: 0; + color: white; + } + + #commandoutput { + width: 100%; + background: none; + border: none; + border-radius: 0; + box-sizing: border-box; + font: 9pt Segoe UI, SegoeUI, Noto Sans, sans-serif; + padding: 0; + color: white; + resize: none; } \ No newline at end of file