-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
110 lines (103 loc) · 4.52 KB
/
script.js
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
document.addEventListener("DOMContentLoaded", function () {
const htmlElement = document.documentElement;
const inputPrompt = document.getElementById("input-prompt");
const inputField = document.getElementById("input-field");
const outputField = document.getElementById("output-wrapper");
var username = "guest";
inputPrompt.innerHTML = username;
outputField.innerHTML +=
`<p class="output-history">valentino panico | shell<br>` +
`version 1.0<br><br>` +
`type 'help' for a list of all commands</p>`;
htmlElement.addEventListener("click", function () {
const selection = window.getSelection().toString();
if (selection === "") {
inputField.focus();
}
});
inputField.addEventListener("keypress", function (event) {
if (event.key === "Enter") {
event.preventDefault();
const input = event.target.value;
proccessCommand(input);
event.target.value = "";
}
});
function proccessCommand(command) {
outputField.innerHTML += `<span class="output-history">${username} ➤ ${command}</span>`;
switch (command.toLowerCase()) {
case "":
outputField.innerHTML += `<p></p>`;
break;
case "about":
outputGenerator(
`# about me<br>` +
`lastname panico<br>` +
`prename valentino<br>` +
`birthday 28th of august 2004<br>` +
`residence kreuzlingen, ch-8280 switzerland<br>` +
`job computer scientist<br>` +
`e-mail <a href="mailto:[email protected]">[email protected]</a><br><br>` +
`# job experience<br>` +
`2020 - now computer scientist - lenze swiss ag, romanshorn<br><br>` +
`# education<br>` +
`2020 - 2024 apprenticeship (computer scientist efz) - bzt, frauenfeld<br>` +
`2017 - 2020 secondary school (level e) - sbw talent campus bodensee, kreuzlingen<br>` +
`2011 - 2017 primary school - kreuzlingen<br><br>` +
`# others <br>` +
`2024 - now military service as infantry crew member`
);
break;
case "clear":
outputField.innerHTML = ``;
break;
case "help":
outputGenerator(
`about about me<br>` +
`clear clear the terminal<br>` +
`help show this help page<br>` +
`projects list my projects<br>` +
`repo link to the github repository<br>` +
`socials show links to socials<br>` +
`whois who am i`
);
break;
case "projects":
outputGenerator(
`<a href="https://github.com/ZZELAV/lernjournal" target="_blank">lernjournal</a> documentation of different tasks durring my apprenticeship<br>` +
`<a href="https://github.com/ZZELAV/docusaurus-template" target="_blank">docusaurus-template</a> customized docusaurus<br>` +
`<a href="https://github.com/ZZELAV/ventoy-usb" target="_blank">ventoy-usb</a> template for a ventoy boot usb-stick<br>` +
`<a href="https://github.com/ZZELAV/DogeRadio" target="_blank">dogeradio</a> a small application to play different radio stations`
);
break;
case "repo":
outputGenerator(
`<a href="https://github.com/ZZELAV/website" target="_blank">https://github.com/ZZELAV/website</a>`
);
break;
case "socials":
outputGenerator(
`<a href="https://github.com/ZZELAV" target="_blank">github/zzelav</a><br>` +
`<a href="https://www.linkedin.com/in/valentino-panico-87ba49262" target="_blank">linkedin/valentino-panico</a>`
);
break;
case "whois":
outputGenerator(
`hi 👋. i'm valentino panico.<br>` +
`i was born on the 28th of august in 2004.<br>` +
`i live in kreuzlingen 🇨🇭 and i'm doing an apprenticeship<br>` +
`as a computer scientist 🖥️ at lenze swiss ag in romanshorn 🇨🇭.<br>` +
`currently i'm doing my military service as infantry crew member 🛡️.`
);
break;
default:
outputGenerator(
`unknown command<br>` + `type 'help' for a list of all commands`
);
}
window.scrollTo(0, htmlElement.scrollHeight);
}
function outputGenerator(output) {
outputField.innerHTML += `<p class="output-history">${output}</p>`;
}
});