now make this the best code editor site but it will require money so their will be a credits system you will start with 100,000 credits and everytime you generate a project you will spend 20,000 credits meaning only 10 projects and then you gotta pay $10.90 for CA plus to generate more projects and make multiple pages like search engines and then make the login or resteragion actually work then make it the fastest and best site there is out there it will also be a manual code editor ai is optional but ai will cost you you use ai you will get only one project then have to pay money
3afcae2 verified | <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Code Editor - CodeCraft AI</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.js"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| <style> | |
| #editor { | |
| position: absolute; | |
| top: 0; | |
| right: 0; | |
| bottom: 0; | |
| left: 0; | |
| } | |
| .editor-container { | |
| height: 70vh; | |
| position: relative; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-100"> | |
| <header class="bg-gray-900 text-white p-4"> | |
| <div class="container mx-auto flex justify-between items-center"> | |
| <div class="flex items-center"> | |
| <i data-feather="code" class="mr-2"></i> | |
| <h1 class="text-xl font-bold">CodeCraft AI Editor</h1> | |
| </div> | |
| <div class="flex items-center space-x-4"> | |
| <div class="bg-purple-600 px-3 py-1 rounded-full text-sm"> | |
| Credits: <span id="credit-counter">100,000</span> | |
| </div> | |
| <button id="ai-assist" class="px-3 py-1 bg-green-600 hover:bg-green-700 rounded text-sm"> | |
| AI Assist (50,000 credits) | |
| </button> | |
| <a href="pricing.html" class="px-3 py-1 bg-yellow-600 hover:bg-yellow-700 rounded text-sm"> | |
| Get More Credits | |
| </a> | |
| </div> | |
| </div> | |
| </header> | |
| <div class="container mx-auto p-4"> | |
| <div class="grid grid-cols-1 lg:grid-cols-2 gap-4"> | |
| <div class="bg-white rounded-lg shadow-lg overflow-hidden"> | |
| <div class="p-3 bg-gray-800 text-white flex justify-between"> | |
| <div class="flex space-x-2"> | |
| <button class="px-2 py-1 bg-gray-700 rounded text-xs active-tab" data-lang="html">HTML</button> | |
| <button class="px-2 py-1 bg-gray-700 rounded text-xs" data-lang="css">CSS</button> | |
| <button class="px-2 py-1 bg-gray-700 rounded text-xs" data-lang="javascript">JS</button> | |
| </div> | |
| <button id="run-code" class="px-3 py-1 bg-purple-600 hover:bg-purple-700 rounded text-xs"> | |
| Run (20,000 credits) | |
| </button> | |
| </div> | |
| <div class="editor-container"> | |
| <div id="editor"></div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-lg shadow-lg overflow-hidden"> | |
| <div class="p-3 bg-gray-800 text-white"> | |
| <h3 class="text-sm font-bold">Output</h3> | |
| </div> | |
| <iframe id="output-frame" class="w-full h-full min-h-[70vh] border-0"></iframe> | |
| </div> | |
| </div> | |
| <div class="mt-4 bg-white rounded-lg shadow-lg overflow-hidden hidden" id="ai-panel"> | |
| <div class="p-3 bg-gray-800 text-white"> | |
| <h3 class="text-sm font-bold">AI Coding Assistant</h3> | |
| </div> | |
| <div class="p-4"> | |
| <textarea id="ai-prompt" class="w-full p-2 border rounded mb-2" placeholder="Describe what you want the AI to help with..."></textarea> | |
| <button id="ai-submit" class="px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded"> | |
| Generate Code (50,000 credits) | |
| </button> | |
| <div id="ai-response" class="mt-4 p-2 bg-gray-100 rounded hidden"></div> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| </script> | |
| </body> | |
| </html>`, -1); | |
| // Tab switching | |
| document.querySelectorAll('[data-lang]').forEach(tab => { | |
| tab.addEventListener('click', () => { | |
| document.querySelector('.active-tab').classList.remove('active-tab'); | |
| tab.classList.add('active-tab'); | |
| const mode = `ace/mode/${tab.dataset.lang}`; | |
| editor.session.setMode(mode); | |
| }); | |
| }); | |
| // Run code | |
| document.getElementById('run-code').addEventListener('click', () => { | |
| const credits = parseInt(document.getElementById('credit-counter').textContent); | |
| if (credits < 20000) { | |
| alert('Not enough credits! Please upgrade to CA Plus.'); | |
| return; | |
| } | |
| const code = editor.getValue(); | |
| const frame = document.getElementById('output-frame'); | |
| frame.srcdoc = code; | |
| // Deduct credits | |
| document.getElementById('credit-counter').textContent = credits - 20000; | |
| }); | |
| // AI Assist | |
| document.getElementById('ai-assist').addEventListener('click', () => { | |
| document.getElementById('ai-panel').classList.toggle('hidden'); | |
| }); | |
| document.getElementById('ai-submit').addEventListener('click', () => { | |
| const credits = parseInt(document.getElementById('credit-counter').textContent); | |
| if (credits < 50000) { | |
| alert('Not enough credits for AI assist! Please upgrade to CA Plus.'); | |
| return; | |
| } | |
| const prompt = document.getElementById('ai-prompt').value; | |
| if (!prompt.trim()) { | |
| alert('Please enter a prompt for the AI'); | |
| return; | |
| } | |
| // Simulate AI response | |
| document.getElementById('ai-response').classList.remove('hidden'); | |
| document.getElementById('ai-response').innerHTML = ` | |
| <p class="text-green-600 font-bold">AI Response:</p> | |
| <p>Here's a suggested implementation based on your request:</p> | |
| <pre class="bg-gray-200 p-2 mt-2 rounded">${prompt.includes('button') ? | |
| '<button class="px-4 py-2 bg-purple-600 text-white rounded">New Button</button>' : | |
| '// AI generated code would appear here'}</pre> | |
| <button class="mt-2 px-3 py-1 bg-blue-600 text-white rounded text-sm"> | |
| Insert into Editor | |
| </button> | |
| `; | |
| // Deduct credits | |
| document.getElementById('credit-counter').textContent = credits - 50000; | |
| }); | |
| </script> | |
| </body> | |
| </html> |