-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest-password-minigame.html
More file actions
291 lines (257 loc) · 10.7 KB
/
test-password-minigame.html
File metadata and controls
291 lines (257 loc) · 10.7 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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Password Minigame Test</title>
<!-- Include the game's CSS -->
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/minigames-framework.css">
<link rel="stylesheet" href="css/password-minigame.css">
<link rel="stylesheet" href="css/notifications.css">
<style>
body {
background: #1a1a1a;
color: white;
font-family: 'Press Start 2P', monospace;
margin: 0;
padding: 20px;
}
.test-container {
max-width: 800px;
margin: 0 auto;
}
.test-section {
margin: 20px 0;
padding: 20px;
border: 2px solid #444;
border-radius: 10px;
background: #2a2a2a;
}
.test-button {
background: #3498db;
color: white;
border: none;
padding: 12px 24px;
border-radius: 5px;
cursor: pointer;
font-family: 'Press Start 2P', monospace;
font-size: 10px;
margin: 5px;
transition: background 0.3s ease;
}
.test-button:hover {
background: #2980b9;
}
.test-button.success {
background: #2ecc71;
}
.test-button.success:hover {
background: #27ae60;
}
.test-button.warning {
background: #f39c12;
}
.test-button.warning:hover {
background: #e67e22;
}
.test-button.danger {
background: #e74c3c;
}
.test-button.danger:hover {
background: #c0392b;
}
.test-description {
font-size: 8px;
color: #ccc;
margin-bottom: 10px;
line-height: 1.4;
}
.test-results {
margin-top: 20px;
padding: 15px;
background: #1a1a1a;
border-radius: 5px;
border: 1px solid #444;
}
.test-results h3 {
color: #00ff00;
margin-top: 0;
}
.test-results pre {
background: #0a0a0a;
padding: 10px;
border-radius: 3px;
overflow-x: auto;
font-size: 8px;
}
</style>
</head>
<body>
<div class="test-container">
<h1>Password Minigame Test Suite</h1>
<p>Test the new password minigame with various configurations and options.</p>
<!-- Basic Password Test -->
<div class="test-section">
<h2>Basic Password Test</h2>
<div class="test-description">
Test basic password entry with show/hide functionality. Password: "secret123"
</div>
<button class="test-button success" onclick="testBasicPassword()">Test Basic Password</button>
</div>
<!-- Password with Hint -->
<div class="test-section">
<h2>Password with Hint (Desktop Background)</h2>
<div class="test-description">
Test password entry with hint button inside monitor bezel with desktop wallpaper. Password: "admin"<br>
Hint: "The default administrator password"
</div>
<button class="test-button warning" onclick="testPasswordWithHint()">Test Password with Hint</button>
</div>
<!-- Password with Onscreen Keyboard -->
<div class="test-section">
<h2>Password with Onscreen Keyboard (with Shift)</h2>
<div class="test-description">
Test password entry with onscreen QWERTY keyboard including shift key for caps. Password: "Keyboard"
</div>
<button class="test-button" onclick="testPasswordWithKeyboard()">Test Password with Keyboard</button>
</div>
<!-- Full Featured Password -->
<div class="test-section">
<h2>Full Featured Password</h2>
<div class="test-description">
Test password with all features: hint, keyboard, and custom attempts. Password: "fulltest"<br>
Hint: "A complete test of all features"
</div>
<button class="test-button" onclick="testFullFeaturedPassword()">Test Full Featured Password</button>
</div>
<!-- Password with Post-it Note -->
<div class="test-section">
<h2>Password with Post-it Note</h2>
<div class="test-description">
Test password with post-it note on desktop. Password: "postit"<br>
Post-it: "Password is written on the sticky note!"
</div>
<button class="test-button" onclick="testPasswordWithPostit()">Test Password with Post-it</button>
</div>
<!-- Wrong Password Test -->
<div class="test-section">
<h2>Wrong Password Test</h2>
<div class="test-description">
Test entering wrong passwords to trigger failure scenarios. Try: "wrong", "incorrect", "fail"
</div>
<button class="test-button danger" onclick="testWrongPassword()">Test Wrong Password</button>
</div>
<!-- Test Results -->
<div class="test-results">
<h3>Test Results</h3>
<pre id="test-results">Click a test button to see results here...</pre>
</div>
</div>
<!-- Include the minigame framework -->
<script type="module">
// Import the minigame framework and password minigame
import { MinigameFramework } from './js/minigames/framework/minigame-manager.js';
import { PasswordMinigame } from './js/minigames/password/password-minigame.js';
// Initialize the framework
window.MinigameFramework = MinigameFramework;
MinigameFramework.registerScene('password', PasswordMinigame);
// Mock game alert function
window.gameAlert = function(message, type, title, duration) {
console.log(`[${type.toUpperCase()}] ${title}: ${message}`);
updateTestResults(`[${type.toUpperCase()}] ${title}: ${message}`);
};
// Test functions
window.testBasicPassword = function() {
updateTestResults("Starting basic password test...");
MinigameFramework.startMinigame('password', null, {
title: 'Basic Password Test',
password: 'secret123',
showHint: false,
showKeyboard: false,
maxAttempts: 3,
onComplete: (success, result) => {
updateTestResults(`Basic password test completed. Success: ${success}, Result: ${JSON.stringify(result)}`);
}
});
};
window.testPasswordWithHint = function() {
updateTestResults("Starting password with hint test...");
MinigameFramework.startMinigame('password', null, {
title: 'Password with Hint Test',
password: 'admin',
passwordHint: 'The default administrator password',
showHint: true,
showKeyboard: false,
maxAttempts: 3,
onComplete: (success, result) => {
updateTestResults(`Password with hint test completed. Success: ${success}, Result: ${JSON.stringify(result)}`);
}
});
};
window.testPasswordWithKeyboard = function() {
updateTestResults("Starting password with keyboard test (try using shift key for caps)...");
MinigameFramework.startMinigame('password', null, {
title: 'Password with Keyboard Test',
password: 'Keyboard',
showHint: false,
showKeyboard: true,
maxAttempts: 3,
onComplete: (success, result) => {
updateTestResults(`Password with keyboard test completed. Success: ${success}, Result: ${JSON.stringify(result)}`);
}
});
};
window.testFullFeaturedPassword = function() {
updateTestResults("Starting full featured password test...");
MinigameFramework.startMinigame('password', null, {
title: 'Full Featured Password Test',
password: 'fulltest',
passwordHint: 'A complete test of all features',
showHint: true,
showKeyboard: true,
maxAttempts: 5,
onComplete: (success, result) => {
updateTestResults(`Full featured password test completed. Success: ${success}, Result: ${JSON.stringify(result)}`);
}
});
};
window.testWrongPassword = function() {
updateTestResults("Starting wrong password test...");
MinigameFramework.startMinigame('password', null, {
title: 'Wrong Password Test',
password: 'correct',
showHint: false,
showKeyboard: false,
maxAttempts: 3,
onComplete: (success, result) => {
updateTestResults(`Wrong password test completed. Success: ${success}, Result: ${JSON.stringify(result)}`);
}
});
};
window.testPasswordWithPostit = function() {
updateTestResults("Starting password with post-it test...");
MinigameFramework.startMinigame('password', null, {
title: 'Password with Post-it Test',
password: 'postit',
showHint: false,
showKeyboard: false,
maxAttempts: 3,
postitNote: 'Password is written on the sticky note!',
showPostit: true,
onComplete: (success, result) => {
updateTestResults(`Password with post-it test completed. Success: ${success}, Result: ${JSON.stringify(result)}`);
}
});
};
function updateTestResults(message) {
const resultsElement = document.getElementById('test-results');
const timestamp = new Date().toLocaleTimeString();
resultsElement.textContent += `[${timestamp}] ${message}\n`;
resultsElement.scrollTop = resultsElement.scrollHeight;
}
// Initialize test results
updateTestResults("Password minigame test suite loaded and ready.");
</script>
</body>
</html>