Spaces:
Running
Running
File size: 2,052 Bytes
8b7724e |
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 |
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);
}
}); |