Spaces:
Running
Running
Download plan.html from HenrikMolin72/test-space: direct link, hf CLI and curl.
- Browser
- Download file 4.59 kB
-
https://huggingface.co/spaces/HenrikMolin72/test-space/resolve/main/plan.html
- Command line
-
hf download hf://spaces/HenrikMolin72/test-space/plan.html
-
curl -L -o plan.html https://huggingface.co/spaces/HenrikMolin72/test-space/resolve/main/plan.html
4.59 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Content Plan</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet"> | |
| <script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| </head> | |
| <body class="bg-gray-50"> | |
| <div class="min-h-screen"> | |
| <!-- Header --> | |
| <header class="bg-white shadow-sm"> | |
| <div class="max-w-7xl mx-auto px-4 py-4 sm:px-6 lg:px-8 flex justify-between items-center"> | |
| <h1 class="text-2xl font-bold text-gray-800">Content Hub</h1> | |
| <div class="flex items-center space-x-4"> | |
| <a href="index.html" class="text-blue-500 hover:text-blue-700 flex items-center"> | |
| <i data-feather="arrow-left" class="mr-1 w-4 h-4"></i> Dashboard | |
| </a> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Main Content --> | |
| <main class="max-w-3xl mx-auto p-6 space-y-6" data-aos="fade-up"> | |
| <div class="flex items-center justify-between"> | |
| <h1 class="text-xl font-bold">Plan for <span id="companyName"></span></h1> | |
| <button id="generatePlanBtn" class="px-3 py-2 rounded bg-black text-white"> | |
| Create Plan | |
| </button> | |
| </div> | |
| <div class="space-y-3" id="tasksContainer"> | |
| <p>No plan yet. Click "Create Plan".</p> | |
| </div> | |
| </main> | |
| </div> | |
| <script> | |
| AOS.init(); | |
| feather.replace(); | |
| // Load company data | |
| const company = JSON.parse(localStorage.getItem('mvp_company') || '{"name":"","industry":""}'); | |
| document.getElementById('companyName').textContent = company.name; | |
| // Generate plan | |
| document.getElementById('generatePlanBtn').addEventListener('click', async () => { | |
| const queries = JSON.parse(localStorage.getItem('mvp_queries') || '[]'); | |
| try { | |
| const response = await fetch('/api/plan/generate', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json' }, | |
| body: JSON.stringify({ | |
| company: company.name, | |
| industry: company.industry, | |
| queries | |
| }) | |
| }); | |
| const { steps } = await response.json(); | |
| // Save plan and create tasks | |
| localStorage.setItem('mvp_plan', JSON.stringify(steps)); | |
| const tasks = steps.map(step => ({ | |
| ...step, | |
| id: crypto.randomUUID(), | |
| status: 'not_started' | |
| })); | |
| localStorage.setItem('mvp_tasks', JSON.stringify(tasks)); | |
| renderTasks(tasks); | |
| } catch (error) { | |
| console.error('Error generating plan:', error); | |
| alert('Failed to generate plan. Please try again.'); | |
| } | |
| }); | |
| // Render tasks | |
| function renderTasks(tasks) { | |
| const container = document.getElementById('tasksContainer'); | |
| if (tasks.length === 0) { | |
| container.innerHTML = '<p>No plan yet. Click "Create Plan".</p>'; | |
| return; | |
| } | |
| container.innerHTML = tasks.map(task => ` | |
| <div class="border p-3 rounded"> | |
| <div class="text-sm uppercase opacity-60">${task.type}</div> | |
| <div class="font-semibold">${task.title}</div> | |
| <div class="text-sm opacity-80 mb-2">${task.why}</div> | |
| <div class="text-xs opacity-60 mb-2">Acceptance: ${task.acceptance}</div> | |
| <button onclick="location.href='/content/${task.id}'" class="px-3 py-2 rounded bg-black text-white"> | |
| Generate Draft | |
| </button> | |
| </div> | |
| `).join(''); | |
| } | |
| // Load existing tasks on page load | |
| const existingTasks = JSON.parse(localStorage.getItem('mvp_tasks') || '[]'); | |
| renderTasks(existingTasks); | |
| </script> | |
| </body> | |
| </html> |