Spaces:
Running
Running
| document.addEventListener('DOMContentLoaded', () => { | |
| // File browser functionality | |
| document.addEventListener('click', (e) => { | |
| if (e.target.closest('.download-btn')) { | |
| const fileItem = e.target.closest('.file-item'); | |
| const fileName = fileItem.querySelector('.file-name').textContent; | |
| alert(`Downloading ${fileName}...`); | |
| } | |
| if (e.target.closest('.refresh-btn')) { | |
| alert('Refreshing file browser...'); | |
| } | |
| }); | |
| // Typewriter effect for terminal | |
| const typewriterElements = document.querySelectorAll('.typewriter'); | |
| if (typewriterElements.length) { | |
| const commands = [ | |
| 'scan network --deep', | |
| 'extract credentials --silent', | |
| 'bypass firewall --stealth', | |
| 'exfiltrate data --encrypted' | |
| ]; | |
| let currentCommand = 0; | |
| let currentChar = 0; | |
| let isDeleting = false; | |
| function typeWriter() { | |
| const element = typewriterElements[0]; | |
| const fullCommand = '> ' + commands[currentCommand]; | |
| if (isDeleting) { | |
| element.textContent = fullCommand.substring(0, currentChar - 1); | |
| currentChar--; | |
| if (currentChar === 2) { | |
| isDeleting = false; | |
| currentCommand = (currentCommand + 1) % commands.length; | |
| setTimeout(typeWriter, 500); | |
| } else { | |
| setTimeout(typeWriter, 50); | |
| } | |
| } else { | |
| element.textContent = fullCommand.substring(0, currentChar + 1); | |
| currentChar++; | |
| if (currentChar === fullCommand.length) { | |
| isDeleting = true; | |
| setTimeout(typeWriter, 1500); | |
| } else { | |
| setTimeout(typeWriter, 100); | |
| } | |
| } | |
| } | |
| setTimeout(typeWriter, 1000); | |
| } | |
| }); |