CODE MORPH ENGINE AI SUGGEST
📄 🎨 MORPH
📁
🔍
🔄
📥
📄 index.html
🌐 LIVE PREVIEW
📟 CONSOLE
⚠ PROBLEMS
● Code Morph Engine • Intelligent auto-suggestions active for HTML/CSS/JS
💡 Try typing: <h , background , console.
🔄 SUGGEST READY HTML ✓ Active Ln 1, Col 1
✨ Suggestion applied
`, 'style.css': `* { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: system-ui, sans-serif; background: linear-gradient(135deg, #667eea, #764ba2); min-height: 100vh; display: flex; align-items: center; justify-content: center; } .container { background: rgba(255,255,255,0.95); border-radius: 32px; padding: 48px; text-align: center; max-width: 600px; animation: fadeIn 0.5s ease; } @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } h1 { background: linear-gradient(135deg, #667eea, #764ba2); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 16px; } p { color: #666; margin-bottom: 24px; line-height: 1.6; } button { background: linear-gradient(135deg, #667eea, #764ba2); color: white; border: none; padding: 12px 32px; border-radius: 40px; cursor: pointer; transition: transform 0.2s; } button:hover { transform: scale(1.05); }`, 'script.js': `document.addEventListener('DOMContentLoaded', () => { console.log('Code Morph Engine active'); const btn = document.getElementById('demoBtn'); if(btn) { btn.addEventListener('click', () => { alert('✨ Auto-suggestions working! Try typing in the editor.'); }); } });` }; // DOM Elements const editor = document.getElementById('codeEditor'); const lineNumbersDiv = document.getElementById('lineNumbers'); const previewFrame = document.getElementById('previewFrame'); const acBox = document.getElementById('autocomplete'); const consoleOutput = document.getElementById('consoleOutput'); // Initialize editor.value = files['index.html']; updateLineNumbers(); runCode(); editor.focus(); function updateLineNumbers() { const lines = editor.value.split('\n').length; lineNumbersDiv.innerHTML = Array.from({ length: lines }, (_, i) => `
${i + 1}
` ).join(''); } editor.addEventListener('scroll', () => { lineNumbersDiv.scrollTop = editor.scrollTop; }); function runCode() { let content = editor.value; let htmlContent = files['index.html']; let cssContent = files['style.css']; let jsContent = files['script.js']; if (currentFile === 'index.html') htmlContent = content; else if (currentFile === 'style.css') cssContent = content; else if (currentFile === 'script.js') jsContent = content; let finalHTML = htmlContent; finalHTML = finalHTML.replace(//i, ``); finalHTML = finalHTML.replace(/