added ascii art

This commit is contained in:
Baipyrus 2023-01-12 15:10:13 +01:00
parent fead90a29e
commit 1d88bfa1d3
3 changed files with 17 additions and 4 deletions

View File

@ -22,4 +22,9 @@ body {
#current {
color: lightgrey;
}
#asciiArt {
text-align: center;
color: red;
}

View File

@ -10,6 +10,14 @@
<body>
<div id="cursor">&nbsp;</div>
<div id="textbox">
<pre id="asciiArt">
██████╗ █████╗ ██╗██████╗ ██╗ ██╗██████╗ ██╗ ██╗███████╗
██╔══██╗██╔══██╗██║██╔══██╗╚██╗ ██╔╝██╔══██╗ ██║ ██║██╔════╝
██████╔╝███████║██║██████╔╝ ╚████╔╝ ██████╔╝ ██║ ██║███████╗
██╔══██╗██╔══██║██║██╔═══╝ ╚██╔╝ ██╔══██╗ ██║ ██║╚════██║
██████╔╝██║ ██║██║██║ ██║ ██║ ██║██╗╚██████╔╝███████║
╚═════╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═════╝ ╚══════╝
</pre>
root@baipyr.us:~#
<a id="current"></a>
<input type="text" id="input">

View File

@ -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(()=>{