diff --git a/react/resume/package.json b/react/resume/package.json index 5639673..08b3a65 100644 --- a/react/resume/package.json +++ b/react/resume/package.json @@ -13,11 +13,14 @@ "author": "blek", "license": "MIT", "devDependencies": { + "buffer": "^5.5.0", "parcel": "^2.8.3", "process": "^0.11.10" }, "dependencies": { + "@babel/runtime": "^7.21.0", "react": "^18.2.0", + "react-console-emulator": "^5.0.2", "react-dom": "^18.2.0" } } diff --git a/react/resume/src/Base.js b/react/resume/src/Base.js index f2ea7ad..76a7593 100644 --- a/react/resume/src/Base.js +++ b/react/resume/src/Base.js @@ -1,3 +1,21 @@ -export function Base() { - return

; +import React, { Component } from 'react'; +import Terminal from 'react-console-emulator'; +import Files from './emulation/files'; +import commands from './emulation/commands'; + +const welcome = ` +Welcome to my resume! +Type 'help' for list of commands. +`; + +export class Base extends Component { + render() { + return ( + + ) + } } \ No newline at end of file diff --git a/react/resume/src/emulation/commands/cat.js b/react/resume/src/emulation/commands/cat.js new file mode 100644 index 0000000..f738b53 --- /dev/null +++ b/react/resume/src/emulation/commands/cat.js @@ -0,0 +1,7 @@ +import Files from '../files'; + +module.exports = (args) => { + if (args == undefined) args = ''; + if (Files[args]) return Files[args]; + return `cat: cannot open file '${args}': no such file or directory` +} \ No newline at end of file diff --git a/react/resume/src/emulation/commands/index.js b/react/resume/src/emulation/commands/index.js new file mode 100644 index 0000000..42f6a43 --- /dev/null +++ b/react/resume/src/emulation/commands/index.js @@ -0,0 +1,14 @@ +import Files from '../files'; + +module.exports = { + cat: { + description: 'Show contents of a file', + fn: require('./cat') + }, + ls: { + description: 'Show files in current directory', + fn: ()=>{ + return Object.keys(Files).join(' '); + } + } +} \ No newline at end of file diff --git a/react/resume/src/emulation/files.js b/react/resume/src/emulation/files.js new file mode 100644 index 0000000..4ed9634 --- /dev/null +++ b/react/resume/src/emulation/files.js @@ -0,0 +1,13 @@ +const Hi = (props) => { + return {...props.children} +} + +module.exports = { + 'about.txt': <> + Hi! This is my online resume. +
+ You can browse files with ls, and read them with cat. + , + 'super_secret_password.txt': + uwu +} \ No newline at end of file