Coacobi2454677 commited on
Commit
a6b792f
·
verified ·
1 Parent(s): 38b45c9

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +1053 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Holy Hacking Terminal Game
3
- emoji: 🌖
4
- colorFrom: red
5
- colorTo: indigo
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: holy-hacking-terminal-game
3
+ emoji: 🐳
4
+ colorFrom: green
5
+ colorTo: red
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,1053 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>NEON HACKER TERMINAL</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <style>
9
+ @import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');
10
+
11
+ :root {
12
+ --neon-blue: #00f3ff;
13
+ --neon-pink: #ff00ff;
14
+ --neon-purple: #9d00ff;
15
+ --terminal-bg: #0a0a12;
16
+ }
17
+
18
+ body {
19
+ margin: 0;
20
+ padding: 0;
21
+ background-color: #000;
22
+ overflow: hidden;
23
+ font-family: 'Share Tech Mono', monospace;
24
+ color: var(--neon-blue);
25
+ text-shadow: 0 0 5px var(--neon-blue);
26
+ }
27
+
28
+ .terminal-container {
29
+ position: relative;
30
+ width: 90%;
31
+ max-width: 1000px;
32
+ height: 70vh;
33
+ margin: 5vh auto;
34
+ background-color: var(--terminal-bg);
35
+ border: 2px solid var(--neon-blue);
36
+ box-shadow: 0 0 20px var(--neon-blue),
37
+ inset 0 0 10px var(--neon-blue);
38
+ overflow: hidden;
39
+ padding: 20px;
40
+ border-radius: 5px;
41
+ }
42
+
43
+ .scanline {
44
+ position: absolute;
45
+ top: 0;
46
+ left: 0;
47
+ width: 100%;
48
+ height: 100%;
49
+ background: linear-gradient(
50
+ to bottom,
51
+ rgba(0, 243, 255, 0.1) 0%,
52
+ rgba(0, 243, 255, 0) 10%
53
+ );
54
+ background-size: 100% 4px;
55
+ animation: scanline 8s linear infinite;
56
+ pointer-events: none;
57
+ }
58
+
59
+ @keyframes scanline {
60
+ 0% { transform: translateY(-100%); }
61
+ 100% { transform: translateY(100%); }
62
+ }
63
+
64
+ .terminal-header {
65
+ display: flex;
66
+ justify-content: space-between;
67
+ margin-bottom: 15px;
68
+ border-bottom: 1px solid var(--neon-blue);
69
+ padding-bottom: 10px;
70
+ }
71
+
72
+ .terminal-title {
73
+ font-size: 1.2rem;
74
+ color: var(--neon-blue);
75
+ text-transform: uppercase;
76
+ }
77
+
78
+ .terminal-body {
79
+ height: calc(100% - 70px);
80
+ overflow-y: auto;
81
+ padding-right: 10px;
82
+ }
83
+
84
+ .prompt {
85
+ display: flex;
86
+ margin-bottom: 10px;
87
+ align-items: center;
88
+ }
89
+
90
+ .prompt-user {
91
+ color: var(--neon-pink);
92
+ margin-right: 5px;
93
+ }
94
+
95
+ .prompt-path {
96
+ color: var(--neon-blue);
97
+ }
98
+
99
+ .prompt-symbol {
100
+ color: var(--neon-blue);
101
+ margin-right: 10px;
102
+ }
103
+
104
+ .command-input {
105
+ flex-grow: 1;
106
+ background: transparent;
107
+ border: none;
108
+ color: var(--neon-blue);
109
+ font-family: 'Share Tech Mono', monospace;
110
+ font-size: 1rem;
111
+ outline: none;
112
+ caret-color: var(--neon-blue);
113
+ }
114
+
115
+ .command-output {
116
+ margin-bottom: 15px;
117
+ line-height: 1.4;
118
+ white-space: pre-wrap;
119
+ animation: text-appear 0.1s ease-out;
120
+ }
121
+
122
+ @keyframes text-appear {
123
+ from { opacity: 0; transform: translateY(5px); }
124
+ to { opacity: 1; transform: translateY(0); }
125
+ }
126
+
127
+ .success {
128
+ color: #00ff00;
129
+ text-shadow: 0 0 5px #00ff00;
130
+ }
131
+
132
+ .error {
133
+ color: #ff0000;
134
+ text-shadow: 0 0 5px #ff0000;
135
+ }
136
+
137
+ .warning {
138
+ color: #ffff00;
139
+ text-shadow: 0 0 5px #ffff00;
140
+ }
141
+
142
+ .important {
143
+ color: var(--neon-pink);
144
+ text-shadow: 0 0 5px var(--neon-pink);
145
+ font-weight: bold;
146
+ }
147
+
148
+ .corrupt {
149
+ animation: corrupt 0.5s infinite;
150
+ }
151
+
152
+ @keyframes corrupt {
153
+ 0% { color: var(--neon-blue); transform: translateX(-1px); }
154
+ 20% { color: var(--neon-pink); transform: translateX(1px); }
155
+ 40% { color: #00ff00; transform: translateY(-1px); }
156
+ 60% { color: #ffff00; transform: translateY(1px); }
157
+ 80% { color: var(--neon-purple); transform: skewX(-5deg); }
158
+ 100% { color: var(--neon-blue); transform: skewX(5deg); }
159
+ }
160
+
161
+ .progress-bar {
162
+ width: 100%;
163
+ height: 20px;
164
+ background-color: rgba(0, 243, 255, 0.1);
165
+ margin: 10px 0;
166
+ border: 1px solid var(--neon-blue);
167
+ position: relative;
168
+ overflow: hidden;
169
+ }
170
+
171
+ .progress-fill {
172
+ height: 100%;
173
+ background: linear-gradient(90deg,
174
+ rgba(0, 243, 255, 0.1),
175
+ var(--neon-blue),
176
+ rgba(0, 243, 255, 0.1));
177
+ width: 0%;
178
+ position: relative;
179
+ animation: progress-pulse 2s infinite;
180
+ }
181
+
182
+ @keyframes progress-pulse {
183
+ 0% { box-shadow: 0 0 5px var(--neon-blue); }
184
+ 50% { box-shadow: 0 0 20px var(--neon-blue); }
185
+ 100% { box-shadow: 0 0 5px var(--neon-blue); }
186
+ }
187
+
188
+ .glitch-overlay {
189
+ position: absolute;
190
+ top: 0;
191
+ left: 0;
192
+ width: 100%;
193
+ height: 100%;
194
+ background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.7" numOctaves="3" stitchTiles="stitch"/><feColorMatrix type="saturate" values="0"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.05"/></svg>');
195
+ pointer-events: none;
196
+ z-index: 10;
197
+ animation: glitch 10s infinite alternate-reverse;
198
+ display: none;
199
+ }
200
+
201
+ @keyframes glitch {
202
+ 0% { opacity: 0.05; transform: translateY(0); }
203
+ 5% { opacity: 0.1; transform: translateX(-1px); }
204
+ 10% { opacity: 0.05; transform: translateX(1px); }
205
+ 15% { opacity: 0.1; transform: translateY(1px); }
206
+ 20% { opacity: 0.05; transform: translateY(-1px); }
207
+ 98% { opacity: 0.05; transform: translateY(0); }
208
+ 100% { opacity: 0.15; transform: skewX(-2deg); }
209
+ }
210
+
211
+ .matrix-rain {
212
+ position: absolute;
213
+ top: 0;
214
+ left: 0;
215
+ pointer-events: none;
216
+ opacity: 0.1;
217
+ z-index: 1;
218
+ }
219
+
220
+ .blinking-cursor {
221
+ animation: blink 1s step-end infinite;
222
+ }
223
+
224
+ @keyframes blink {
225
+ from, to { opacity: 1; }
226
+ 50% { opacity: 0; }
227
+ }
228
+
229
+ .main-menu {
230
+ position: absolute;
231
+ top: 50%;
232
+ left: 50%;
233
+ transform: translate(-50%, -50%);
234
+ text-align: center;
235
+ z-index: 100;
236
+ }
237
+
238
+ .menu-title {
239
+ font-size: 3rem;
240
+ margin-bottom: 40px;
241
+ color: var(--neon-blue);
242
+ text-shadow: 0 0 10px var(--neon-blue);
243
+ animation: title-glitch 5s infinite;
244
+ }
245
+
246
+ @keyframes title-glitch {
247
+ 0%, 100% { text-shadow: 0 0 10px var(--neon-blue); }
248
+ 50% { text-shadow: 0 0 15px var(--neon-pink); }
249
+ }
250
+
251
+ .menu-btn {
252
+ display: block;
253
+ margin: 15px auto;
254
+ padding: 10px 30px;
255
+ background: transparent;
256
+ border: 2px solid var(--neon-blue);
257
+ color: var(--neon-blue);
258
+ font-family: 'Share Tech Mono', monospace;
259
+ font-size: 1.2rem;
260
+ cursor: pointer;
261
+ transition: all 0.3s;
262
+ width: 200px;
263
+ text-transform: uppercase;
264
+ }
265
+
266
+ .menu-btn:hover {
267
+ background: var(--neon-blue);
268
+ color: #000;
269
+ box-shadow: 0 0 20px var(--neon-blue);
270
+ }
271
+
272
+ .hidden {
273
+ display: none;
274
+ }
275
+
276
+ /* Command-specific classes */
277
+ .dir-item {
278
+ color: var(--neon-blue);
279
+ }
280
+
281
+ .dir-name {
282
+ color: var(--neon-pink);
283
+ }
284
+
285
+ .file-size {
286
+ color: #00ff00;
287
+ }
288
+
289
+ .access-granted {
290
+ animation: access-granted 1s;
291
+ }
292
+
293
+ @keyframes access-granted {
294
+ 0% { color: #00ff00; transform: scale(1); }
295
+ 50% { color: #ffffff; transform: scale(1.1); }
296
+ 100% { color: #00ff00; transform: scale(1); }
297
+ }
298
+ </style>
299
+ </head>
300
+ <body>
301
+ <!-- Matrix rain effect -->
302
+ <canvas id="matrix-rain" class="matrix-rain"></canvas>
303
+
304
+ <!-- Glitch overlay -->
305
+ <div class="glitch-overlay"></div>
306
+
307
+ <!-- Main menu -->
308
+ <div id="main-menu" class="main-menu">
309
+ <h1 class="menu-title">NEON HACKER</h1>
310
+ <button id="new-game-btn" class="menu-btn">NEW GAME</button>
311
+ <button id="load-game-btn" class="menu-btn">LOAD GAME</button>
312
+ <button id="help-btn" class="menu-btn">HELP</button>
313
+ </div>
314
+
315
+ <!-- Help screen -->
316
+ <div id="help-screen" class="main-menu hidden">
317
+ <h2 class="menu-title" style="font-size: 2rem;">TERMINAL COMMANDS</h2>
318
+ <div style="text-align: left; max-width: 600px; margin: 0 auto;">
319
+ <p><span class="important">connect [ip]</span> - Connect to target system</p>
320
+ <p><span class="important">scan</span> - Scan for vulnerabilities</p>
321
+ <p><span class="important">brute</span> - Brute force passwords</p>
322
+ <p><span class="important">decrypt [file]</span> - Decrypt encrypted files</p>
323
+ <p><span class="important">inject [payload]</span> - Inject malicious code</p>
324
+ <p><span class="important">ls</span> - List directory contents</p>
325
+ <p><span class="important">cd [dir]</span> - Change directory</p>
326
+ <p><span class="important">cat [file]</span> - View file contents</p>
327
+ <p><span class="important">help</span> - Show this help</p>
328
+ <p><span class="important">clear</span> - Clear the terminal</p>
329
+ </div>
330
+ <button id="back-btn" class="menu-btn" style="margin-top: 30px;">BACK</button>
331
+ </div>
332
+
333
+ <!-- Terminal container -->
334
+ <div id="terminal-container" class="terminal-container hidden">
335
+ <div class="scanline"></div>
336
+ <div class="terminal-header">
337
+ <div class="terminal-title">NeonHack Terminal v3.1.7</div>
338
+ <div class="terminal-title" id="terminal-timer">00:00</div>
339
+ </div>
340
+
341
+ <div class="terminal-body" id="terminal-output">
342
+ <div class="command-output">
343
+ ██████╗ ███████╗ ██████╗ ███╗ ██╗ ██╗ ██╗ █████╗ ██████╗██╗ ██╗███████╗██████╗
344
+ ██╔══██╗██╔════╝██╔═══██╗████╗ ██║ ██║ ██║██╔══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗
345
+ ██████╔╝█████╗ ██║ ██║██╔██╗ ██║ ███████║███████║██║ █████╔╝ █████╗ ██████╔╝
346
+ ██╔══██╗██╔══╝ ██║ ██║██║╚██╗██║ ██╔══██║██╔══██║██║ ██╔══██╗██╔══╝ ██╔══██╗
347
+ ██║ ██║███████╗╚██████╔╝██║ ╚████║ ██║ ██║██║ ██║╚██████╗██║ ██║███████╗██║ ██║
348
+ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
349
+ </div>
350
+ <div class="command-output">
351
+ NEONHACK TERMINAL READY
352
+ SYSTEM TIME: <span id="system-time"></span>
353
+ TYPE 'help' FOR COMMAND LIST
354
+ </div>
355
+ </div>
356
+
357
+ <div class="prompt">
358
+ <span class="prompt-user">user@neonhack</span>:<span class="prompt-path" id="current-path">~</span><span class="prompt-symbol">$</span>
359
+ <input type="text" class="command-input" id="command-input" autofocus>
360
+ <span class="blinking-cursor">|</span>
361
+ </div>
362
+ </div>
363
+
364
+ <audio id="keySound" src="data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YU...SHORTENED FOR BREVITY" preload="auto"></audio>
365
+ <audio id="successSound" src="data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YU...SHORTENED FOR BREVITY" preload="auto"></audio>
366
+ <audio id="errorSound" src="data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YU...SHORTENED FOR BREVITY" preload="auto"></audio>
367
+
368
+ <script>
369
+ // Game state
370
+ const gameState = {
371
+ currentLevel: 1,
372
+ maxLevel: 5,
373
+ timer: 0,
374
+ timerInterval: null,
375
+ commandHistory: [],
376
+ historyIndex: -1,
377
+ connections: [],
378
+ currentSystem: null,
379
+ currentPath: '~',
380
+ fileSystem: {
381
+ '~': {
382
+ type: 'dir',
383
+ contents: {
384
+ 'notes.txt': {
385
+ type: 'file',
386
+ content: 'Important targets:\n- Global Bank (192.168.4.2)\n- CyberDyne Corp (10.0.3.15)\n- Nexus Security (172.16.9.34)'
387
+ },
388
+ 'tools': {
389
+ type: 'dir',
390
+ contents: {
391
+ 'scanner.exe': { type: 'file', locked: true },
392
+ 'decryptor.exe': { type: 'file', locked: true },
393
+ 'injector.exe': { type: 'file', locked: true }
394
+ }
395
+ }
396
+ }
397
+ }
398
+ }
399
+ };
400
+
401
+ // DOM elements
402
+ const terminalContainer = document.getElementById('terminal-container');
403
+ const terminalOutput = document.getElementById('terminal-output');
404
+ const commandInput = document.getElementById('command-input');
405
+ const currentPath = document.getElementById('current-path');
406
+ const mainMenu = document.getElementById('main-menu');
407
+ const helpScreen = document.getElementById('help-screen');
408
+ const newGameBtn = document.getElementById('new-game-btn');
409
+ const loadGameBtn = document.getElementById('load-game-btn');
410
+ const helpBtn = document.getElementById('help-btn');
411
+ const backBtn = document.getElementById('back-btn');
412
+ const terminalTimer = document.getElementById('terminal-timer');
413
+ const systemTime = document.getElementById('system-time');
414
+ const glitchOverlay = document.querySelector('.glitch-overlay');
415
+ const matrixCanvas = document.getElementById('matrix-rain');
416
+ const keySound = document.getElementById('keySound');
417
+ const successSound = document.getElementById('successSound');
418
+ const errorSound = document.getElementById('errorSound');
419
+
420
+ // Set up matrix rain
421
+ function setupMatrixRain() {
422
+ const ctx = matrixCanvas.getContext('2d');
423
+ matrixCanvas.width = window.innerWidth;
424
+ matrixCanvas.height = window.innerHeight;
425
+
426
+ const katakana = 'アァカサタナハマヤャラワガザダバパイィキシチニヒミリヰギジヂビピウゥクスツヌフムユュルグズブヅプエェケセテネヘメレヱゲゼデベペオォコソトホモヨョロヲゴゾドボポヴッン';
427
+ const latin = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
428
+ const nums = '0123456789';
429
+ const alphabet = katakana + latin + nums;
430
+
431
+ const fontSize = 16;
432
+ const columns = matrixCanvas.width / fontSize;
433
+
434
+ const rainDrops = [];
435
+ for (let x = 0; x < columns; x++) {
436
+ rainDrops[x] = 1;
437
+ }
438
+
439
+ function draw() {
440
+ ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
441
+ ctx.fillRect(0, 0, matrixCanvas.width, matrixCanvas.height);
442
+
443
+ ctx.fillStyle = 'rgba(0, 243, 255, 0.5)';
444
+ ctx.font = fontSize + 'px monospace';
445
+
446
+ for (let i = 0; i < rainDrops.length; i++) {
447
+ const text = alphabet.charAt(Math.floor(Math.random() * alphabet.length));
448
+ ctx.fillText(text, i * fontSize, rainDrops[i] * fontSize);
449
+
450
+ if (rainDrops[i] * fontSize > matrixCanvas.height && Math.random() > 0.975) {
451
+ rainDrops[i] = 0;
452
+ }
453
+ rainDrops[i]++;
454
+ }
455
+ }
456
+
457
+ setInterval(draw, 30);
458
+ }
459
+
460
+ // Initialize game
461
+ function init() {
462
+ setupMatrixRain();
463
+
464
+ // Button event listeners
465
+ newGameBtn.addEventListener('click', startNewGame);
466
+ loadGameBtn.addEventListener('click', loadGame);
467
+ helpBtn.addEventListener('click', showHelp);
468
+ backBtn.addEventListener('click', hideHelp);
469
+
470
+ // Command input event listeners
471
+ commandInput.addEventListener('keydown', handleCommandInput);
472
+
473
+ // Update system time
474
+ updateSystemTime();
475
+ setInterval(updateSystemTime, 1000);
476
+
477
+ // Play startup sound
478
+ playSound(successSound);
479
+ }
480
+
481
+ // Start new game
482
+ function startNewGame() {
483
+ mainMenu.classList.add('hidden');
484
+ terminalContainer.classList.remove('hidden');
485
+
486
+ // Reset game state
487
+ gameState.currentLevel = 1;
488
+ gameState.timer = 0;
489
+ gameState.commandHistory = [];
490
+ gameState.historyIndex = -1;
491
+ gameState.currentSystem = null;
492
+ gameState.currentPath = '~';
493
+
494
+ // Start timer
495
+ startTimer();
496
+
497
+ // Print welcome message
498
+ addOutput(`INITIATING NEW HACKING SESSION...`);
499
+ addOutput(`AUTHENTICATING USER IDENTITY...`);
500
+ addOutput(`ACCESS GRANTED`, 'success');
501
+ addOutput(`\nNEON HACK TERMINAL ACTIVATED. TYPE 'help' FOR COMMAND LIST\n`);
502
+
503
+ // Focus input
504
+ commandInput.focus();
505
+
506
+ // Initial glitch effect
507
+ triggerGlitch();
508
+ }
509
+
510
+ // Load game (placeholder)
511
+ function loadGame() {
512
+ addOutput('LOADING SAVE FILE...', 'warning');
513
+ setTimeout(() => {
514
+ addOutput('NO SAVE FILES FOUND', 'error');
515
+ }, 1000);
516
+ }
517
+
518
+ // Show help screen
519
+ function showHelp() {
520
+ mainMenu.classList.add('hidden');
521
+ helpScreen.classList.remove('hidden');
522
+ }
523
+
524
+ // Hide help screen
525
+ function hideHelp() {
526
+ helpScreen.classList.add('hidden');
527
+ mainMenu.classList.remove('hidden');
528
+ }
529
+
530
+ // Start game timer
531
+ function startTimer() {
532
+ if (gameState.timerInterval) clearInterval(gameState.timerInterval);
533
+
534
+ gameState.timerInterval = setInterval(() => {
535
+ gameState.timer++;
536
+ const minutes = Math.floor(gameState.timer / 60).toString().padStart(2, '0');
537
+ const seconds = (gameState.timer % 60).toString().padStart(2, '0');
538
+ terminalTimer.textContent = `${minutes}:${seconds}`;
539
+ }, 1000);
540
+ }
541
+
542
+ // Update system time display
543
+ function updateSystemTime() {
544
+ const now = new Date();
545
+ const hours = now.getHours().toString().padStart(2, '0');
546
+ const minutes = now.getMinutes().toString().padStart(2, '0');
547
+ const seconds = now.getSeconds().toString().padStart(2, '0');
548
+ systemTime.textContent = `${hours}:${minutes}:${seconds}`;
549
+ }
550
+
551
+ // Handle command input
552
+ function handleCommandInput(e) {
553
+ // Play key sound
554
+ if (e.key.length === 1 || e.key === 'Backspace') {
555
+ playSound(keySound);
556
+ }
557
+
558
+ // Up arrow - navigate command history
559
+ if (e.key === 'ArrowUp') {
560
+ if (gameState.historyIndex < gameState.commandHistory.length - 1) {
561
+ gameState.historyIndex++;
562
+ commandInput.value = gameState.commandHistory[gameState.historyIndex];
563
+ e.preventDefault();
564
+ }
565
+ return;
566
+ }
567
+
568
+ // Down arrow - navigate command history
569
+ if (e.key === 'ArrowDown') {
570
+ if (gameState.historyIndex > 0) {
571
+ gameState.historyIndex--;
572
+ commandInput.value = gameState.commandHistory[gameState.historyIndex];
573
+ e.preventDefault();
574
+ } else {
575
+ gameState.historyIndex = -1;
576
+ commandInput.value = '';
577
+ }
578
+ return;
579
+ }
580
+
581
+ // Enter key - execute command
582
+ if (e.key === 'Enter') {
583
+ const command = commandInput.value.trim();
584
+
585
+ if (command) {
586
+ // Add to command history
587
+ gameState.commandHistory.unshift(command);
588
+ gameState.historyIndex = -1;
589
+
590
+ // Display command
591
+ addOutput(`user@neonhack:${gameState.currentPath}$ ${command}`);
592
+
593
+ // Execute command
594
+ executeCommand(command);
595
+
596
+ // Clear input
597
+ commandInput.value = '';
598
+ }
599
+
600
+ e.preventDefault();
601
+ }
602
+ }
603
+
604
+ // Execute command
605
+ function executeCommand(command) {
606
+ const parts = command.split(' ');
607
+ const cmd = parts[0].toLowerCase();
608
+ const args = parts.slice(1);
609
+
610
+ switch (cmd) {
611
+ case 'help':
612
+ showHelpCommand();
613
+ break;
614
+ case 'clear':
615
+ clearTerminal();
616
+ break;
617
+ case 'ls':
618
+ listDirectory();
619
+ break;
620
+ case 'cd':
621
+ changeDirectory(args[0]);
622
+ break;
623
+ case 'cat':
624
+ viewFile(args[0]);
625
+ break;
626
+ case 'connect':
627
+ connectToSystem(args[0]);
628
+ break;
629
+ case 'scan':
630
+ scanSystem();
631
+ break;
632
+ case 'brute':
633
+ bruteForce();
634
+ break;
635
+ case 'decrypt':
636
+ decryptFile(args[0]);
637
+ break;
638
+ case 'inject':
639
+ injectPayload(args[0]);
640
+ break;
641
+ default:
642
+ addOutput(`Command not found: ${cmd}\nTry 'help' for available commands`, 'error');
643
+ }
644
+ }
645
+
646
+ // Show help command
647
+ function showHelpCommand() {
648
+ const helpText = `
649
+ Available commands:
650
+
651
+ connect [ip] - Connect to target system
652
+ scan - Scan for vulnerabilities
653
+ brute - Brute force passwords
654
+ decrypt [file] - Decrypt encrypted files
655
+ inject [payload]- Inject malicious code
656
+ ls - List directory contents
657
+ cd [dir] - Change directory
658
+ cat [file] - View file contents
659
+ help - Show this help
660
+ clear - Clear the terminal
661
+ `;
662
+ addOutput(helpText);
663
+ }
664
+
665
+ // Clear terminal
666
+ function clearTerminal() {
667
+ terminalOutput.innerHTML = '';
668
+ }
669
+
670
+ // List directory contents
671
+ function listDirectory() {
672
+ let path = gameState.currentPath;
673
+ let currentDir = getDirectory(path);
674
+
675
+ if (!currentDir) {
676
+ addOutput(`Directory not found: ${path}`, 'error');
677
+ return;
678
+ }
679
+
680
+ if (currentDir.type !== 'dir') {
681
+ addOutput(`Not a directory: ${path}`, 'error');
682
+ return;
683
+ }
684
+
685
+ let output = '';
686
+ for (const [name, item] of Object.entries(currentDir.contents)) {
687
+ if (item.type === 'dir') {
688
+ output += `<span class="dir-item">dir ${name.padEnd(20)}</span>\n`;
689
+ } else {
690
+ output += `<span class="file-item">file ${name.padEnd(20)} <span class="file-size">${item.locked ? '[LOCKED]' : ''}</span></span>\n`;
691
+ }
692
+ }
693
+
694
+ addOutput(output || 'Directory is empty');
695
+ }
696
+
697
+ // Change directory
698
+ function changeDirectory(dirname) {
699
+ if (!dirname || dirname === '~') {
700
+ gameState.currentPath = '~';
701
+ currentPath.textContent = gameState.currentPath;
702
+ return;
703
+ }
704
+
705
+ let newPath = gameState.currentPath === '~' ? `${gameState.currentPath}/${dirname}` : `${gameState.currentPath}/${dirname}`;
706
+ let targetDir = getDirectory(newPath);
707
+
708
+ if (!targetDir) {
709
+ addOutput(`Directory not found: ${dirname}`, 'error');
710
+ return;
711
+ }
712
+
713
+ if (targetDir.type !== 'dir') {
714
+ addOutput(`Not a directory: ${dirname}`, 'error');
715
+ return;
716
+ }
717
+
718
+ gameState.currentPath = newPath;
719
+ currentPath.textContent = gameState.currentPath;
720
+ }
721
+
722
+ // View file contents
723
+ function viewFile(filename) {
724
+ if (!filename) {
725
+ addOutput('Usage: cat [filename]', 'error');
726
+ return;
727
+ }
728
+
729
+ let path = gameState.currentPath === '~' ? `${gameState.currentPath}/${filename}` : `${gameState.currentPath}/${filename}`;
730
+ let file = getFile(path);
731
+
732
+ if (!file) {
733
+ addOutput(`File not found: ${filename}`, 'error');
734
+ return;
735
+ }
736
+
737
+ if (file.type !== 'file') {
738
+ addOutput(`Not a file: ${filename}`, 'error');
739
+ return;
740
+ }
741
+
742
+ if (file.locked) {
743
+ addOutput(`Access denied: ${filename} is locked`, 'error');
744
+ return;
745
+ }
746
+
747
+ addOutput(file.content || '(empty file)');
748
+ }
749
+
750
+ // Connect to target system
751
+ function connectToSystem(ip) {
752
+ if (!ip) {
753
+ addOutput('Usage: connect [ip]', 'error');
754
+ return;
755
+ }
756
+
757
+ addOutput(`Attempting connection to ${ip}...`);
758
+
759
+ // Simulate connection delay
760
+ setTimeout(() => {
761
+ if (Math.random() > 0.2) { // 80% success rate
762
+ gameState.currentSystem = {
763
+ ip: ip,
764
+ name: getSystemName(ip),
765
+ securityLevel: Math.floor(Math.random() * 3) + 1
766
+ };
767
+
768
+ addOutput(`CONNECTED TO ${gameState.currentSystem.name} (${ip})`, 'success');
769
+ addOutput(`SECURITY LEVEL: ${'■'.repeat(gameState.currentSystem.securityLevel)}${'□'.repeat(3 - gameState.currentSystem.securityLevel)}`);
770
+ triggerGlitch();
771
+ } else {
772
+ addOutput(`Connection to ${ip} failed`, 'error');
773
+ }
774
+ }, 1000 + Math.random() * 2000);
775
+ }
776
+
777
+ // Scan connected system for vulnerabilities
778
+ function scanSystem() {
779
+ if (!gameState.currentSystem) {
780
+ addOutput('Not connected to any system. Use "connect [ip]" first.', 'error');
781
+ return;
782
+ }
783
+
784
+ addOutput(`Initiating vulnerability scan on ${gameState.currentSystem.ip}...`);
785
+
786
+ // Simulate scan with progress bar
787
+ simulateProgress('Scanning system...', () => {
788
+ const vulnerabilities = Math.floor(Math.random() * 3) + 1;
789
+
790
+ addOutput(`\nScan completed. Found ${vulnerabilities} potential exploit${vulnerabilities !== 1 ? 's' : ''}:`, 'success');
791
+
792
+ if (vulnerabilities >= 1) {
793
+ addOutput(`1. Weak password on admin account (brute force possible)`);
794
+ }
795
+ if (vulnerabilities >= 2) {
796
+ addOutput(`2. Outdated encryption on config files (decryption possible)`);
797
+ }
798
+ if (vulnerabilities >= 3) {
799
+ addOutput(`3. SQL injection vulnerability in web interface (code injection possible)`);
800
+ }
801
+
802
+ triggerGlitch();
803
+ playSound(successSound);
804
+ });
805
+ }
806
+
807
+ // Brute force attack
808
+ function bruteForce() {
809
+ if (!gameState.currentSystem) {
810
+ addOutput('Not connected to any system. Use "connect [ip]" first.', 'error');
811
+ return;
812
+ }
813
+
814
+ addOutput(`Initiating brute force attack on ${gameState.currentSystem.ip}...`);
815
+
816
+ simulateProgress('Brute forcing credentials...', () => {
817
+ if (Math.random() > 0.3) { // 70% success rate
818
+ addOutput(`\nCREDENTIALS COMPROMISED: admin / ${generatePassword()}`, 'success');
819
+
820
+ // Unlock some files
821
+ if (Math.random() > 0.5) {
822
+ const files = ['/etc/passwd', '/var/log/system.log', '/root/notes.txt'];
823
+ const unlocked = files[Math.floor(Math.random() * files.length)];
824
+ addOutput(`FILE ACCESS GRANTED: ${unlocked}`, 'important');
825
+ }
826
+
827
+ triggerGlitch();
828
+ playSound(successSound);
829
+ } else {
830
+ addOutput(`\nBrute force attack failed`, 'error');
831
+ playSound(errorSound);
832
+
833
+ // 30% chance of detection
834
+ if (Math.random() > 0.7) {
835
+ addOutput(`WARNING: Intrusion detection triggered!`, 'warning');
836
+ setTimeout(() => {
837
+ addOutput(`CONNECTION TERMINATED BY REMOTE HOST`, 'error');
838
+ gameState.currentSystem = null;
839
+ triggerGlitch(true);
840
+ }, 2000);
841
+ }
842
+ }
843
+ });
844
+ }
845
+
846
+ // Decrypt file
847
+ function decryptFile(filename) {
848
+ if (!gameState.currentSystem) {
849
+ addOutput('Not connected to any system. Use "connect [ip]" first.', 'error');
850
+ return;
851
+ }
852
+
853
+ if (!filename) {
854
+ addOutput('Usage: decrypt [filename]', 'error');
855
+ return;
856
+ }
857
+
858
+ addOutput(`Attempting to decrypt ${filename}...`);
859
+
860
+ simulateProgress('Running decryption algorithm...', () => {
861
+ if (Math.random() > 0.4) { // 60% success rate
862
+ addOutput(`\nDECRYPTION SUCCESSFUL`, 'success');
863
+ addOutput(`FILE CONTENTS: ${generateDataFragment()}`, 'important');
864
+ triggerGlitch();
865
+ playSound(successSound);
866
+ } else {
867
+ addOutput(`\nDecryption failed`, 'error');
868
+ playSound(errorSound);
869
+ }
870
+ });
871
+ }
872
+
873
+ // Inject payload
874
+ function injectPayload(payload) {
875
+ if (!gameState.currentSystem) {
876
+ addOutput('Not connected to any system. Use "connect [ip]" first.', 'error');
877
+ return;
878
+ }
879
+
880
+ if (!payload) {
881
+ addOutput('Usage: inject [payload]', 'error');
882
+ return;
883
+ }
884
+
885
+ addOutput(`Injecting payload: ${payload}`);
886
+
887
+ simulateProgress('Executing payload...', () => {
888
+ if (Math.random() > 0.5) { // 50% success rate
889
+ addOutput(`\nPAYLOAD EXECUTED SUCCESSFULLY`, 'access-granted');
890
+ addOutput(`SYSTEM COMPROMISED`, 'important');
891
+
892
+ if (gameState.currentLevel < gameState.maxLevel) {
893
+ setTimeout(() => {
894
+ gameState.currentLevel++;
895
+ addOutput(`\nLEVEL ${gameState.currentLevel} UNLOCKED`, 'important');
896
+ }, 1000);
897
+ }
898
+
899
+ triggerGlitch(true);
900
+ playSound(successSound);
901
+ } else {
902
+ addOutput(`\nPayload execution failed`, 'error');
903
+ playSound(errorSound);
904
+
905
+ // 40% chance of detection
906
+ if (Math.random() > 0.6) {
907
+ addOutput(`WARNING: Malicious activity detected!`, 'warning');
908
+ setTimeout(() => {
909
+ addOutput(`CONNECTION TERMINATED BY REMOTE HOST`, 'error');
910
+ gameState.currentSystem = null;
911
+ triggerGlitch(true);
912
+ }, 2000);
913
+ }
914
+ }
915
+ });
916
+ }
917
+
918
+ // Simulate progress with animated progress bar
919
+ function simulateProgress(message, callback) {
920
+ const progressBar = document.createElement('div');
921
+ progressBar.className = 'progress-bar';
922
+
923
+ const progressFill = document.createElement('div');
924
+ progressFill.className = 'progress-fill';
925
+ progressBar.appendChild(progressFill);
926
+
927
+ addOutput(`\n${message}\n`);
928
+ terminalOutput.appendChild(progressBar);
929
+
930
+ let width = 0;
931
+ const interval = setInterval(() => {
932
+ width += Math.random() * 10;
933
+ progressFill.style.width = `${Math.min(width, 100)}%`;
934
+
935
+ if (width >= 100) {
936
+ clearInterval(interval);
937
+ setTimeout(() => {
938
+ terminalOutput.removeChild(progressBar);
939
+ callback();
940
+ }, 300);
941
+ }
942
+ }, 100);
943
+ }
944
+
945
+ // Trigger glitch effect
946
+ function triggerGlitch(intense = false) {
947
+ glitchOverlay.style.display = 'block';
948
+ glitchOverlay.style.opacity = intense ? '0.2' : '0.1';
949
+
950
+ if (intense) {
951
+ glitchOverlay.style.animation = 'glitch 0.5s infinite alternate-reverse';
952
+ } else {
953
+ glitchOverlay.style.animation = 'glitch 10s infinite alternate-reverse';
954
+ }
955
+
956
+ setTimeout(() => {
957
+ glitchOverlay.style.display = 'none';
958
+ }, intense ? 1000 : 3000);
959
+ }
960
+
961
+ // Add output to terminal
962
+ function addOutput(text, type = '') {
963
+ const outputElement = document.createElement('div');
964
+ outputElement.className = `command-output ${type}`;
965
+ outputElement.innerHTML = text;
966
+
967
+ terminalOutput.appendChild(outputElement);
968
+ terminalOutput.scrollTop = terminalOutput.scrollHeight;
969
+ }
970
+
971
+ // Helper function to get directory
972
+ function getDirectory(path) {
973
+ const parts = path.split('/').filter(p => p);
974
+ let current = gameState.fileSystem;
975
+
976
+ for (const part of parts) {
977
+ if (current[part] && current[part].type === 'dir') {
978
+ current = current[part].contents;
979
+ } else {
980
+ return null;
981
+ }
982
+ }
983
+
984
+ return { type: 'dir', contents: current };
985
+ }
986
+
987
+ // Helper function to get file
988
+ function getFile(path) {
989
+ const parts = path.split('/').filter(p => p);
990
+ let current = gameState.fileSystem;
991
+
992
+ for (let i = 0; i < parts.length - 1; i++) {
993
+ if (current[parts[i]] && current[parts[i]].type === 'dir') {
994
+ current = current[parts[i]].contents;
995
+ } else {
996
+ return null;
997
+ }
998
+ }
999
+
1000
+ return current[parts[parts.length - 1]];
1001
+ }
1002
+
1003
+ // Helper function to get system name from IP
1004
+ function getSystemName(ip) {
1005
+ const systems = {
1006
+ '192.168.4.2': 'GLOBAL BANK - FINANCIAL SERVER',
1007
+ '10.0.3.15': 'CYBERDYNE CORP - RESEARCH DATABASE',
1008
+ '172.16.9.34': 'NEXUS SECURITY - SURVEILLANCE NETWORK',
1009
+ '10.2.8.11': 'NEOMEGA TECH - DEVELOPMENT SERVER',
1010
+ '192.168.1.100': 'QUANTUM COMMUNICATIONS - ROUTER'
1011
+ };
1012
+
1013
+ return systems[ip] || `UNKNOWN SYSTEM - ${ip}`;
1014
+ }
1015
+
1016
+ // Helper function to generate random password
1017
+ function generatePassword() {
1018
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*';
1019
+ let password = '';
1020
+
1021
+ for (let i = 0; i < 10; i++) {
1022
+ password += chars.charAt(Math.floor(Math.random() * chars.length));
1023
+ }
1024
+
1025
+ return password;
1026
+ }
1027
+
1028
+ // Helper function to generate random data fragment
1029
+ function generateDataFragment() {
1030
+ const fragments = [
1031
+ 'USER:admin PASS:Qw3rtyUI0P\nLAST_LOGIN:2023-11-15 14:32:11',
1032
+ 'CONFIG: ENCRYPTION=WEAK\nPORT=443\nDEBUG_MODE=TRUE',
1033
+ 'TRANSACTION LOG\n12.34.56.78 -> $10,000 -> OFFSHORE_ACCT_1A2B',
1034
+ 'SECURITY ALERT: Multiple failed login attempts from 5.6.7.8',
1035
+ 'EMAIL: target@cyberdyne.com\nSUBJECT: Project Phoenix\nATTACHMENTS: specs.pdf (ENCRYPTED)',
1036
+ '[ERROR] Failed to verify certificate\n[WARNING] Firewall rule 34 disabled',
1037
+ 'Employee DB:\nJohn Smith - IT Dept - Level 5 Access\nSarah Lee - Accounting - Level 3 Access'
1038
+ ];
1039
+
1040
+ return fragments[Math.floor(Math.random() * fragments.length)];
1041
+ }
1042
+
1043
+ // Play sound effect
1044
+ function playSound(sound) {
1045
+ sound.currentTime = 0;
1046
+ sound.play().catch(e => console.log('Audio play failed:', e));
1047
+ }
1048
+
1049
+ // Initialize the game when the page loads
1050
+ window.addEventListener('load', init);
1051
+ </script>
1052
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - <a href="https://enzostvs-deepsite.hf.space?remix=Coacobi2454677/holy-hacking-terminal-game" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body>
1053
+ </html>