ELEVATE OS

Full-Stack Engine v5.0

Apply class="reveal" (or reveal-left, reveal-scale) to section headings, cards, images, etc. Add style="transition-delay: 0.1s" inline for staggered effects. ════════════════════════════════════════ 🎨 DESIGN SYSTEM — FOLLOW EXACTLY: ════════════════════════════════════════ COLORS: - Background: #030303 or #050507 (near black) - Cards: rgba(255,255,255,0.04) with border: 1px solid rgba(255,255,255,0.08) - Accent: #3b82f6 (blue) or #8b5cf6 (purple) — use gradients between them - Text: #ffffff (headings), #a1a1aa (body), #52525b (muted) TYPOGRAPHY: - Import: - font-family: 'Inter', sans-serif on body - Hero headings: font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 900; line-height: 1.05; - Subheadings: font-size: 1.25rem; font-weight: 700; GLASSMORPHISM CARDS: background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09); border-radius: 20px; backdrop-filter: blur(16px); transition: transform 0.3s, border-color 0.3s; :hover { transform: translateY(-4px); border-color: rgba(59,130,246,0.4); } BUTTONS: - Primary: background: linear-gradient(135deg, #3b82f6, #6366f1); color: white; border-radius: 12px; padding: 14px 32px; font-weight: 700; transition: all 0.3s; box-shadow: 0 4px 24px rgba(59,130,246,0.35); - :hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(59,130,246,0.5); } GRADIENT TEXT: background: linear-gradient(135deg, #fff 0%, #a78bfa 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; ════════════════════════════════════════ 📐 LAYOUT RULES: ════════════════════════════════════════ - Use CSS Grid and Flexbox — NO Tailwind utility classes (they require CDN initialization) - Fully responsive with media queries for mobile (max-width: 768px) - Max content width: 1200px centered with margin: 0 auto; padding: 0 24px; - Section padding: padding: 100px 0; - Bento grid: display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; ════════════════════════════════════════ 🖼️ IMAGES: ════════════════════════════════════════ Use real Unsplash URLs. Format: https://images.unsplash.com/photo-{ID}?w=800&auto=format&fit=crop&q=80 Examples by category: - Tech/code: photo-1461749280684-dccba630e2f6 - Business: photo-1507003211169-0a1dd7228f2d - Design: photo-1558655146-9f40138edfeb - Coffee: photo-1495474472287-4d71bcdd2085 - Architecture: photo-1486325212027-8081e485255e ════════════════════════════════════════ 💾 DATA & BACKEND: ════════════════════════════════════════ - Use localStorage for all data storage (CRUD operations) - Seed realistic sample data on first load - Add toast notification system (pure JS, no libraries) - Include working forms with client-side validation ════════════════════════════════════════ 📦 ALLOWED CDN LIBRARIES (these work reliably): ════════════════════════════════════════ - Lucide icons: then lucide.createIcons() - Chart.js: https://cdn.jsdelivr.net/npm/chart.js@4/dist/chart.umd.min.js (only if charts needed) - Supabase: https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2/dist/umd/supabase.min.js (only if configured) ════════════════════════════════════════ ⚡ OUTPUT FORMAT: ════════════════════════════════════════ - Output ONLY raw HTML. Start immediately with - No markdown. No code fences. No explanations before or after. - The file must be 100% self-contained and work when opened in any browser.`; // ===== HTML SANITIZER — Removes broken libraries before rendering ===== function sanitizeHTML(html) { // Strip AOS library references html = html.replace(/]+aos[^>]*>/gi, ''); html = html.replace(/]+aos[^>]*><\/script>/gi, ''); html = html.replace(/AOS\.init\([^)]*\);?/g, ''); // Remove data-aos attributes (they show as raw text if AOS not loaded) html = html.replace(/\s*data-aos(?:-\w+)?="[^"]*"/g, ''); html = html.replace(/\s*data-aos(?:-\w+)?='[^']*'/g, ''); // Strip GSAP ScrollTrigger references html = html.replace(/]+ScrollTrigger[^>]*><\/script>/gi, ''); html = html.replace(/]+gsap[^>]*><\/script>/gi, ''); // Strip Framer Motion (broken in iframes) html = html.replace(/]+framer-motion[^>]*><\/script>/gi, ''); // Fix Tailwind CDN usage — keep it since it often works // Remove any stray markdown artifacts html = html.replace(/^```html\s*/i, '').replace(/^```\s*/i, '').replace(/\s*```$/i, '').trim(); return html; } // ===== UNLOCK ===== function unlock() { const pass = document.getElementById('sys-pass').value; if (pass === "Elevate2026!@") { const gate = document.getElementById('gate'); gate.style.opacity = '0'; gate.style.transform = 'scale(1.05)'; gate.style.transition = 'all 0.4s ease'; setTimeout(() => { gate.style.display = 'none'; document.getElementById('app').classList.remove('hidden'); loadState(); lucide.createIcons(); }, 400); } else { document.getElementById('sys-pass').style.borderColor = '#ef4444'; document.getElementById('sys-pass').style.animation = 'shake 0.3s ease'; setTimeout(() => document.getElementById('sys-pass').style.borderColor = '', 1000); showToast('Wrong Key! ❌', 'error'); } } document.getElementById('sys-pass').addEventListener('keydown', e => { if (e.key === 'Enter') unlock(); }); // ===== SETTINGS ===== function openSettings() { document.getElementById('settings-modal').classList.toggle('hidden'); } function saveConfig() { localStorage.setItem('or_key', document.getElementById('api-key').value); localStorage.setItem('sb_url', document.getElementById('sb-url').value); localStorage.setItem('sb_key', document.getElementById('sb-key').value); openSettings(); showToast('Configuration saved ✓', 'success'); } function loadState() { document.getElementById('api-key').value = localStorage.getItem('or_key') || ''; document.getElementById('sb-url').value = localStorage.getItem('sb_url') || ''; document.getElementById('sb-key').value = localStorage.getItem('sb_key') || ''; document.getElementById('user-input').value = localStorage.getItem('draft') || ''; const savedModel = localStorage.getItem('model'); if (savedModel) document.getElementById('model-select').value = savedModel; try { versions = JSON.parse(localStorage.getItem('versions') || '[]'); } catch { versions = []; } renderVersions(); updateStats(); } // ===== VIEW MODES ===== function setViewMode(mode) { viewMode = mode; const container = document.getElementById('split-container'); const codePaneEl = document.getElementById('code-pane'); const previewEl = document.getElementById('preview-viewport').parentElement; ['btn-preview', 'btn-split', 'btn-code'].forEach(id => { document.getElementById(id)?.classList.remove('active'); }); document.getElementById('btn-' + mode)?.classList.add('active'); if (mode === 'preview') { container.className = 'preview-only h-full gap-3'; codePaneEl.classList.add('hidden'); previewEl.style.display = ''; } else if (mode === 'split') { container.className = 'h-full gap-3'; container.style.gridTemplateColumns = '1fr 1fr'; codePaneEl.classList.remove('hidden'); codePaneEl.style.display = 'flex'; previewEl.style.display = ''; } else if (mode === 'code') { container.style.gridTemplateColumns = '1fr'; codePaneEl.classList.remove('hidden'); previewEl.style.display = 'none'; } lucide.createIcons(); } function toggleMobile() { isMobile = !isMobile; document.getElementById('preview-viewport').classList.toggle('mobile-mode', isMobile); } function openNewTab() { if (!currentCode) { showToast('Build something first!', 'info'); return; } const blob = new Blob([currentCode], { type: 'text/html' }); window.open(URL.createObjectURL(blob), '_blank'); } // ===== CODE ACTIONS ===== function copyCode() { if (!currentCode) { showToast('No code to copy!', 'info'); return; } navigator.clipboard.writeText(currentCode).then(() => showToast('Code copied to clipboard ✓', 'success')); } function downloadCode() { if (!currentCode) { showToast('Build something first!', 'info'); return; } const name = prompt('File name:', 'my-website') || 'my-website'; const blob = new Blob([currentCode], { type: 'text/html' }); const a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = name.endsWith('.html') ? name : name + '.html'; a.click(); showToast('Downloaded! 📁', 'success'); } // ===== PROMPT HELPERS ===== function setPrompt(text) { const input = document.getElementById('user-input'); input.value = text; input.focus(); updateStats(); localStorage.setItem('draft', text); } function clearPrompt() { document.getElementById('user-input').value = ''; localStorage.removeItem('draft'); updateStats(); } function autoExpand(el) { el.style.height = 'auto'; el.style.height = Math.min(el.scrollHeight, 140) + 'px'; updateStats(); localStorage.setItem('draft', el.value); } // ===== STATUS ===== function setStatus(state, text) { const dot = document.getElementById('status-dot'); const textEl = document.getElementById('status-text'); dot.className = 'status-dot ' + state; textEl.textContent = text; } function setProgressStep(step) { ['analyze', 'generate', 'render'].forEach((s, i) => { const el = document.getElementById('step-' + s); const steps = ['analyze', 'generate', 'render']; const stepIdx = steps.indexOf(step); if (i < stepIdx) el.className = 'progress-step done'; else if (i === stepIdx) el.className = 'progress-step active'; else el.className = 'progress-step'; }); const stageTexts = { analyze: 'Analyzing your request...', generate: 'AI is generating code...', render: 'Rendering preview...' }; document.getElementById('build-stage').textContent = stageTexts[step] || step; } // ===== VERSIONS ===== function saveVersion(prompt, code, model) { const v = { id: Date.now(), prompt: prompt.substring(0, 60) + (prompt.length > 60 ? '...' : ''), code, model, time: new Date().toLocaleTimeString('ar', { hour: '2-digit', minute: '2-digit' }) }; versions.unshift(v); if (versions.length > 10) versions.pop(); localStorage.setItem('versions', JSON.stringify(versions)); renderVersions(); updateStats(); } function loadVersion(id) { const v = versions.find(x => x.id === id); if (!v) return; currentCode = v.code; document.getElementById('preview-viewport').srcdoc = v.code; document.getElementById('code-panel').value = v.code; showToast('Version loaded ✓', 'success'); } function renderVersions() { const list = document.getElementById('versions-list'); if (!versions.length) { list.innerHTML = '

No versions yet

'; return; } list.innerHTML = versions.map(v => `
${v.model?.split('/')[1] || 'AI'} ${v.time}

${v.prompt}

`).join(''); } function toggleVersions() { document.getElementById('versions-panel').classList.toggle('hidden'); } function clearHistory() { if (!confirm('Clear all versions and settings?')) return; localStorage.clear(); versions = []; currentCode = ''; renderVersions(); document.getElementById('preview-viewport').srcdoc = ''; document.getElementById('code-panel').value = ''; openSettings(); showToast('Cleared ✓', 'success'); } function updateStats() { const chars = document.getElementById('user-input').value.length; document.getElementById('char-count').textContent = chars + ' chars'; document.getElementById('version-count').textContent = versions.length + ' versions'; } // ===== TOAST ===== function showToast(msg, type = 'info') { const t = document.getElementById('toast'); const colors = { success: '#22c55e', error: '#ef4444', info: '#3b82f6' }; t.textContent = msg; t.style.color = colors[type] || '#fff'; t.classList.add('show'); setTimeout(() => t.classList.remove('show'), 2500); } // ===== MAIN BUILD FUNCTION ===== async function executeBuild(isRefine = false) { const prompt = document.getElementById('user-input').value.trim(); const key = localStorage.getItem('or_key'); const sbUrl = localStorage.getItem('sb_url') || ''; const sbKey = localStorage.getItem('sb_key') || ''; const model = document.getElementById('model-select').value; if (!prompt) { showToast('Write a description first!', 'info'); return; } if (!key) { showToast('API Key missing — check settings!', 'error'); openSettings(); return; } const btn = document.getElementById('build-btn'); const refineBtn = document.getElementById('refine-btn'); const overlay = document.getElementById('build-overlay'); const ldr = document.getElementById('loader'); btn.disabled = true; refineBtn.disabled = true; btn.innerHTML = ' Building...'; lucide.createIcons(); overlay.classList.remove('hidden'); ldr.style.width = '20%'; setStatus('building-state', 'Building...'); setProgressStep('analyze'); const messages = [ { role: 'system', content: MASTER_PROMPT + (sbUrl ? `\n\nSupabase Config:\n- URL: ${sbUrl}\n- Anon Key: ${sbKey}\n\nInclude full Supabase integration using https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2/dist/umd/supabase.min.js` : '\n\nNo Supabase configured — use localStorage only.') } ]; if (isRefine && currentCode) { messages.push({ role: 'user', content: `Here is my current website HTML code:\n\n${currentCode.substring(0, 10000)}\n\nRefine and improve it based on this request: ${prompt}\n\nIMPORTANT: Keep all the existing design and functionality. Only make the requested changes. Do NOT use AOS library or any scroll animation library. Use the reveal/IntersectionObserver pattern only.` }); } else { messages.push({ role: 'user', content: `Build a complete, stunning, production-ready website for the following:\n\n${prompt}\n\nREMINDERS:\n- Use ONLY the reveal/IntersectionObserver pattern for scroll animations (no AOS, no GSAP, no Framer Motion)\n- Write all CSS in