-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
113 lines (95 loc) · 2.46 KB
/
index.html
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>CyberCorpWatch</title>
<link rel='icon' href='favicon.ico' type='image/x-icon'/ >
<link href="style.css" rel="stylesheet" type="text/css"/>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous">
setTimeout(function(){
document.getElementById('terminal').classList.remove('hide');
}, 9000);
</script>
<script src="terminal.js"></script>
</head>
<body>
<div id='console'>
<script src='script.js' type='text/javascript'></script>
<script type='text/javascript'>
Typer.speed = 15;
Typer.file = 'kernel.txt';
Typer.init();
keyEvent = { key: "a"};
setTimeout(function() { clearInterval(typing); }, 60000);
typing = setInterval(function() {Typer.addText(keyEvent);}, 20);
</script></div>
<div id='terminal'>
<script>
var t1 = new Terminal()
t1.setTextColor('#00FF00')
t1.setHeight("150px")
t1.setWidth('600')
t1.sleep(15000,function(){
document.body.appendChild(t1.html)
printLine(questions[currentQuestion]);
getLine(questionProcessor);
})
t1.print('Hi, This is your friendly bot, David!')
function getLine(callback){
t1.input('', callback);
}
function printLine(text){
t1.print(text);
}
const questions = [
'Enter your login:',
'Password:',
'Who is cool?'
];
const questionHandlers = [
function(input){
if(input === 'v'){
printLine('UserName is correct, ACCESS GRANTED');
return true;
} else {
printLine('UserName is incorrect ACCESS DENIED');
return false;
}
},
function(input){
if(input === 'sasko'){
printLine('ACCESS GRANTED');
return true;
} else {
printLine('ACCESS DENIED');
return false;
}
},
function(input){
if(input === 'pawel sasko'){
printLine('Yes he is cool indeed');
} else {
printLine('Nah man');
}
return false;
}
];
const questionsCount = questions.length;
var currentQuestion = 0;
function questionProcessor(input){
const result = questionHandlers[currentQuestion](input);
if(result === true && currentQuestion < questionsCount - 1){
currentQuestion++;
} else {
currentQuestion = 0;
}
printLine(questions[currentQuestion]);
getLine(questionProcessor);
}
</script>
</div>
</body>
</html>