2022-07-02 16:30:30 +00:00
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom/client';
|
2022-07-02 20:58:33 +00:00
|
|
|
import Typing from 'react-typing-animation';
|
2022-07-03 02:30:48 +00:00
|
|
|
import ClickableDiv from 'react-clickable-div';
|
|
|
|
import KeyboardEventHandler from 'react-keyboard-event-handler'
|
2022-07-02 16:30:30 +00:00
|
|
|
import './index.css';
|
2022-07-02 20:58:33 +00:00
|
|
|
import logos from './BoSLOO logo.json';
|
2022-07-02 16:30:30 +00:00
|
|
|
|
2022-07-02 20:58:33 +00:00
|
|
|
class Terminal extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
this.state = {
|
2022-07-03 02:30:48 +00:00
|
|
|
bodyObj: <SelfTest />,
|
|
|
|
init: false,
|
2022-07-02 20:58:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-03 02:30:48 +00:00
|
|
|
appendToBody(newContent) {
|
|
|
|
let bodyObj = JSON.parse(JSON.stringify(this.state.bodyObj)) + newContent;
|
|
|
|
this.setState({
|
|
|
|
bodyObj: bodyObj
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
replaceBody(newContent) {
|
|
|
|
this.setState({
|
|
|
|
bodyObj: newContent
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
handler() {
|
|
|
|
const init = this.state.init;
|
|
|
|
if (!init) { this.replaceBody('YIPPIE!'); this.setState({ init: true }); }
|
|
|
|
}
|
|
|
|
|
2022-07-02 20:58:33 +00:00
|
|
|
render() {
|
2022-07-03 02:30:48 +00:00
|
|
|
return (
|
|
|
|
<div className='terminal'>
|
|
|
|
{this.state.bodyObj}
|
|
|
|
<KeyboardEventHandler handleKeys={['all']}
|
|
|
|
onKeyEvent={(key, e) => { if (!this.state.init) { this.replaceBody('YIPPIE!'); this.setState({ init: true }); } }} />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class SelfTest extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
this.state = {
|
|
|
|
logodisplay: false
|
2022-07-02 20:58:33 +00:00
|
|
|
}
|
2022-07-03 02:30:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const final = <span>{logos.logo} < br /><br /><br /><Typing speed={5}>Press any key to continue...<br/>> <span className='blink-text'>_</span></Typing></span>;
|
2022-07-02 20:58:33 +00:00
|
|
|
return (
|
2022-07-03 02:30:48 +00:00
|
|
|
<div className='power-on-self-test'>
|
|
|
|
<Typing speed={5} onFinishedTyping={() => this.setState({logodisplay: true})}>
|
|
|
|
BoSLOO ACPI BIOS v0.1<br />
|
|
|
|
Sakimori Ind. 2022<br />
|
|
|
|
Initializing cache.................................<Typing.Speed ms={200} />...<Typing.Speed ms={5} /> OK!<br />
|
|
|
|
Initializing network.........<Typing.Speed ms={500} />....<Typing.Speed ms={5} />.................<Typing.Speed ms={300} />....<Typing.Speed ms={5} /> OK!<br />
|
|
|
|
Initializing GPU...................................<Typing.Speed ms={1000} />...<Typing.Speed ms={5} /> <span className='fail-text'>FAIL!</span><br />
|
|
|
|
<br />
|
2022-07-02 20:58:33 +00:00
|
|
|
</Typing>
|
2022-07-03 02:30:48 +00:00
|
|
|
{this.state.logodisplay ? final : null}
|
2022-07-02 20:58:33 +00:00
|
|
|
</div>
|
2022-07-03 02:30:48 +00:00
|
|
|
)
|
2022-07-02 20:58:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-03 02:30:48 +00:00
|
|
|
// =========================================
|
2022-07-02 16:30:30 +00:00
|
|
|
|
|
|
|
const root = ReactDOM.createRoot(document.getElementById("root"));
|
2022-07-03 02:30:48 +00:00
|
|
|
root.render(<Terminal />);
|