-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
65 lines (55 loc) · 1.98 KB
/
test.js
File metadata and controls
65 lines (55 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
VANTA.GLOBE({
el: "#background",
mouseControls: true,
touchControls: true,
gyroControls: false,
minHeight: 200.00,
minWidth: 200.00,
scale: 1.00,
scaleMobile: 1.00,
color: "#00ff00",
color2: "white",
size: 1.6,
backgroundColor: "#171717"
})
let today = new Date();
let frameCount = 0;
let time = today.toLocaleTimeString('en-US');
let textSpeed = 14;
const terminal = document.getElementById("terminal");
const line1 = document.getElementById("line1");
const lastLogin = localStorage.getItem("last-visited") || `${String(today.getMonth() + 1).padStart(2, '0')}/${String(today.getDate()).padStart(2, '0')}/${today.getFullYear()} at ${time}`;
let line1D = {
text: `> Last login: ${lastLogin} on ttys000\n> Welcome to stalicites system(s). Run "stalicites help" to get started.`,
index: 0
}
localStorage.setItem("last-visited", `${String(today.getMonth() + 1).padStart(2, '0')}/${String(today.getDate()).padStart(2, '0')}/${today.getFullYear()} at ${time}`);
document.getElementById("input").onkeyup = function(event) {
if (event.key == "Enter") {
line1D.text += `\n > ${document.getElementById("input").value}`
if (document.getElementById("input").value.trim() === "stalicites help") {
line1D.text += `
Here are a list of commands you can run:
stalicites github
stalicites chess.com
stalicites discord
whois
stalicites work
`
} else {
line1D.text += `\nCommand "${document.getElementById("input").value}" not found! Run "stalicites help" for more info.`;
}
document.getElementById("input").value = "";
}
};
function animateText() {
frameCount++;
if (line1D.index < line1D.text.length && frameCount % textSpeed == 0) {
line1.innerHTML += line1D.text[line1D.index];
line1D.index++;
}
if (line1D.index == 122) {
textSpeed = 6;
}
}
setInterval(animateText, 1000/1000);