added ascii art
This commit is contained in:
parent
fead90a29e
commit
1d88bfa1d3
@ -22,4 +22,9 @@ body {
|
||||
|
||||
#current {
|
||||
color: lightgrey;
|
||||
}
|
||||
|
||||
#asciiArt {
|
||||
text-align: center;
|
||||
color: red;
|
||||
}
|
@ -10,6 +10,14 @@
|
||||
<body>
|
||||
<div id="cursor"> </div>
|
||||
<div id="textbox">
|
||||
<pre id="asciiArt">
|
||||
██████╗ █████╗ ██╗██████╗ ██╗ ██╗██████╗ ██╗ ██╗███████╗
|
||||
██╔══██╗██╔══██╗██║██╔══██╗╚██╗ ██╔╝██╔══██╗ ██║ ██║██╔════╝
|
||||
██████╔╝███████║██║██████╔╝ ╚████╔╝ ██████╔╝ ██║ ██║███████╗
|
||||
██╔══██╗██╔══██║██║██╔═══╝ ╚██╔╝ ██╔══██╗ ██║ ██║╚════██║
|
||||
██████╔╝██║ ██║██║██║ ██║ ██║ ██║██╗╚██████╔╝███████║
|
||||
╚═════╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═════╝ ╚══════╝
|
||||
</pre>
|
||||
root@baipyr.us:~#
|
||||
<a id="current"></a>
|
||||
<input type="text" id="input">
|
||||
|
@ -1,16 +1,16 @@
|
||||
const pretext = "root@baipyr.us:~# ";
|
||||
let startPosition = 0;
|
||||
let cursorPosition = 0;
|
||||
let cursorYOffset = 0;
|
||||
let cursorYOffset = 7;
|
||||
|
||||
const tbDiv = document.getElementById("textbox");
|
||||
const length = tbDiv.innerText.length+1;
|
||||
const length = pretext.length+1;
|
||||
startPosition = length;
|
||||
cursorPosition = length;
|
||||
const textIn = document.getElementById("input");
|
||||
const textCur = document.getElementById("current");
|
||||
const cursor = document.getElementById("cursor");
|
||||
cursor.style.transform = `translate(${length-1}ch)`;
|
||||
cursor.style.transform = `translate(${length-1}ch,${2.222*7-0.4}ch)`;
|
||||
|
||||
textIn.oninput = () => {
|
||||
textCur.textContent += textIn.value;
|
||||
@ -131,7 +131,7 @@ function runCommand(input) {
|
||||
|
||||
function updateCursor() {
|
||||
let cursor = document.getElementById("cursor");
|
||||
cursor.style.transform = `translate(${cursorPosition-1}ch, ${2.222*cursorYOffset}ch)`;
|
||||
cursor.style.transform = `translate(${cursorPosition-1}ch, ${2.222*cursorYOffset-0.4}ch)`;
|
||||
}
|
||||
|
||||
setInterval(()=>{
|
||||
|
Loading…
Reference in New Issue
Block a user