Spaces:
Running
Running
Update index.html
Browse files- index.html +69 -9
index.html
CHANGED
@@ -54,6 +54,7 @@
|
|
54 |
.question {
|
55 |
margin-bottom: 20px;
|
56 |
font-size: 1.2em;
|
|
|
57 |
}
|
58 |
|
59 |
.options {
|
@@ -83,12 +84,53 @@
|
|
83 |
top: 10px;
|
84 |
right: 10px;
|
85 |
font-size: 1.2em;
|
|
|
86 |
}
|
87 |
|
88 |
.glitch {
|
89 |
animation: glitch 0.5s infinite;
|
90 |
}
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
@keyframes glitch {
|
93 |
0% { transform: translate(-50%, -50%) skew(0deg); }
|
94 |
20% { transform: translate(-52%, -50%) skew(2deg); }
|
@@ -104,7 +146,7 @@
|
|
104 |
left: 0;
|
105 |
width: 100%;
|
106 |
height: 2px;
|
107 |
-
background: rgba(
|
108 |
animation: scan 6s linear infinite;
|
109 |
}
|
110 |
|
@@ -126,6 +168,7 @@
|
|
126 |
<div id="question" class="question"></div>
|
127 |
<div id="options" class="options"></div>
|
128 |
</div>
|
|
|
129 |
|
130 |
<script>
|
131 |
const matrix = document.getElementById('matrix');
|
@@ -179,17 +222,36 @@
|
|
179 |
correct: 1
|
180 |
},
|
181 |
{
|
182 |
-
question: "
|
183 |
-
options: ["
|
184 |
correct: 2
|
185 |
},
|
186 |
{
|
187 |
-
question: "
|
188 |
-
options: ["
|
189 |
correct: 0
|
|
|
|
|
|
|
|
|
|
|
190 |
}
|
191 |
];
|
192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
document.getElementById('title').addEventListener('click', startGame);
|
194 |
|
195 |
function startGame() {
|
@@ -218,15 +280,13 @@
|
|
218 |
if(correct) {
|
219 |
score++;
|
220 |
if(score >= 10) {
|
221 |
-
|
222 |
-
resetGame();
|
223 |
return;
|
224 |
}
|
225 |
} else {
|
226 |
lives--;
|
227 |
if(lives <= 0) {
|
228 |
-
|
229 |
-
resetGame();
|
230 |
return;
|
231 |
}
|
232 |
}
|
|
|
54 |
.question {
|
55 |
margin-bottom: 20px;
|
56 |
font-size: 1.2em;
|
57 |
+
color: #fff;
|
58 |
}
|
59 |
|
60 |
.options {
|
|
|
84 |
top: 10px;
|
85 |
right: 10px;
|
86 |
font-size: 1.2em;
|
87 |
+
color: #fff;
|
88 |
}
|
89 |
|
90 |
.glitch {
|
91 |
animation: glitch 0.5s infinite;
|
92 |
}
|
93 |
|
94 |
+
#endScreen {
|
95 |
+
display: none;
|
96 |
+
position: fixed;
|
97 |
+
top: 0;
|
98 |
+
left: 0;
|
99 |
+
width: 100%;
|
100 |
+
height: 100%;
|
101 |
+
z-index: 1000;
|
102 |
+
justify-content: center;
|
103 |
+
align-items: center;
|
104 |
+
font-size: 4em;
|
105 |
+
text-align: center;
|
106 |
+
font-weight: bold;
|
107 |
+
text-shadow: 0 0 20px currentColor;
|
108 |
+
}
|
109 |
+
|
110 |
+
.victory {
|
111 |
+
background: #000;
|
112 |
+
color: #0f0;
|
113 |
+
animation: pulse 1s infinite;
|
114 |
+
}
|
115 |
+
|
116 |
+
.defeat {
|
117 |
+
background: #f00;
|
118 |
+
color: #fff;
|
119 |
+
animation: flash 0.2s infinite;
|
120 |
+
}
|
121 |
+
|
122 |
+
@keyframes pulse {
|
123 |
+
0% { opacity: 1; }
|
124 |
+
50% { opacity: 0.7; }
|
125 |
+
100% { opacity: 1; }
|
126 |
+
}
|
127 |
+
|
128 |
+
@keyframes flash {
|
129 |
+
0% { opacity: 1; }
|
130 |
+
50% { opacity: 0.8; }
|
131 |
+
100% { opacity: 1; }
|
132 |
+
}
|
133 |
+
|
134 |
@keyframes glitch {
|
135 |
0% { transform: translate(-50%, -50%) skew(0deg); }
|
136 |
20% { transform: translate(-52%, -50%) skew(2deg); }
|
|
|
146 |
left: 0;
|
147 |
width: 100%;
|
148 |
height: 2px;
|
149 |
+
background: rgba(255, 255, 255, 0.1);
|
150 |
animation: scan 6s linear infinite;
|
151 |
}
|
152 |
|
|
|
168 |
<div id="question" class="question"></div>
|
169 |
<div id="options" class="options"></div>
|
170 |
</div>
|
171 |
+
<div id="endScreen"></div>
|
172 |
|
173 |
<script>
|
174 |
const matrix = document.getElementById('matrix');
|
|
|
222 |
correct: 1
|
223 |
},
|
224 |
{
|
225 |
+
question: "Identify the pattern: AABABC?",
|
226 |
+
options: ["A", "B", "C", "D"],
|
227 |
correct: 2
|
228 |
},
|
229 |
{
|
230 |
+
question: "Which fraction is largest?",
|
231 |
+
options: ["3/4", "2/3", "5/8", "7/10"],
|
232 |
correct: 0
|
233 |
+
},
|
234 |
+
{
|
235 |
+
question: "What comes next: 1, 11, 21, 1211, ?",
|
236 |
+
options: ["2221", "111221", "22111", "11211"],
|
237 |
+
correct: 1
|
238 |
}
|
239 |
];
|
240 |
|
241 |
+
function showEndScreen(victory) {
|
242 |
+
const endScreen = document.getElementById('endScreen');
|
243 |
+
endScreen.style.display = 'flex';
|
244 |
+
endScreen.className = victory ? 'victory' : 'defeat';
|
245 |
+
endScreen.innerHTML = victory ?
|
246 |
+
'Successfully installed trojan.exe' :
|
247 |
+
'ROBOT DETECTED!<br>ACCESS REJECTED!!';
|
248 |
+
|
249 |
+
setTimeout(() => {
|
250 |
+
endScreen.style.display = 'none';
|
251 |
+
resetGame();
|
252 |
+
}, 3000);
|
253 |
+
}
|
254 |
+
|
255 |
document.getElementById('title').addEventListener('click', startGame);
|
256 |
|
257 |
function startGame() {
|
|
|
280 |
if(correct) {
|
281 |
score++;
|
282 |
if(score >= 10) {
|
283 |
+
showEndScreen(true);
|
|
|
284 |
return;
|
285 |
}
|
286 |
} else {
|
287 |
lives--;
|
288 |
if(lives <= 0) {
|
289 |
+
showEndScreen(false);
|
|
|
290 |
return;
|
291 |
}
|
292 |
}
|