-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtraining.html
159 lines (141 loc) · 8.19 KB
/
training.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!DOCTYPE html>
<html lang="en">
<head>
<title>Training</title>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel='stylesheet' href='assets/style.css'>
<script src='https://kit.fontawesome.com/3040b6fc20.js' crossorigin='anonymous'></script>
</head>
<body onload='checkVisible()'>
<div>
<p id='introtext'></p>
</div>
<script>
var introtxt = "Welcome to the Matrix, Frosh. Now that you're aware of its existence, the agents will be looking for you. Download the following skills to prepare to escape the Matrix."
var newtxt = introtxt.replace('Frosh', localStorage.getItem('username'));
document.getElementById('introtext').innerHTML = newtxt
</script>
<div id='form-wrapper'>
<form name='form_1' id='f1' onsubmit='checkAnswer()'>
<label for='kungfu'><a href='puzzles/kungfu.pdf' target='_blank'><i class='fas fa-download'></i>Kung Fu:</a> </label>
<input type='text' id='kungfu' name='answer' style='border-bottom-style:dashed'>
<input type='submit' id='s1' value='Check Answer'>
</form>
<form name='form_2' id='f2' onsubmit='checkAnswer()'>
<label for='kungfu2'><a href='puzzles/kungfu2.pdf' target='_blank'><i class='fas fa-download'></i>Kung Fu pt. 2:</a> </label>
<input type='text' id='kungfu2' name='answer' style='border-bottom-style:dashed'>
<input type='submit' id='s2' value='Check Answer'>
</form>
<form name='form_3' id='f3' onsubmit='checkAnswer()'>
<label for='booksmarts'><a href='puzzles/booksmarts.pdf' target='_blank'><i class='fas fa-download'></i>Book Smarts:</a> </label>
<input type='text' id='booksmarts' name='answer' style='border-bottom-style:dashed'>
<input type='submit' id='s3' value='Check Answer'>
</form>
<form name='form_4' id='f4' onsubmit='checkAnswer()'>
<label for='financial'><a href='puzzles/financial.pdf' target='_blank'><i class='fas fa-download'></i>Financial Literacy:</a> </label>
<input type='text' id='financial' name='answer' style='border-bottom-style:dashed'>
<input type='submit' id='s4' value='Check Answer'>
</form>
<form name='form_5' id='f5' onsubmit='checkAnswer()'>
<label for='reading'><a href='puzzles/reading.pdf' target='_blank'><i class='fas fa-download'></i>Reading the Matrix:</a> </label>
<input type='text' id='reading' name='answer' style='border-bottom-style:dashed'>
<input type='submit' id='s5' value='Check Answer'>
</form>
<form name='form_6' id='f6' onsubmit='checkAnswer()'>
<label for='agents'><a href='puzzles/agents.pdf' target='_blank'><i class='fas fa-download'></i>Identify Agents:</a> </label>
<input type='text' id='agents' name='answer' style='border-bottom-style:dashed'>
<input type='submit' id='s6' value='Check Answer'>
</form>
</div>
<script>
function checkAnswer() {
if (localStorage.getItem('f1_answer') != 'correct' &&
(document.forms['form_1']['answer'].value == 'kung fu panda'
|| document.forms['form_1']['answer'].value == 'KUNG FU PANDA') ) {
localStorage.setItem('f1_answer', 'correct');
document.getElementById('f2').style.display = 'inline-block';
alert('Correct!\nUnlocked Kung Fu pt. 2.');
}
if (localStorage.getItem('f2_answer') != 'correct' &&
(document.forms['form_2']['answer'].value == 'let go'
|| document.forms['form_2']['answer'].value == 'LET GO') ) {
localStorage.setItem('f2_answer', 'correct');
alert('Correct!');
}
if (localStorage.getItem('f3_answer') != 'correct' &&
(document.forms['form_3']['answer'].value == 'anagram'
|| document.forms['form_3']['answer'].value == 'ANAGRAM') ) {
localStorage.setItem('f3_answer', 'correct');
document.getElementById('f4').style.display = 'inline-block';
alert('Correct!\nUnlocked Financial Literacy puzzle.');
}
if (localStorage.getItem('f4_answer') != 'correct' &&
(document.forms['form_4']['answer'].value == 'yahoo'
|| document.forms['form_4']['answer'].value == 'YAHOO') ) {
localStorage.setItem('f4_answer', 'correct');
alert('Correct!');
}
if (localStorage.getItem('f5_answer') != 'correct' &&
(document.forms['form_5']['answer'].value == 'deja vu'
|| document.forms['form_5']['answer'].value == 'DEJA VU') ) {
localStorage.setItem('f5_answer', 'correct');
document.getElementById('f6').style.display = 'inline-block';
alert('Correct!\nUnlocked Identify Agents puzzle.');
}
if (localStorage.getItem('f6_answer') != 'correct' &&
(document.forms['form_6']['answer'].value == 'pandemic'
|| document.forms['form_6']['answer'].value == 'PANDEMIC') ) {
localStorage.setItem('f6_answer', 'correct');
alert('Correct!');
}
return false;
}
function checkVisible() {
var ii = 0;
if (localStorage.getItem('f1_answer') == 'correct') {
ii++;
document.getElementById('f2').style.display = 'inline-block';
document.querySelector('input#kungfu').replaceWith('COMPLETE');
document.getElementById('s1').style.display = 'none';
} else {
document.getElementById('f2').style.display = 'none';
}
if (localStorage.getItem('f2_answer') == 'correct') {
ii++;
document.querySelector('input#kungfu2').replaceWith('COMPLETE');
document.getElementById('s2').style.display = 'none';
}
if (localStorage.getItem('f3_answer') == 'correct') {
ii++;
document.getElementById('f4').style.display = 'inline-block';
document.querySelector('input#booksmarts').replaceWith('COMPLETE');
document.getElementById('s3').style.display = 'none';
} else {
document.getElementById('f4').style.display = 'none';
}
if (localStorage.getItem('f4_answer') == 'correct') {
ii++;
document.querySelector('input#financial').replaceWith('COMPLETE');
document.getElementById('s4').style.display = 'none';
}
if (localStorage.getItem('f5_answer') == 'correct') {
ii++;
document.getElementById('f6').style.display = 'inline-block';
document.querySelector('input#reading').replaceWith('COMPLETE');
document.getElementById('s5').style.display = 'none';
} else {
document.getElementById('f6').style.display = 'none';
}
if (localStorage.getItem('f6_answer') == 'correct') {
ii++;
document.querySelector('input#agents').replaceWith('COMPLETE');
document.getElementById('s6').style.display = 'none';
}
if (ii==6) {
window.location.href='video2.html';
}
}
</script>
</body>
</html>