diff --git a/src/App.css b/src/App.css index 74b5e05..e69de29 100644 --- a/src/App.css +++ b/src/App.css @@ -1,38 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - height: 40vmin; - pointer-events: none; -} - -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/src/App.js b/src/App.js index 3784575..a82f3ba 100644 --- a/src/App.js +++ b/src/App.js @@ -1,24 +1,9 @@ -import logo from './logo.svg'; import './App.css'; +import CommandLineManager from './commandline/CommandLineManager'; function App() { return ( -
-
- logo -

- Edit src/App.js and save to reload. -

- - Learn React - -
-
+ ); } diff --git a/src/commandline/CommandLineEntry.jsx b/src/commandline/CommandLineEntry.jsx new file mode 100644 index 0000000..7306560 --- /dev/null +++ b/src/commandline/CommandLineEntry.jsx @@ -0,0 +1,9 @@ +function CommandLineEntry() { + const text = "This is just a test\n breakline\t tab" + + return( +

This is a test
breakline

+ ); +} + +export default CommandLineEntry; diff --git a/src/commandline/CommandLineManager.jsx b/src/commandline/CommandLineManager.jsx new file mode 100644 index 0000000..c825423 --- /dev/null +++ b/src/commandline/CommandLineManager.jsx @@ -0,0 +1,27 @@ +import {useState} from 'react'; +import CommandLineEntry from './CommandLineEntry.jsx'; +import Prompt from './Prompt.jsx'; + +function CommandLineManager() { + const [input, setInput] = useState(""); + + const updateInput = (e) => { + setInput(e.target.value); + } + + const submitInput = (e) => { + //check if enter was pressed + if (e.keyCode === 13) { + console.log(input); + } + } + + return( +
+ + +
+ ); +} + +export default CommandLineManager; diff --git a/src/commandline/Prompt.css b/src/commandline/Prompt.css new file mode 100644 index 0000000..1f65fb0 --- /dev/null +++ b/src/commandline/Prompt.css @@ -0,0 +1,12 @@ +#ps1 { + display: inline; +} +#promptInput { + display: inline; + border: none; + outline: none; + width: 70%; + padding: 0; + font-size: 10pt; + font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; +} diff --git a/src/commandline/Prompt.jsx b/src/commandline/Prompt.jsx new file mode 100644 index 0000000..3bf1222 --- /dev/null +++ b/src/commandline/Prompt.jsx @@ -0,0 +1,13 @@ +import './Prompt.css'; + +function Prompt(props) { + return( +
+

visitor@julius $

+ +
+ ); +} + +export default Prompt; diff --git a/src/index.css b/src/index.css index ec2585e..d7f0952 100644 --- a/src/index.css +++ b/src/index.css @@ -1,8 +1,13 @@ +html { + margin: 0; + padding: 0; + height: 100vh; + width: 100vw; + font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace; + font-size: 9pt; +} body { margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }