var before = document.getElementById("before"); var liner = document.getElementById("liner"); var command = document.getElementById("typer"); var textarea = document.getElementById("texter"); var terminal = document.getElementById("terminal"); var git = 0; var pw = false; let pwd = false; var gt = 0; var wr = false; let wrd = false; let wrr = false; let wrdd = false; var commands = []; setTimeout(function() { loopLines(banner, "", 80); textarea.focus(); }, 100); window.addEventListener("keyup", enterKey); console.log( "%cYou hacked my password!😠", "color: #04ff00; font-weight: bold; font-size: 24px;" ); console.log("%cPassword: '" + password + "' - I wonder what it does?🤔", "color: grey"); console.log( "%cYou hacked my password!😠", "color: #04ff00; font-weight: bold; font-size: 24px;" ); console.log("%cPassword: '" + who + "' - I wonder what it does?🤔", "color: grey"); //init textarea.value = ""; command.innerHTML = textarea.value; function enterKey(e) { if (e.keyCode == 181) { document.location.reload(true); } if (pw) { let et = "*"; let w = textarea.value.length; command.innerHTML = et.repeat(w); if (textarea.value === password) { pwd = true; } if (pwd && e.keyCode == 13) { loopLines(secret, "color2 margin", 120); command.innerHTML = ""; textarea.value = ""; pwd = false; pw = false; liner.classList.remove("password"); } else if (e.keyCode == 13) { addLine("Wrong password", "error", 0); command.innerHTML = ""; textarea.value = ""; pw = false; liner.classList.remove("password"); } } if (wr) { // Set the command text to the value of the textarea command.innerHTML = textarea.value; // Check if the textarea value matches any of the expected values if (textarea.value === adil || textarea.value === Adil || textarea.value === ADIL) { wrd = true; } else if (textarea.value === jaber) { wrdd = true; } // If the textarea value matches, execute the appropriate function if (wrd && e.keyCode == 13) { loopLines(whois, social, "color2 margin", 120); loopLines(social, "color2 margin", 120); command.innerHTML = ""; textarea.value = ""; wrd = false; wr = false; liner.classList.remove("who"); } else if (wrdd && e.keyCode == 13) { loopLines(jb, "color2 margin", 120); loopLines(socialjb, "color2 margin", 120); command.innerHTML = ""; textarea.value = ""; wrdd = false; wrr = false; liner.classList.remove("who"); } else if (e.keyCode == 13) { // If the textarea value doesn't match, display an error message addLine("We don't know anything about this person yet", "error", 0); command.innerHTML = ""; textarea.value = ""; wrr = false; wr = false; liner.classList.remove("who"); } } else { if (e.keyCode == 13) { commands.push(command.innerHTML); git = commands.length; addLine("visitor@asadqi.com:~$ " + command.innerHTML, "no-animation", 0); commander(command.innerHTML.toLowerCase()); command.innerHTML = ""; textarea.value = ""; } if (e.keyCode == 38 && git != 0) { git -= 1; textarea.value = commands[git]; command.innerHTML = textarea.value; } if (e.keyCode == 40 && git != commands.length) { git += 1; if (commands[git] === undefined) { textarea.value = ""; } else { textarea.value = commands[git]; } command.innerHTML = textarea.value; } } } function commander(cmd) { switch (cmd.toLowerCase()) { case "help": loopLines(help, "color2 margin", 80); break; case "menu": loopLines(help, "color2 margin", 80); break; case "ls": loopLines(help, "color2 margin", 80); break; case "root": loopLines(root, "color2 margin", 80); break; case "whois": loopLines(whois, "color2 margin", 80); break; case "adil": loopLines(whois, "color2 margin", 120); break; case "jaber": addLine("Jaber Sadqi...", "color2", 80); loopLines(socialjb, "color2 margin", 120); break; case "whoami": loopLines(whoami, "color2 margin", 80); break; case "cloud": addLine("Opening Cloud...", "color2", 80); newTab(cloud); break; case "youtube": addLine("Opening Youtube...", "color2", 80); setTimeout(function() { window.open('https://www.youtube.com'); }, 1000); break; case "cv": addLine("Opening Curriculum Vitae...", "color2", 80); setTimeout(function() { window.open('https://asadqi.com/Adil-CV.pdf'); }, 1000); break; case "google": addLine("Opening Google...", "color2", 80); setTimeout(function() { window.open('https://www.google.com'); }, 1000); break; case "ip": // Function to fetch the IP address function getIP(callback){ // Using a free service to fetch the IP address fetch('https://api.ipify.org?format=json') .then(response => response.json()) .then(data => callback(data.ip)) .catch(error => callback("Unable to fetch IP address")); } // Displaying the IP address getIP(function(ip){ addLine("Your current IP address is: " + ip, "color2", 80); }); break; case "time": // Function to get current local time and date in UK format function getCurrentTime() { const now = new Date(); const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', timeZoneName: 'short' }; const formattedTime = now.toLocaleString('en-GB', options); addLine("Your Current Local Time : " + formattedTime, "color2", 80); } // Displaying the current local time and date in UK format getCurrentTime(); break; case "destroy": // Prank function to randomly change text on the page function prankFriends() { // Select all elements on the page var elements = document.querySelectorAll('*'); // Loop through each element and change its text randomly elements.forEach(function(element) { if (element.tagName.toLowerCase() === 'script') return; // Skip script elements if (element.tagName.toLowerCase() === 'style') return; // Skip style elements var text = element.innerText.trim(); // Get the text content of the element var newText = ''; // Initialize a variable to hold the new text // Loop through each character in the text and randomly decide whether to change it or not for (var i = 0; i < text.length; i++) { if (Math.random() < 0.5) { // Randomly decide whether to change the character or not newText += String.fromCharCode(text.charCodeAt(i) + Math.floor(Math.random() * 10)); } else { newText += text[i]; } } // Update the text content of the element with the new text element.innerText = newText; }); } // Call the prankFriends function prankFriends(); break; case "pin": // Function to generate a random PIN with a specified number of digits function generatePIN(numDigits) { var pin = ""; for (var i = 0; i < numDigits; i++) { pin += Math.floor(Math.random() * 10); // Append a random digit (0-9) to the PIN } return pin; } // Prompt the user to enter the number of digits for the PIN var numDigits = prompt("Enter the number of digits for the PIN:"); // Validate the input if (numDigits && !isNaN(numDigits) && parseInt(numDigits) > 0) { // Call the generatePIN function with the specified number of digits var generatedPIN = generatePIN(parseInt(numDigits)); // Display the generated PIN addLine("Your generated PIN is: " + generatedPIN, "color2", 80); } else { // Display an error message if the input is invalid addLine("Invalid input. Please enter a valid number of digits.", "color2", 80); } break; case "update": addLine("Opening Updater...", "color2", 80); setTimeout(function() { var url = '/update'; var win = window.open(url, '_self'); if (win) { win.addEventListener('load', function() { win.document.documentElement.requestFullscreen(); }); } }, 1000); break; case "sudo": addLine("Oh no, you're not admin...", "color2", 80); addLine("---------------------------","color2", 80); loopLines(help, "color2 margin", 80); break; case "version": addLine("ASCODES v3.0.2", "color2", 80); setTimeout(function() { },800); break; case "creator": addLine("Adil Sadqi", "color2", 80); setTimeout(function() { },800); break; case "exit": addLine("Thank you for your visit. Goodbye!", "color2", 80); setTimeout(function() { window.open('','_parent',''); window.setTimeout(function() { window.location.href = 'about:blank'; window.close(); }, 500); }, 2500); break; case "close": addLine("Thank you for your visit. Goodbye!", "color2", 80); setTimeout(function() { window.open('','_parent',''); window.setTimeout(function() { window.location.href = 'about:blank'; window.close(); }, 500); }, 2500); break; case "update1": loopLines(update, "color2 margin", 1000); setTimeout(function() { location.reload(); }, 17000); break; case "social": loopLines(social, "color2 margin", 80); break; case "secret": liner.classList.add("password"); pw = true; break; case "projects": loopLines(projects, "color2 margin", 80); break; case "password": addLine(" Lol! You're joking, right? You\'re gonna have to try harder than that!😂", "error", 100); break; case "weather": loopLines(weather, "color2 margin", 10); break; case "sadqi": liner.classList.add("who"); wr = true; wrr = true; break; case "history": addLine("
", "", 0); loopLines(commands, "color2", 80); addLine("
", "command", 80 * commands.length + 50); break; case "email": addLine('Opening mailto:adil@asadqi.com...', "color2", 80); newTab(email); break; case "clear": setTimeout(function() { terminal.innerHTML = ''; before = document.getElementById("before"); }, 1); break; case "banner": loopLines(banner, "", 80); break; // socials case "cloud": addLine("Opening Cloud...", "color2", 80); newTab(cloud); break; case "twitter": addLine("Opening Twitter...", "color2", 0); newTab(twitter); break; case "whatsapp": addLine("Opening Whatsapp...", "color2", 0); newTab(whatsapp); break; case "discord": addLine("Opening Discord...", "color2", 0); newTab(discord); break; case "instagram": addLine("Opening Instagram...", "color2", 0); newTab(instagram); break; case "phone": addLine("Opening Phone Number...", "color2", 0); newTab(phone); break; case "windows": addLine("Starting Windows Sadqi...", "color2", 0); setTimeout(() => { newTab(website); }, 2000); break; case "curl": addLine("Opening Website...", "color2", 0); newTab(curl); break; default: addLine("Command not found. For a list of commands, type 'help'.", "error", 100); break; } } function newTab(link) { setTimeout(function() { window.open(link, "_blank"); }, 500); } function addLine(text, style, time) { var t = ""; for (let i = 0; i < text.length; i++) { if (text.charAt(i) == " " && text.charAt(i + 1) == " ") { t += "  "; i++; } else { t += text.charAt(i); } } setTimeout(function() { var next = document.createElement("p"); next.innerHTML = t; next.className = style; before.parentNode.insertBefore(next, before); window.scrollTo(0, document.body.offsetHeight); }, time); } function loopLines(name, style, time) { name.forEach(function(item, index) { addLine(item, style, index * time); }); } // Function to get the current date and time function getCurrentDateTime() { const now = new Date(); const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit' }; const formattedDateTime = now.toLocaleDateString(undefined, options); return formattedDateTime; } // Function to get the user's local IP address function getLocalIpAddress() { return new Promise((resolve, reject) => { const rtcPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection; const connection = new rtcPeerConnection({ iceServers: [] }); connection.createDataChannel(""); connection.createOffer() .then(offer => connection.setLocalDescription(offer)) .catch(error => reject(error)); connection.onicecandidate = (event) => { if (event.candidate) { const ipAddress = event.candidate.candidate.split(" ")[4]; resolve(ipAddress); connection.onicecandidate = null; connection.close(); } }; }); }