archived:// http://homepages.go.com/~cooluser/index.html
index.html UTF-8 | LF | 1995-10-14

            
\n Ln 1, Col 1 1990 Web Archive • Secure Connection • Preserved

----

Powered by GeoCities • Best viewed in Netscape 3.0

`; let formatted = originalCode; let isBeautified = false; const codeEditor = document.getElementById('codeEditor'); const lineNumbers = document.getElementById('lineNumbers'); const searchInput = document.getElementById('searchInput'); const matchCount = document.getElementById('matchCount'); const beautifyBtn = document.getElementById('beautifyBtn'); function highlightSyntax(code) { return code .replace(/&/g, '&').replace(//g, '>') .replace(/(<!--[\s\S]*?-->)/g, '$1') .replace(/(<!DOCTYPE[^&]*>)/gi, '$1') .replace(/(<\/?)(\w+)(.*?)(\/?>)/g, (match, p1, p2, p3, p4) => { const attrs = p3.replace(/([\w-]+)(\s*=\s*)(".*?")/g, (m, attr, eq, val) => ` ${attr}${eq}${val}`); return `${p1}${p2}${attrs}${p4}`; }); } function updateLines() { const lines = formatted.split('\n'); lineNumbers.innerHTML = lines.map((_, i) => i + 1).join('\n'); codeEditor.innerHTML = highlightSyntax(formatted); } updateLines(); // Sync scroll codeEditor.addEventListener('scroll', () => { lineNumbers.scrollTop = codeEditor.scrollTop; }); // Search let searchTimeout; searchInput.addEventListener('input', () => { clearTimeout(searchTimeout); searchTimeout = setTimeout(() => { const term = searchInput.value.trim(); if (!term) { matchCount.textContent = '0 matches'; codeEditor.innerHTML = highlightSyntax(formatted); codeEditor.classList.remove('marked'); return; } const regex = new RegExp(`(${term.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')})`, 'gi'); let matches = formatted.match(regex); matchCount.textContent = matches ? matches.length + ' matches' : '0 matches'; codeEditor.classList.add('marked'); codeEditor.innerHTML = highlightSyntax(formatted) .replace(new RegExp(`(${term.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')})`, 'gi'), '$1'); }, 200); }); // Beautify toggle beautifyBtn.addEventListener('click', () => { isBeautified = !isBeautified; beautifyBtn.classList.toggle('active', isBeautified); if (isBeautified) { formatted = originalCode.replace(/>/g, '>\n').replace(/ { let indent = 0; if (line.includes('') && !line.includes(' { navigator.clipboard.writeText(isBeautified ? formatted : originalCode); const btn = document.getElementById('copyBtn'); const original = btn.innerHTML; btn.innerHTML = '✓ Copied!'; btn.style.color = 'var(--neon-green)'; setTimeout(() => { btn.innerHTML = original; btn.style.color = ''; }, 2000); }); // Download document.getElementById('downloadBtn').addEventListener('click', () => { const blob = new Blob([isBeautified ? formatted : originalCode], { type: 'text/html' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = 'archived_1995_cooluser.html'; a.click(); URL.revokeObjectURL(url); }); // Render document.getElementById('renderBtn').addEventListener('click', () => { alert('Redirecting to preserved render environment...\n\n[Simulated] Opening Netscape Navigator 3.0 compatibility layer.'); }); // Cursor tracking codeEditor.addEventListener('click', (e) => { const range = window.getSelection().getRangeAt(0); const pre = document.createElement('span'); range.insertNode(pre); const text = codeEditor.textContent.substring(0, pre.offsetParent ? codeEditor.textContent.indexOf(pre.textContent) : -1); const lines = text.split('\n'); const ln = lines.length; const col = lines[ln-1].length + 1; document.getElementById('cursorPos').textContent = `Ln ${ln}, Col ${col}`; pre.remove(); });