hater-hack-terminal / index.html
Coacobi2454677's picture
Update index.html
15d1f5b verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NEON HACKER TERMINAL</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');
:root {
--neon-blue: #00f3ff;
--neon-pink: #ff00ff;
--neon-purple: #9d00ff;
--terminal-bg: #0a0a12;
}
body {
margin: 0;
padding: 0;
background-color: #000;
overflow: hidden;
font-family: 'Share Tech Mono', monospace;
color: var(--neon-blue);
text-shadow: 0 0 5px var(--neon-blue);
}
.terminal-container {
position: relative;
width: 90%;
max-width: 1000px;
height: 70vh;
margin: 5vh auto;
background-color: var(--terminal-bg);
border: 2px solid var(--neon-blue);
box-shadow: 0 0 20px var(--neon-blue),
inset 0 0 10px var(--neon-blue);
overflow: hidden;
padding: 20px;
border-radius: 5px;
}
.scanline {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(
to bottom,
rgba(0, 243, 255, 0.1) 0%,
rgba(0, 243, 255, 0) 10%
);
background-size: 100% 4px;
animation: scanline 8s linear infinite;
pointer-events: none;
}
@keyframes scanline {
0% { transform: translateY(-100%); }
100% { transform: translateY(100%); }
}
.terminal-header {
display: flex;
justify-content: space-between;
margin-bottom: 15px;
border-bottom: 1px solid var(--neon-blue);
padding-bottom: 10px;
}
.terminal-title {
font-size: 1.2rem;
color: var(--neon-blue);
text-transform: uppercase;
}
.terminal-body {
height: calc(100% - 70px);
overflow-y: auto;
padding-right: 10px;
}
.prompt {
display: flex;
margin-bottom: 10px;
align-items: center;
}
.prompt-user {
color: var(--neon-pink);
margin-right: 5px;
}
.prompt-path {
color: var(--neon-blue);
}
.prompt-symbol {
color: var(--neon-blue);
margin-right: 10px;
}
.command-input {
flex-grow: 1;
background: transparent;
border: none;
color: var(--neon-blue);
font-family: 'Share Tech Mono', monospace;
font-size: 1rem;
outline: none;
caret-color: var(--neon-blue);
}
.command-output {
margin-bottom: 15px;
line-height: 1.4;
white-space: pre-wrap;
animation: text-appear 0.1s ease-out;
}
@keyframes text-appear {
from { opacity: 0; transform: translateY(5px); }
to { opacity: 1; transform: translateY(0); }
}
.success {
color: #00ff00;
text-shadow: 0 0 5px #00ff00;
}
.error {
color: #ff0000;
text-shadow: 0 0 5px #ff0000;
}
.warning {
color: #ffff00;
text-shadow: 0 0 5px #ffff00;
}
.important {
color: var(--neon-pink);
text-shadow: 0 0 5px var(--neon-pink);
font-weight: bold;
}
.corrupt {
animation: corrupt 0.5s infinite;
}
@keyframes corrupt {
0% { color: var(--neon-blue); transform: translateX(-1px); }
20% { color: var(--neon-pink); transform: translateX(1px); }
40% { color: #00ff00; transform: translateY(-1px); }
60% { color: #ffff00; transform: translateY(1px); }
80% { color: var(--neon-purple); transform: skewX(-5deg); }
100% { color: var(--neon-blue); transform: skewX(5deg); }
}
.progress-bar {
width: 100%;
height: 20px;
background-color: rgba(0, 243, 255, 0.1);
margin: 10px 0;
border: 1px solid var(--neon-blue);
position: relative;
overflow: hidden;
}
.progress-fill {
height: 100%;
background: linear-gradient(90deg,
rgba(0, 243, 255, 0.1),
var(--neon-blue),
rgba(0, 243, 255, 0.1));
width: 0%;
position: relative;
animation: progress-pulse 2s infinite;
}
@keyframes progress-pulse {
0% { box-shadow: 0 0 5px var(--neon-blue); }
50% { box-shadow: 0 0 20px var(--neon-blue); }
100% { box-shadow: 0 0 5px var(--neon-blue); }
}
.glitch-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
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>');
pointer-events: none;
z-index: 10;
animation: glitch 10s infinite alternate-reverse;
display: none;
}
@keyframes glitch {
0% { opacity: 0.05; transform: translateY(0); }
5% { opacity: 0.1; transform: translateX(-1px); }
10% { opacity: 0.05; transform: translateX(1px); }
15% { opacity: 0.1; transform: translateY(1px); }
20% { opacity: 0.05; transform: translateY(-1px); }
98% { opacity: 0.05; transform: translateY(0); }
100% { opacity: 0.15; transform: skewX(-2deg); }
}
.matrix-rain {
position: absolute;
top: 0;
left: 0;
pointer-events: none;
opacity: 0.1;
z-index: 1;
}
.blinking-cursor {
animation: blink 1s step-end infinite;
}
@keyframes blink {
from, to { opacity: 1; }
50% { opacity: 0; }
}
.main-menu {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
z-index: 100;
}
.menu-title {
font-size: 3rem;
margin-bottom: 40px;
color: var(--neon-blue);
text-shadow: 0 0 10px var(--neon-blue);
animation: title-glitch 5s infinite;
}
@keyframes title-glitch {
0%, 100% { text-shadow: 0 0 10px var(--neon-blue); }
50% { text-shadow: 0 0 15px var(--neon-pink); }
}
.menu-btn {
display: block;
margin: 15px auto;
padding: 10px 30px;
background: transparent;
border: 2px solid var(--neon-blue);
color: var(--neon-blue);
font-family: 'Share Tech Mono', monospace;
font-size: 1.2rem;
cursor: pointer;
transition: all 0.3s;
width: 200px;
text-transform: uppercase;
}
.menu-btn:hover {
background: var(--neon-blue);
color: #000;
box-shadow: 0 0 20px var(--neon-blue);
}
.hidden {
display: none;
}
/* Command-specific classes */
.dir-item {
color: var(--neon-blue);
}
.dir-name {
color: var(--neon-pink);
}
.file-size {
color: #00ff00;
}
.access-granted {
animation: access-granted 1s;
}
@keyframes access-granted {
0% { color: #00ff00; transform: scale(1); }
50% { color: #ffffff; transform: scale(1.1); }
100% { color: #00ff00; transform: scale(1); }
}
</style>
</head>
<body>
<!-- Matrix rain effect -->
<canvas id="matrix-rain" class="matrix-rain"></canvas>
<!-- Glitch overlay -->
<div class="glitch-overlay"></div>
<!-- Main menu -->
<div id="main-menu" class="main-menu">
<h1 class="menu-title">NEON HACKER</h1>
<button id="new-game-btn" class="menu-btn">NEW GAME</button>
<button id="load-game-btn" class="menu-btn">LOAD GAME</button>
<button id="help-btn" class="menu-btn">HELP</button>
</div>
<!-- Help screen -->
<div id="help-screen" class="main-menu hidden">
<h2 class="menu-title" style="font-size: 2rem;">TERMINAL COMMANDS</h2>
<div style="text-align: left; max-width: 600px; margin: 0 auto;">
<p><span class="important">connect [ip]</span> - Connect to target system</p>
<p><span class="important">scan</span> - Scan for vulnerabilities</p>
<p><span class="important">brute</span> - Brute force passwords</p>
<p><span class="important">decrypt [file]</span> - Decrypt encrypted files</p>
<p><span class="important">inject [payload]</span> - Inject malicious code</p>
<p><span class="important">ls</span> - List directory contents</p>
<p><span class="important">cd [dir]</span> - Change directory</p>
<p><span class="important">cat [file]</span> - View file contents</p>
<p><span class="important">help</span> - Show this help</p>
<p><span class="important">clear</span> - Clear the terminal</p>
</div>
<button id="back-btn" class="menu-btn" style="margin-top: 30px;">BACK</button>
</div>
<!-- Terminal container -->
<div id="terminal-container" class="terminal-container hidden">
<div class="scanline"></div>
<div class="terminal-header">
<div class="terminal-title">NeonHack Terminal v3.1.7</div>
<div class="terminal-title" id="terminal-timer">00:00</div>
</div>
<div class="terminal-body" id="terminal-output">
<div class="command-output">
██████╗ ███████╗ ██████╗ ███╗ ██╗ ██╗ ██╗ █████╗ ██████╗██╗ ██╗███████╗██████╗
██╔══██╗██╔════╝██╔═══██╗████╗ ██║ ██║ ██║██╔══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗
██████╔╝█████╗ ██║ ██║██╔██╗ ██║ ███████║███████║██║ █████╔╝ █████╗ ██████╔╝
██╔══██╗██╔══╝ ██║ ██║██║╚██╗██║ ██╔══██║██╔══██║██║ ██╔══██╗██╔══╝ ██╔══██╗
██║ ██║███████╗╚██████╔╝██║ ╚████║ ██║ ██║██║ ██║╚██████╗██║ ██║███████╗██║ ██║
╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
</div>
<div class="command-output">
NEONHACK TERMINAL READY
SYSTEM TIME: <span id="system-time"></span>
TYPE 'help' FOR COMMAND LIST
</div>
</div>
<div class="prompt">
<span class="prompt-user">user@neonhack</span>:<span class="prompt-path" id="current-path">~</span><span class="prompt-symbol">$</span>
<input type="text" class="command-input" id="command-input" autofocus>
<span class="blinking-cursor">|</span>
</div>
</div>
<audio id="keySound" src="data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YU...SHORTENED FOR BREVITY" preload="auto"></audio>
<audio id="successSound" src="data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YU...SHORTENED FOR BREVITY" preload="auto"></audio>
<audio id="errorSound" src="data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YU...SHORTENED FOR BREVITY" preload="auto"></audio>
<!-- Credit to Holy_Dev -->
<div style="position: fixed; top: 50px; right: 600px; z-index: 1000; color: #00f3ff; font-family: 'Share Tech Mono', monospace; text-shadow: 0 0 5px #00f3ff; font-size: 24px; background: rgba(10, 10, 18, 0.7); padding: 5px 10px; border: 1px solid #00f3ff; border-radius: 3px;">
Game by Holy_Dev |
<a href="https://www.youtube.com/channel/UCJEPYkCywpdeaNqPgN9pupA" target="_blank" style="color: #ff00ff; text-decoration: none;">YouTube Tutorials</a>
</div>
<script>
// Game state
const gameState = {
currentLevel: 1,
maxLevel: 5,
timer: 0,
timerInterval: null,
commandHistory: [],
historyIndex: -1,
connections: [],
currentSystem: null,
currentPath: '~',
fileSystem: {
'~': {
type: 'dir',
contents: {
'notes.txt': {
type: 'file',
content: 'Important targets:\n- Global Bank (192.168.4.2)\n- CyberDyne Corp (10.0.3.15)\n- Nexus Security (172.16.9.34)'
},
'tools': {
type: 'dir',
contents: {
'scanner.exe': { type: 'file', locked: true },
'decryptor.exe': { type: 'file', locked: true },
'injector.exe': { type: 'file', locked: true }
}
}
}
}
}
};
// DOM elements
const terminalContainer = document.getElementById('terminal-container');
const terminalOutput = document.getElementById('terminal-output');
const commandInput = document.getElementById('command-input');
const currentPath = document.getElementById('current-path');
const mainMenu = document.getElementById('main-menu');
const helpScreen = document.getElementById('help-screen');
const newGameBtn = document.getElementById('new-game-btn');
const loadGameBtn = document.getElementById('load-game-btn');
const helpBtn = document.getElementById('help-btn');
const backBtn = document.getElementById('back-btn');
const terminalTimer = document.getElementById('terminal-timer');
const systemTime = document.getElementById('system-time');
const glitchOverlay = document.querySelector('.glitch-overlay');
const matrixCanvas = document.getElementById('matrix-rain');
const keySound = document.getElementById('keySound');
const successSound = document.getElementById('successSound');
const errorSound = document.getElementById('errorSound');
// Set up matrix rain
function setupMatrixRain() {
const ctx = matrixCanvas.getContext('2d');
matrixCanvas.width = window.innerWidth;
matrixCanvas.height = window.innerHeight;
const katakana = 'アァカサタナハマヤャラワガザダバパイィキシチニヒミリヰギジヂビピウゥクスツヌフムユュルグズブヅプエェケセテネヘメレヱゲゼデベペオォコソトホモヨョロヲゴゾドボポヴッン';
const latin = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
const nums = '0123456789';
const alphabet = katakana + latin + nums;
const fontSize = 16;
const columns = matrixCanvas.width / fontSize;
const rainDrops = [];
for (let x = 0; x < columns; x++) {
rainDrops[x] = 1;
}
function draw() {
ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
ctx.fillRect(0, 0, matrixCanvas.width, matrixCanvas.height);
ctx.fillStyle = 'rgba(0, 243, 255, 0.5)';
ctx.font = fontSize + 'px monospace';
for (let i = 0; i < rainDrops.length; i++) {
const text = alphabet.charAt(Math.floor(Math.random() * alphabet.length));
ctx.fillText(text, i * fontSize, rainDrops[i] * fontSize);
if (rainDrops[i] * fontSize > matrixCanvas.height && Math.random() > 0.975) {
rainDrops[i] = 0;
}
rainDrops[i]++;
}
}
setInterval(draw, 30);
}
// Initialize game
function init() {
setupMatrixRain();
// Button event listeners
newGameBtn.addEventListener('click', startNewGame);
loadGameBtn.addEventListener('click', loadGame);
helpBtn.addEventListener('click', showHelp);
backBtn.addEventListener('click', hideHelp);
// Command input event listeners
commandInput.addEventListener('keydown', handleCommandInput);
// Update system time
updateSystemTime();
setInterval(updateSystemTime, 1000);
// Play startup sound
playSound(successSound);
}
// Start new game
function startNewGame() {
mainMenu.classList.add('hidden');
terminalContainer.classList.remove('hidden');
// Reset game state
gameState.currentLevel = 1;
gameState.timer = 0;
gameState.commandHistory = [];
gameState.historyIndex = -1;
gameState.currentSystem = null;
gameState.currentPath = '~';
// Start timer
startTimer();
// Print welcome message
addOutput(`INITIATING NEW HACKING SESSION...`);
addOutput(`AUTHENTICATING USER IDENTITY...`);
addOutput(`ACCESS GRANTED`, 'success');
addOutput(`\nNEON HACK TERMINAL ACTIVATED. TYPE 'help' FOR COMMAND LIST\n`);
// Focus input
commandInput.focus();
// Initial glitch effect
triggerGlitch();
}
// Load game (placeholder)
function loadGame() {
addOutput('LOADING SAVE FILE...', 'warning');
setTimeout(() => {
addOutput('NO SAVE FILES FOUND', 'error');
}, 1000);
}
// Show help screen
function showHelp() {
mainMenu.classList.add('hidden');
helpScreen.classList.remove('hidden');
}
// Hide help screen
function hideHelp() {
helpScreen.classList.add('hidden');
mainMenu.classList.remove('hidden');
}
// Start game timer
function startTimer() {
if (gameState.timerInterval) clearInterval(gameState.timerInterval);
gameState.timerInterval = setInterval(() => {
gameState.timer++;
const minutes = Math.floor(gameState.timer / 60).toString().padStart(2, '0');
const seconds = (gameState.timer % 60).toString().padStart(2, '0');
terminalTimer.textContent = `${minutes}:${seconds}`;
}, 1000);
}
// Update system time display
function updateSystemTime() {
const now = new Date();
const hours = now.getHours().toString().padStart(2, '0');
const minutes = now.getMinutes().toString().padStart(2, '0');
const seconds = now.getSeconds().toString().padStart(2, '0');
systemTime.textContent = `${hours}:${minutes}:${seconds}`;
}
// Handle command input
function handleCommandInput(e) {
// Play key sound
if (e.key.length === 1 || e.key === 'Backspace') {
playSound(keySound);
}
// Up arrow - navigate command history
if (e.key === 'ArrowUp') {
if (gameState.historyIndex < gameState.commandHistory.length - 1) {
gameState.historyIndex++;
commandInput.value = gameState.commandHistory[gameState.historyIndex];
e.preventDefault();
}
return;
}
// Down arrow - navigate command history
if (e.key === 'ArrowDown') {
if (gameState.historyIndex > 0) {
gameState.historyIndex--;
commandInput.value = gameState.commandHistory[gameState.historyIndex];
e.preventDefault();
} else {
gameState.historyIndex = -1;
commandInput.value = '';
}
return;
}
// Enter key - execute command
if (e.key === 'Enter') {
const command = commandInput.value.trim();
if (command) {
// Add to command history
gameState.commandHistory.unshift(command);
gameState.historyIndex = -1;
// Display command
addOutput(`user@neonhack:${gameState.currentPath}$ ${command}`);
// Execute command
executeCommand(command);
// Clear input
commandInput.value = '';
}
e.preventDefault();
}
}
// Execute command
function executeCommand(command) {
const parts = command.split(' ');
const cmd = parts[0].toLowerCase();
const args = parts.slice(1);
switch (cmd) {
case 'help':
showHelpCommand();
break;
case 'clear':
clearTerminal();
break;
case 'ls':
listDirectory();
break;
case 'cd':
changeDirectory(args[0]);
break;
case 'cat':
viewFile(args[0]);
break;
case 'connect':
connectToSystem(args[0]);
break;
case 'scan':
scanSystem();
break;
case 'brute':
bruteForce();
break;
case 'decrypt':
decryptFile(args[0]);
break;
case 'inject':
injectPayload(args[0]);
break;
default:
addOutput(`Command not found: ${cmd}\nTry 'help' for available commands`, 'error');
}
}
// Show help command
function showHelpCommand() {
const helpText = `
Available commands:
connect [ip] - Connect to target system
scan - Scan for vulnerabilities
brute - Brute force passwords
decrypt [file] - Decrypt encrypted files
inject [payload]- Inject malicious code
ls - List directory contents
cd [dir] - Change directory
cat [file] - View file contents
help - Show this help
clear - Clear the terminal
`;
addOutput(helpText);
}
// Clear terminal
function clearTerminal() {
terminalOutput.innerHTML = '';
}
// List directory contents
function listDirectory() {
let path = gameState.currentPath;
let currentDir = getDirectory(path);
if (!currentDir) {
addOutput(`Directory not found: ${path}`, 'error');
return;
}
if (currentDir.type !== 'dir') {
addOutput(`Not a directory: ${path}`, 'error');
return;
}
let output = '';
for (const [name, item] of Object.entries(currentDir.contents)) {
if (item.type === 'dir') {
output += `<span class="dir-item">dir ${name.padEnd(20)}</span>\n`;
} else {
output += `<span class="file-item">file ${name.padEnd(20)} <span class="file-size">${item.locked ? '[LOCKED]' : ''}</span></span>\n`;
}
}
addOutput(output || 'Directory is empty');
}
// Change directory
function changeDirectory(dirname) {
if (!dirname || dirname === '~') {
gameState.currentPath = '~';
currentPath.textContent = gameState.currentPath;
return;
}
let newPath = gameState.currentPath === '~' ? `${gameState.currentPath}/${dirname}` : `${gameState.currentPath}/${dirname}`;
let targetDir = getDirectory(newPath);
if (!targetDir) {
addOutput(`Directory not found: ${dirname}`, 'error');
return;
}
if (targetDir.type !== 'dir') {
addOutput(`Not a directory: ${dirname}`, 'error');
return;
}
gameState.currentPath = newPath;
currentPath.textContent = gameState.currentPath;
}
// View file contents
function viewFile(filename) {
if (!filename) {
addOutput('Usage: cat [filename]', 'error');
return;
}
let path = gameState.currentPath === '~' ? `${gameState.currentPath}/${filename}` : `${gameState.currentPath}/${filename}`;
let file = getFile(path);
if (!file) {
addOutput(`File not found: ${filename}`, 'error');
return;
}
if (file.type !== 'file') {
addOutput(`Not a file: ${filename}`, 'error');
return;
}
if (file.locked) {
addOutput(`Access denied: ${filename} is locked`, 'error');
return;
}
addOutput(file.content || '(empty file)');
}
// Connect to target system
function connectToSystem(ip) {
if (!ip) {
addOutput('Usage: connect [ip]', 'error');
return;
}
addOutput(`Attempting connection to ${ip}...`);
// Simulate connection delay
setTimeout(() => {
if (Math.random() > 0.2) { // 80% success rate
gameState.currentSystem = {
ip: ip,
name: getSystemName(ip),
securityLevel: Math.floor(Math.random() * 3) + 1
};
addOutput(`CONNECTED TO ${gameState.currentSystem.name} (${ip})`, 'success');
addOutput(`SECURITY LEVEL: ${'■'.repeat(gameState.currentSystem.securityLevel)}${'□'.repeat(3 - gameState.currentSystem.securityLevel)}`);
triggerGlitch();
} else {
addOutput(`Connection to ${ip} failed`, 'error');
}
}, 1000 + Math.random() * 2000);
}
// Scan connected system for vulnerabilities
function scanSystem() {
if (!gameState.currentSystem) {
addOutput('Not connected to any system. Use "connect [ip]" first.', 'error');
return;
}
addOutput(`Initiating vulnerability scan on ${gameState.currentSystem.ip}...`);
// Simulate scan with progress bar
simulateProgress('Scanning system...', () => {
const vulnerabilities = Math.floor(Math.random() * 3) + 1;
addOutput(`\nScan completed. Found ${vulnerabilities} potential exploit${vulnerabilities !== 1 ? 's' : ''}:`, 'success');
if (vulnerabilities >= 1) {
addOutput(`1. Weak password on admin account (brute force possible)`);
}
if (vulnerabilities >= 2) {
addOutput(`2. Outdated encryption on config files (decryption possible)`);
}
if (vulnerabilities >= 3) {
addOutput(`3. SQL injection vulnerability in web interface (code injection possible)`);
}
triggerGlitch();
playSound(successSound);
});
}
// Brute force attack
function bruteForce() {
if (!gameState.currentSystem) {
addOutput('Not connected to any system. Use "connect [ip]" first.', 'error');
return;
}
addOutput(`Initiating brute force attack on ${gameState.currentSystem.ip}...`);
simulateProgress('Brute forcing credentials...', () => {
if (Math.random() > 0.3) { // 70% success rate
addOutput(`\nCREDENTIALS COMPROMISED: admin / ${generatePassword()}`, 'success');
// Unlock some files
if (Math.random() > 0.5) {
const files = ['/etc/passwd', '/var/log/system.log', '/root/notes.txt'];
const unlocked = files[Math.floor(Math.random() * files.length)];
addOutput(`FILE ACCESS GRANTED: ${unlocked}`, 'important');
}
triggerGlitch();
playSound(successSound);
} else {
addOutput(`\nBrute force attack failed`, 'error');
playSound(errorSound);
// 30% chance of detection
if (Math.random() > 0.7) {
addOutput(`WARNING: Intrusion detection triggered!`, 'warning');
setTimeout(() => {
addOutput(`CONNECTION TERMINATED BY REMOTE HOST`, 'error');
gameState.currentSystem = null;
triggerGlitch(true);
}, 2000);
}
}
});
}
// Decrypt file
function decryptFile(filename) {
if (!gameState.currentSystem) {
addOutput('Not connected to any system. Use "connect [ip]" first.', 'error');
return;
}
if (!filename) {
addOutput('Usage: decrypt [filename]', 'error');
return;
}
addOutput(`Attempting to decrypt ${filename}...`);
simulateProgress('Running decryption algorithm...', () => {
if (Math.random() > 0.4) { // 60% success rate
addOutput(`\nDECRYPTION SUCCESSFUL`, 'success');
addOutput(`FILE CONTENTS: ${generateDataFragment()}`, 'important');
triggerGlitch();
playSound(successSound);
} else {
addOutput(`\nDecryption failed`, 'error');
playSound(errorSound);
}
});
}
// Inject payload
function injectPayload(payload) {
if (!gameState.currentSystem) {
addOutput('Not connected to any system. Use "connect [ip]" first.', 'error');
return;
}
if (!payload) {
addOutput('Usage: inject [payload]', 'error');
return;
}
addOutput(`Injecting payload: ${payload}`);
simulateProgress('Executing payload...', () => {
if (Math.random() > 0.5) { // 50% success rate
addOutput(`\nPAYLOAD EXECUTED SUCCESSFULLY`, 'access-granted');
addOutput(`SYSTEM COMPROMISED`, 'important');
if (gameState.currentLevel < gameState.maxLevel) {
setTimeout(() => {
gameState.currentLevel++;
addOutput(`\nLEVEL ${gameState.currentLevel} UNLOCKED`, 'important');
}, 1000);
}
triggerGlitch(true);
playSound(successSound);
} else {
addOutput(`\nPayload execution failed`, 'error');
playSound(errorSound);
// 40% chance of detection
if (Math.random() > 0.6) {
addOutput(`WARNING: Malicious activity detected!`, 'warning');
setTimeout(() => {
addOutput(`CONNECTION TERMINATED BY REMOTE HOST`, 'error');
gameState.currentSystem = null;
triggerGlitch(true);
}, 2000);
}
}
});
}
// Simulate progress with animated progress bar
function simulateProgress(message, callback) {
const progressBar = document.createElement('div');
progressBar.className = 'progress-bar';
const progressFill = document.createElement('div');
progressFill.className = 'progress-fill';
progressBar.appendChild(progressFill);
addOutput(`\n${message}\n`);
terminalOutput.appendChild(progressBar);
let width = 0;
const interval = setInterval(() => {
width += Math.random() * 10;
progressFill.style.width = `${Math.min(width, 100)}%`;
if (width >= 100) {
clearInterval(interval);
setTimeout(() => {
terminalOutput.removeChild(progressBar);
callback();
}, 300);
}
}, 100);
}
// Trigger glitch effect
function triggerGlitch(intense = false) {
glitchOverlay.style.display = 'block';
glitchOverlay.style.opacity = intense ? '0.2' : '0.1';
if (intense) {
glitchOverlay.style.animation = 'glitch 0.5s infinite alternate-reverse';
} else {
glitchOverlay.style.animation = 'glitch 10s infinite alternate-reverse';
}
setTimeout(() => {
glitchOverlay.style.display = 'none';
}, intense ? 1000 : 3000);
}
// Add output to terminal
function addOutput(text, type = '') {
const outputElement = document.createElement('div');
outputElement.className = `command-output ${type}`;
outputElement.innerHTML = text;
terminalOutput.appendChild(outputElement);
terminalOutput.scrollTop = terminalOutput.scrollHeight;
}
// Helper function to get directory
function getDirectory(path) {
const parts = path.split('/').filter(p => p);
let current = gameState.fileSystem;
for (const part of parts) {
if (current[part] && current[part].type === 'dir') {
current = current[part].contents;
} else {
return null;
}
}
return { type: 'dir', contents: current };
}
// Helper function to get file
function getFile(path) {
const parts = path.split('/').filter(p => p);
let current = gameState.fileSystem;
for (let i = 0; i < parts.length - 1; i++) {
if (current[parts[i]] && current[parts[i]].type === 'dir') {
current = current[parts[i]].contents;
} else {
return null;
}
}
return current[parts[parts.length - 1]];
}
// Helper function to get system name from IP
function getSystemName(ip) {
const systems = {
'192.168.4.2': 'GLOBAL BANK - FINANCIAL SERVER',
'10.0.3.15': 'CYBERDYNE CORP - RESEARCH DATABASE',
'172.16.9.34': 'NEXUS SECURITY - SURVEILLANCE NETWORK',
'10.2.8.11': 'NEOMEGA TECH - DEVELOPMENT SERVER',
'192.168.1.100': 'QUANTUM COMMUNICATIONS - ROUTER'
};
return systems[ip] || `UNKNOWN SYSTEM - ${ip}`;
}
// Helper function to generate random password
function generatePassword() {
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*';
let password = '';
for (let i = 0; i < 10; i++) {
password += chars.charAt(Math.floor(Math.random() * chars.length));
}
return password;
}
// Helper function to generate random data fragment
function generateDataFragment() {
const fragments = [
'USER:admin PASS:Qw3rtyUI0P\nLAST_LOGIN:2023-11-15 14:32:11',
'CONFIG: ENCRYPTION=WEAK\nPORT=443\nDEBUG_MODE=TRUE',
'TRANSACTION LOG\n12.34.56.78 -> $10,000 -> OFFSHORE_ACCT_1A2B',
'SECURITY ALERT: Multiple failed login attempts from 5.6.7.8',
'EMAIL: target@cyberdyne.com\nSUBJECT: Project Phoenix\nATTACHMENTS: specs.pdf (ENCRYPTED)',
'[ERROR] Failed to verify certificate\n[WARNING] Firewall rule 34 disabled',
'Employee DB:\nJohn Smith - IT Dept - Level 5 Access\nSarah Lee - Accounting - Level 3 Access'
];
return fragments[Math.floor(Math.random() * fragments.length)];
}
// Play sound effect
function playSound(sound) {
sound.currentTime = 0;
sound.play().catch(e => console.log('Audio play failed:', e));
}
// Initialize the game when the page loads
window.addEventListener('load', init);
</script>
<div style="position: fixed; bottom: 10px; right: 10px; z-index: 1000; color: #00f3ff; font-family: 'Share Tech Mono', monospace; text-shadow: 0 0 5px #00f3ff; font-size: 12px; background: rgba(10, 10, 18, 0.7); padding: 5px 10px; border: 1px solid #00f3ff; border-radius: 3px;">
Game by Holy_Dev |
<a href="https://www.youtube.com/channel/UCJEPYkCywpdeaNqPgN9pupA" target="_blank" style="color: #ff00ff; text-decoration: none;">YouTube Tutorials</a>
</div>
<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>
</html>