mirror of
https://github.com/EyeTrackVR/EyeTrackVR-Docs.git
synced 2025-11-04 14:49:44 +08:00
added neofetch easter egg
This commit is contained in:
parent
7c498087ef
commit
e35cfda8e6
@ -14,7 +14,7 @@
|
||||
height: auto;
|
||||
margin-top: -10px;
|
||||
margin-bottom: 10px;
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
@ -22,10 +22,10 @@
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="footer-logo">
|
||||
<!-- <a href="/">
|
||||
<img width="100px" height="30px" title="Open-Air-Logo" src=""
|
||||
alt="logo">
|
||||
</a> -->
|
||||
<a href="/">
|
||||
<img width="30px" height="20px" title="EyeTrackVRLogo"
|
||||
src="{{ 'assets/images/favicon/logo.svg' | relative_url }}" alt="EyeTrackVRLogo">
|
||||
</a>
|
||||
Copyright © 2019-current EyeTrackVR. Distributed by an <a
|
||||
href="https://github.com/RedHawk989/EyeTrackVR/blob/main/LICENSE">MIT</a>
|
||||
</div>
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<link href="https://fonts.googleapis.com/css?family=Fira+Sans" rel="stylesheet">
|
||||
<link href="{{'/assets/css/xterm.css' | relative_url }}" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css?family=Fira+Mono" rel="stylesheet">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
|
||||
<script src="https://code.iconify.design/2/2.2.1/iconify.min.js"></script>
|
||||
<link href="{{'/assets/css/xterm.css' | relative_url }}" rel="stylesheet">
|
||||
<script src="{{'/assets/js/custom/serialmonitor/lib/xterm.js' | relative_url }}"></script>
|
||||
|
||||
<!-- Below is Favicon Stuffs -->
|
||||
|
||||
1
docs/assets/images/favicon/logo.svg
Normal file
1
docs/assets/images/favicon/logo.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 91 KiB |
17
docs/assets/images/neofetch.txt
Normal file
17
docs/assets/images/neofetch.txt
Normal file
@ -0,0 +1,17 @@
|
||||
@@@@@@ dev@EyeTrackVR
|
||||
@@@@@@@@@@@ @@@ --------------
|
||||
@@@@@@@@@@@@ @@@@@@@@@@@ OS Arch Linux x86_64
|
||||
@@@@@@@@@@@@@ @@@@@@@@@@@@@@ Host Your PC
|
||||
@@@@@@@# ,@@@@@@@@@@@@@ Kernel 5.5.13-arch1-1
|
||||
,@@@@@@@@@@@@@@@ @@@@@@@@ Uptime 69 days, 42 hours, 21 mins
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@ Shell bash 5.0.16
|
||||
@@@@@@@@ @@@@@ CPU AMD Ryzen Threadripper PRO
|
||||
@@@ @@@@@ Memory 3869MiB / 5229MiB
|
||||
@@@@@@ @@@@
|
||||
@@@ @@@@@@@@@/ @@@@@
|
||||
,@@@. @@@@@@((@ @@@@(
|
||||
//@@@ */ @@@@ @@@@@
|
||||
@@@( @@@@@@@
|
||||
@@@ @ @@@@@@@@@
|
||||
@@@@@@@@@@@@@@@@@
|
||||
@@@@@@@@@@@@@&
|
||||
@ -5,6 +5,8 @@ var port,
|
||||
historyIndex = -1;
|
||||
const lineHistory = [];
|
||||
|
||||
var neofetch_data = "";
|
||||
|
||||
const terminal = new Terminal({
|
||||
theme: {
|
||||
background: "#141517",
|
||||
@ -70,11 +72,27 @@ async function sendSerialLine() {
|
||||
dataToSend === "clear\n"
|
||||
)
|
||||
advancedTerminalClear();
|
||||
await writer.write(dataToSend);
|
||||
if (
|
||||
dataToSend === "neofetch" ||
|
||||
dataToSend === "neofetch\r\n" ||
|
||||
dataToSend === "neofetch\r" ||
|
||||
dataToSend === "neofetch\n"
|
||||
)
|
||||
await printNeofetch();
|
||||
//await writer.write(dataToSend);
|
||||
document.getElementById("lineToSend").value = "";
|
||||
//await writer.releaseLock();
|
||||
}
|
||||
|
||||
async function printNeofetch() {
|
||||
load(
|
||||
"https://redhawk989.github.io/EyeTrackVR/EyeTrackVR/assets/images/neofetch.txt"
|
||||
);
|
||||
setTimeout(() => {
|
||||
terminal.writeln(`\x1B[1;3;34m${neofetch_data}\x1B[0m`);
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
async function listenToPort() {
|
||||
const textDecoder = new TextDecoderStream();
|
||||
const readableStreamClosed = port.readable.pipeTo(textDecoder.writable);
|
||||
@ -89,13 +107,10 @@ async function listenToPort() {
|
||||
break;
|
||||
}
|
||||
// value is a string.
|
||||
//appendToTerminal(value);
|
||||
appendToAdvancedTerminal(value);
|
||||
}
|
||||
}
|
||||
|
||||
const serialResultsDiv = document.getElementById("serialResults");
|
||||
|
||||
async function appendToAdvancedTerminal(newStuff) {
|
||||
terminal.write(
|
||||
"\x1B[1;3;32mdev@EyeTrackVR\x1B[0m\x1B[1;3;34m:~$\x1B[0m " + newStuff
|
||||
@ -106,17 +121,6 @@ async function advancedTerminalClear() {
|
||||
terminal.clear();
|
||||
}
|
||||
|
||||
async function appendToTerminal(newStuff) {
|
||||
serialResultsDiv.innerHTML += newStuff;
|
||||
if (serialResultsDiv.innerHTML.length > 3000)
|
||||
serialResultsDiv.innerHTML = serialResultsDiv.innerHTML.slice(
|
||||
serialResultsDiv.innerHTML.length - 3000
|
||||
);
|
||||
|
||||
//scroll down to bottom of div
|
||||
serialResultsDiv.scrollTop = serialResultsDiv.scrollHeight;
|
||||
}
|
||||
|
||||
function scrollHistory(direction) {
|
||||
// Clamp the value between -1 and history length
|
||||
historyIndex = Math.max(
|
||||
@ -144,6 +148,15 @@ document
|
||||
}
|
||||
});
|
||||
|
||||
const load = async (url) => {
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
neofetch_data = await response.text();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
};
|
||||
|
||||
document.getElementById("baud").value =
|
||||
localStorage.baud == undefined ? 9600 : localStorage.baud;
|
||||
document.getElementById("addLine").checked =
|
||||
|
||||
Loading…
Reference in New Issue
Block a user