2023-03-09 15:57:46 +01:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import Terminal from 'react-console-emulator';
|
|
|
|
import Files from './emulation/files';
|
|
|
|
import commands from './emulation/commands';
|
2023-03-09 16:50:22 +01:00
|
|
|
import Colored from './helpers/color';
|
2023-03-09 15:57:46 +01:00
|
|
|
|
2023-03-10 08:05:46 +01:00
|
|
|
import './font/sourcecode.css';
|
2023-03-10 02:01:20 +01:00
|
|
|
import './style.css';
|
|
|
|
|
2023-03-09 16:50:22 +01:00
|
|
|
const welcome = <pre>
|
|
|
|
Welcome to my resume!<br/>
|
|
|
|
Type
|
|
|
|
<Colored color='#156ea4'> help </Colored>
|
|
|
|
for a list of commands.
|
|
|
|
</pre>;
|
2023-03-09 15:57:46 +01:00
|
|
|
|
2023-03-09 16:27:10 +01:00
|
|
|
const inputStyle = { color: '#2e8b7e', fontWeight: 'bold' };
|
|
|
|
|
2023-03-09 15:57:46 +01:00
|
|
|
export class Base extends Component {
|
2023-03-09 16:50:22 +01:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
this.terminal = React.createRef();
|
|
|
|
}
|
2023-03-09 15:57:46 +01:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<Terminal
|
2023-03-09 16:50:22 +01:00
|
|
|
ref={this.terminal}
|
|
|
|
commands={commands(this.terminal)}
|
2023-03-09 15:57:46 +01:00
|
|
|
welcomeMessage={welcome}
|
2023-03-09 16:27:10 +01:00
|
|
|
promptLabel={
|
2023-03-09 16:50:22 +01:00
|
|
|
/*<pre>
|
2023-03-09 16:27:10 +01:00
|
|
|
user@blek.codes
|
|
|
|
<span style={{color: '#2968ac'}}> ~/resume </span>
|
|
|
|
<span style={{color: '#ff5092'}}>(
|
|
|
|
<span style={{color:'limegreen'}}>master</span>
|
|
|
|
) </span>
|
|
|
|
$
|
2023-03-09 16:50:22 +01:00
|
|
|
</pre>*/
|
|
|
|
'$ '
|
2023-03-09 16:27:10 +01:00
|
|
|
}
|
2023-03-09 16:50:22 +01:00
|
|
|
|
|
|
|
errorText={'zsh: command not found: [command]'}
|
2023-03-09 16:27:10 +01:00
|
|
|
|
2023-03-10 08:05:46 +01:00
|
|
|
className='console'
|
2023-03-09 16:27:10 +01:00
|
|
|
|
|
|
|
promptLabelStyle={inputStyle}
|
|
|
|
inputTextStyle={{...inputStyle, color: '#5ba2b0', transform: 'translateY(2px)'}}
|
|
|
|
|
|
|
|
styleEchoBack={'fullInherit'}
|
2023-03-09 16:50:22 +01:00
|
|
|
noDefaults
|
|
|
|
noAutoScroll
|
2023-03-09 15:57:46 +01:00
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|
2023-03-09 15:19:09 +01:00
|
|
|
}
|