-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
95 lines (92 loc) · 3.58 KB
/
index.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
const terminal = document.querySelector('.terminal');
const output = terminal.querySelector('.output');
const inputLine = terminal.querySelector('.input-line');
const commandLine = terminal.querySelector('#command-line');
// Sowwyz#1337
// Sowwyz#1337
const shutdownText = `systemd[1]: Stopping target Timers.
systemd[1]: Stopping target Sound Card.
systemd[1]: Stopping target Swap.
systemd[1]: Stopping target Local File Systems (Pre).
systemd[1]: Stopping target Local File Systems.
systemd[1]: Stopped target Remote File Systems.
systemd[1]: Stopped target Swap.
systemd[1]: Stopped target Local File Systems (Pre).
systemd[1]: Stopped target Local File Systems.
systemd[1]: Stopped target Timers.
The system will shutdown now!`;
const rebootText = `systemd[1]: Stopping target Timers.
systemd[1]: Stopping target Sound Card.
systemd[1]: Stopping target Swap.
systemd[1]: Stopping target Local File Systems (Pre).
systemd[1]: Stopping target Local File Systems.
systemd[1]: Stopped target Remote File Systems.
systemd[1]: Stopped target Swap.
systemd[1]: Stopped target Local File Systems (Pre).
systemd[1]: Stopped target Local File Systems.
systemd[1]: Stopped target Timers.
The system will reboot now!`;
// Sowwyz#1337
// Sowwyz#1337
function outputCommand() {
const input = commandLine.value;
const outputString = `\n> ${input}\n`;
output.innerHTML += outputString;
commandLine.value = '';
handleCommand(input);
}
// Sowwyz#1337
function handleCommand(command) {
if (command === 'help') {
const helpText = `Available commands:\n
help - displays this help message\n
clear - clears the screen\n
whosowwyz - displays information about the user\n
about - displays information about me\n
projects - displays a list of my projects\n
contact - displays my contact information\n
sourcecode - displays the source code of this website\n
poweroff - turns off the computer\n
reboot - restarts the computer\n`
output.innerHTML += helpText;
} else if (command === 'clear') {
output.innerHTML = '';
} else if (command === 'whosowwyz') {
output.innerHTML += "root"
} else if (command === 'about') {
output.innerHTML += "I am Sowwyz, 16 yo developer from Turkey. I code in Java, C#, HTML, CSS. I also like Windows, play games and i know some things about audio. I am currently learning ethical hacking and thats it!"
} else if (command === 'projects') {
output.innerHTML += "into see more projects check out my github: https://github.com/Sowwyz"
} else if (command === 'contact') {
output.innerHTML += "for contact you can use:\n\nDiscord: Sowwyz#1337 \n\n"
} else if (command === 'sourcecode') {
window.location.replace('https://github.com/Sowwyz');
} else if (command === 'poweroff') {
output.innerHTML += shutdownText;
delete inputLine;
setTimeout(function() {
window.location.replace('https://github.com/Sowwyz/');
}, 1000);
} else if (command === 'reboot') {
output.innerHTML += rebootText;
setTimeout(function() {
window.location.replace('https://github.com/Sowwyz/');
}, 1000);
} else {
const errorText = `Command '${command}' not found. Type 'help' for a list of available commands.`;
output.innerHTML += errorText;
}
}
// Sowwyz#1337
commandLine.addEventListener('keydown', function(e) {
if (e.key === 'Enter') {
outputCommand();
}
});
// Sowwyz#1337
commandLine.focus();
// Sowwyz#1337
// Sowwyz#1337
// Sowwyz#1337
// Sowwyz#1337
// Sowwyz#1337