-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
113 lines (101 loc) · 3.2 KB
/
Copy pathindex.html
File metadata and controls
113 lines (101 loc) · 3.2 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
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
111
112
113
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Solutions Engineering Bureau</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<style>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
padding: 1em;
color: white;
background-color: steelblue;
height: 100vh;
}
span {
color: yellow;
}
#userInput:after {
content:"_";
opacity: 0;
animation: cursor 1s infinite;
}
@keyframes cursor {
0% {
opacity: 0;
}
40% {
opacity: 0;
}
50% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 0;
}
}
</style>
</head>
<body>
<pre>
____ _ _ _
/ ___| ___ | |_ _| |_(_) ___ _ __ ___
\___ \ / _ \| | | | | __| |/ _ \| '_ \/ __|
___) | (_) | | |_| | |_| | (_) | | | \__ \
|____/ \___/|_|\__,_|\__|_|\___/|_| |_|___/
_____ _ _
| ____|_ __ __ _(_)_ __ ___ ___ _ __(_)_ __ __ _
| _| | '_ \ / _` | | '_ \ / _ \/ _ \ '__| | '_ \ / _` |
| |___| | | | (_| | | | | | __/ __/ | | | | | | (_| |
|_____|_| |_|\__, |_|_| |_|\___|\___|_| |_|_| |_|\__, |
____ |___/ |___/
| __ ) _ _ _ __ ___ __ _ _ _
| _ \| | | | '__/ _ \/ _` | | | |
| |_) | |_| | | | __/ (_| | |_| |
|____/ \__,_|_| \___|\__,_|\__,_|
Designing best solutions = design + software + 3D printers
business@s-e-b.co
KvK: 91034302
BTW: NL004860420B92
<span>guest@seb:~$ </span><span id="userInput"></span>
</pre>
<script>
const lastSymbol = /.$/;
const $userInput = document.getElementById('userInput');
let userInput = $userInput.innerText;
const interpreter = (command) => {
switch(true) {
case command.startsWith('sudo'):
return '♥ I like your curiosity \\(^-^)/';
case command.includes('reboot'):
location.reload();
default:
return '';
}
};
const keyListener = (keyboardEvent) => {
const key = keyboardEvent.key;
switch(key){
case 'Delete':
case 'Backspace':
userInput = userInput.replace(lastSymbol, '');
break;
case 'Enter':
userInput = interpreter(userInput);
break;
default:
userInput += key;
}
$userInput.innerText = userInput;
};
document.addEventListener('keydown', keyListener);
</script>
</body>
</html>