37722-vm/assets/js/main.js
2026-01-24 18:55:46 +00:00

85 lines
3.2 KiB
JavaScript

document.addEventListener('DOMContentLoaded', () => {
const inputArea = document.getElementById('input-code');
const outputArea = document.getElementById('output-code');
const protectBtn = document.getElementById('protect-btn');
const terminal = document.getElementById('terminal');
const copyBtn = document.getElementById('copy-btn');
function log(message, type = 'info') {
const entry = document.createElement('div');
entry.className = `log-entry log-${type}`;
const time = new Date().toLocaleTimeString([], { hour12: false });
entry.textContent = `[${time}] ${message}`;
terminal.appendChild(entry);
terminal.scrollTop = terminal.scrollHeight;
}
async function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
protectBtn.addEventListener('click', async () => {
const code = inputArea.value.trim();
if (!code) {
log('FAILED: No source input detected.', 'warn');
return;
}
protectBtn.disabled = true;
protectBtn.style.opacity = '0.5';
terminal.innerHTML = '';
log(`INITIALIZING LUARTEX V11.0 QUANTUM SINGULARITY ENGINE`, 'info');
await sleep(300);
log(`PROTOCOL: ILD (LINKED INSTRUCTION DISPATCHING)`, 'info');
await sleep(400);
log(`QUANTUM: Synchronizing State-Hash with Environment Entropy...`, 'info');
await sleep(400);
log(`MIRROR: Deploying Deceptive Logic Reality Paths...`, 'info');
await sleep(400);
log(`SINGULARITY: Collapsing Constant Space into Transient Synthesis...`, 'info');
await sleep(300);
log(`TRAP: Arming Quantum Observation Detectors...`, 'info');
await sleep(300);
log(`NEURAL: Mapping Opcode Meaning to Execution History...`, 'info');
await sleep(400);
log(`SPAGHETTI: Shuffling Instruction Topology...`, 'info');
await sleep(300);
try {
const response = await fetch('process.php', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ code })
});
const data = await response.json();
if (data.success) {
await sleep(500);
outputArea.value = data.protected_code;
log(`SUCCESS: Luartex V11.0 Quantum Singularity VM Online.`, 'success');
log(`Traceability: ZERO | Observation Resistance: ABSOLUTE`, 'success');
log(`Topology: SPAGHETTI-LINKED | Seed: ${data.stats.seed}`, 'success');
} else {
log(`CRITICAL ERROR: ${data.error}`, 'warn');
}
} catch (err) {
log(`ENGINE FAILURE: ${err.message}`, 'warn');
} finally {
protectBtn.disabled = false;
protectBtn.style.opacity = '1';
}
});
copyBtn.addEventListener('click', () => {
if (!outputArea.value) return;
navigator.clipboard.writeText(outputArea.value);
const originalText = copyBtn.textContent;
copyBtn.textContent = 'COPIED';
setTimeout(() => copyBtn.textContent = originalText, 2000);
});
});