Spaces:
Running
Running
Download index.html from Yashomx/test-website: direct link, hf CLI and curl.
- Browser
- Download file 42.9 kB
-
https://huggingface.co/spaces/Yashomx/test-website/resolve/main/index.html
- Command line
-
hf download hf://spaces/Yashomx/test-website/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Yashomx/test-website/resolve/main/index.html
42.9 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>NextGen Builder - AI-Powered Website Builder with Next.js Support</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <script src="https://unpkg.com/konva@8.3.2/konva.min.js"></script> | |
| <style> | |
| @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap'); | |
| body { | |
| font-family: 'Inter', sans-serif; | |
| } | |
| .sidebar { | |
| transition: all 0.3s ease; | |
| } | |
| .component-item { | |
| transition: all 0.2s ease; | |
| box-shadow: 0 1px 2px rgba(0,0,0,0.05); | |
| } | |
| .component-item:hover { | |
| transform: translateY(-2px); | |
| box-shadow: 0 4px 6px rgba(79, 70, 229, 0.1); | |
| } | |
| .dropzone { | |
| min-height: 300px; | |
| border: 2px dashed rgba(79, 70, 229, 0.3); | |
| transition: all 0.3s ease; | |
| background-color: rgba(249, 250, 251, 0.5); | |
| } | |
| .dropzone.active { | |
| border-color: #4F46E5; | |
| background-color: rgba(79, 70, 229, 0.05); | |
| } | |
| .property-panel { | |
| transition: all 0.3s ease; | |
| box-shadow: -2px 0 4px rgba(0,0,0,0.02); | |
| } | |
| .code-editor { | |
| font-family: 'Fira Code', monospace; | |
| } | |
| .ai-suggestion { | |
| animation: pulse 2s infinite; | |
| background: linear-gradient(135deg, rgba(79, 70, 229, 0.03) 0%, rgba(124, 58, 237, 0.03) 100%); | |
| } | |
| .konva-stage { | |
| background-color: #f9fafb; | |
| border-radius: 8px; | |
| box-shadow: 0 4px 6px rgba(0,0,0,0.05); | |
| } | |
| .template-card:hover .template-overlay { | |
| opacity: 1; | |
| } | |
| .template-overlay { | |
| opacity: 0; | |
| transition: opacity 0.3s ease; | |
| background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%); | |
| } | |
| @keyframes pulse { | |
| 0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.2); } | |
| 70% { box-shadow: 0 0 0 8px rgba(79, 70, 229, 0); } | |
| 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); } | |
| } | |
| .gradient-text { | |
| background: linear-gradient(90deg, #4F46E5 0%, #9333EA 100%); | |
| -webkit-background-clip: text; | |
| background-clip: text; | |
| color: transparent; | |
| } | |
| .countdown-timer { | |
| font-family: 'Space Mono', monospace; | |
| font-weight: bold; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 h-screen overflow-hidden"> | |
| <div class="flex flex-col h-full"> | |
| <!-- Top Navigation --> | |
| <header class="bg-white shadow-sm py-3 px-6 flex items-center justify-between border-b border-gray-200"> | |
| <div class="flex items-center space-x-4"> | |
| <div class="text-indigo-600 font-bold text-2xl flex items-center"> | |
| <svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 mr-2" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> | |
| <rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect> | |
| <line x1="8" y1="21" x2="16" y2="21"></line> | |
| <line x1="12" y1="17" x2="12" y2="21"></line> | |
| </svg> | |
| <span class="gradient-text">NextGen Builder</span> | |
| </div> | |
| <div class="hidden md:flex space-x-1"> | |
| <button class="px-3 py-1 rounded-md hover:bg-indigo-50 text-indigo-600 flex items-center"> | |
| <i class="fas fa-home mr-1"></i> Home | |
| </button> | |
| <button class="px-3 py-1 rounded-md hover:bg-indigo-50 text-gray-600 flex items-center"> | |
| <i class="fas fa-file-import mr-1"></i> Templates | |
| </button> | |
| <button class="px-3 py-1 rounded-md hover:bg-indigo-50 text-gray-600 flex items-center"> | |
| <i class="fas fa-project-diagram mr-1"></i> Projects | |
| </button> | |
| <button class="px-3 py-1 rounded-md hover:bg-indigo-50 text-gray-600 flex items-center"> | |
| <i class="fas fa-users mr-1"></i> Team | |
| </button> | |
| </div> | |
| </div> | |
| <div class="flex items-center space-x-3"> | |
| <div class="relative group"> | |
| <button class="px-3 py-1 rounded-md hover:bg-gray-100 text-gray-600 flex items-center"> | |
| <i class="fas fa-bell"></i> | |
| <span class="absolute -top-1 -right-1 h-3 w-3 rounded-full bg-red-500"></span> | |
| </button> | |
| <div class="absolute right-0 mt-2 w-72 bg-white rounded-md shadow-lg py-1 z-50 invisible group-hover:visible"> | |
| <div class="px-4 py-2 text-sm border-b border-gray-200">Notifications</div> | |
| <div class="px-4 py-2 text-sm hover:bg-gray-50">New template available</div> | |
| <div class="px-4 py-2 text-sm hover:bg-gray-50">AI suggestions ready</div> | |
| </div> | |
| </div> | |
| <button class="px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 flex items-center"> | |
| <i class="fas fa-rocket mr-2"></i> Deploy | |
| </button> | |
| <div class="w-8 h-8 rounded-full bg-indigo-100 flex items-center justify-center text-indigo-600 cursor-pointer"> | |
| <i class="fas fa-user"></i> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Main Content Area --> | |
| <div class="flex flex-1 overflow-hidden"> | |
| <!-- Left Sidebar - Components --> | |
| <div class="sidebar w-64 bg-white border-r border-gray-200 flex flex-col"> | |
| <div class="p-4 border-b border-gray-200"> | |
| <div class="flex justify-between items-center"> | |
| <h3 class="font-semibold text-gray-700 flex items-center"> | |
| <i class="fas fa-cubes mr-2 text-indigo-500"></i> | |
| Components | |
| </h3> | |
| <div class="relative"> | |
| <select class="appearance-none bg-gray-100 border-0 rounded text-xs py-1 pl-2 pr-6 text-gray-600 focus:ring-0"> | |
| <option>All Categories</option> | |
| <option>Layout</option> | |
| <option>UI Elements</option> | |
| <option>Media</option> | |
| <option>Forms</option> | |
| <option>Special</option> | |
| <option>AI Components</option> | |
| </select> | |
| <i class="fas fa-chevron-down absolute right-1 top-1 text-xs text-gray-500 pointer-events-none"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="p-4 space-y-3 overflow-y-auto flex-1"> | |
| <!-- AI Components --> | |
| <div class="mt-2 mb-1"> | |
| <h4 class="text-xs font-semibold text-gray-500 uppercase tracking-wider">AI Components</h4> | |
| </div> | |
| <div class="component-item bg-white p-3 rounded-md border border-gray-200 cursor-move" draggable="true"> | |
| <div class="flex items-center"> | |
| <div class="w-8 h-8 bg-gradient-to-br from-indigo-100 to-purple-100 rounded-md flex items-center justify-center text-indigo-600 mr-3"> | |
| <i class="fas fa-robot"></i> | |
| </div> | |
| <div> | |
| <h4 class="font-medium text-gray-700">AI Page Generator</h4> | |
| <p class="text-xs text-gray-500">Generate complete pages with AI</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="component-item bg-white p-3 rounded-md border border-gray-200 cursor-move" draggable="true"> | |
| <div class="flex items-center"> | |
| <div class="w-8 h-8 bg-gradient-to-br from-blue-100 to-cyan-100 rounded-md flex items-center justify-center text-blue-600 mr-3"> | |
| <i class="fas fa-font"></i> | |
| </div> | |
| <div> | |
| <h4 class="font-medium text-gray-700">AI Copywriter</h4> | |
| <p class="text-xs text-gray-500">Generate optimized content</p> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Layout Components --> | |
| <div class="mt-4 mb-1"> | |
| <h4 class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Layout</h4> | |
| </div> | |
| <div class="component-item bg-white p-3 rounded-md border border-gray-200 cursor-move" draggable="true"> | |
| <div class="flex items-center"> | |
| <div class="w-8 h-8 bg-indigo-100 rounded-md flex items-center justify-center text-indigo-600 mr-3"> | |
| <i class="fas fa-heading"></i> | |
| </div> | |
| <div> | |
| <h4 class="font-medium text-gray-700">Header</h4> | |
| <p class="text-xs text-gray-500">Navigation bar with logo</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="component-item bg-white p-3 rounded-md border border-gray-200 cursor-move" draggable="true"> | |
| <div class="flex items-center"> | |
| <div class="w-8 h-8 bg-blue-100 rounded-md flex items-center justify-center text-blue-600 mr-3"> | |
| <i class="fas fa-image"></i> | |
| </div> | |
| <div> | |
| <h4 class="font-medium text-gray-700">Hero Section</h4> | |
| <p class="text-xs text-gray-500">Full-width banner</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="component-item bg-white p-3 rounded-md border border-gray-200 cursor-move" draggable="true"> | |
| <div class="flex items-center"> | |
| <div class="w-8 h-8 bg-green-100 rounded-md flex items-center justify-center text-green-600 mr-3"> | |
| <i class="fas fa-columns"></i> | |
| </div> | |
| <div> | |
| <h4 class="font-medium text-gray-700">Grid Layout</h4> | |
| <p class="text-xs text-gray-500">Responsive column system</p> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- UI Elements --> | |
| <div class="mt-4 mb-1"> | |
| <h4 class="text-xs font-semibold text-gray-500 uppercase tracking-wider">UI Elements</h4> | |
| </div> | |
| <div class="component-item bg-white p-3 rounded-md border border-gray-200 cursor-move" draggable="true"> | |
| <div class="flex items-center"> | |
| <div class="w-8 h-8 bg-purple-100 rounded-md flex items-center justify-center text-purple-600 mr-3"> | |
| <i class="fas fa-icons"></i> | |
| </div> | |
| <div> | |
| <h4 class="font-medium text-gray-700">Icon Set</h4> | |
| <p class="text-xs text-gray-500">Font Awesome collection</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="component-item bg-white p-3 rounded-md border border-gray-200 cursor-move" draggable="true"> | |
| <div class="flex items-center"> | |
| <div class="w-8 h-8 bg-yellow-100 rounded-md flex items-center justify-center text-yellow-600 mr-3"> | |
| <i class="fas fa-toggle-on"></i> | |
| </div> | |
| <div> | |
| <h4 class="font-medium text-gray-700">Buttons</h4> | |
| <p class="text-xs text-gray-500">Various button styles</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="component-item bg-white p-3 rounded-md border border-gray-200 cursor-move" draggable="true"> | |
| <div class="flex items-center"> | |
| <div class="w-8 h-8 bg-red-100 rounded-md flex items-center justify-center text-red-600 mr-3"> | |
| <i class="fas fa-bell"></i> | |
| </div> | |
| <div> | |
| <h4 class="font-medium text-gray-700">Alert Box</h4> | |
| <p class="text-xs text-gray-500">Notification messages</p> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Next.js Specific --> | |
| <div class="mt-4 mb-1"> | |
| <h4 class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Next.js</h4> | |
| </div> | |
| <div class="component-item bg-white p-3 rounded-md border border-gray-200 cursor-move" draggable="true"> | |
| <div class="flex items-center"> | |
| <div class="w-8 h-8 bg-gray-100 rounded-md flex items-center justify-center text-gray-600 mr-3"> | |
| <i class="fas fa-code-branch"></i> | |
| </div> | |
| <div> | |
| <h4 class="font-medium text-gray-700">API Route</h4> | |
| <p class="text-xs text-gray-500">Next.js API endpoint</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="component-item bg-white p-3 rounded-md border border-gray-200 cursor-move" draggable="true"> | |
| <div class="flex items-center"> | |
| <div class="w-8 h-8 bg-gray-100 rounded-md flex items-center justify-center text-gray-600 mr-3"> | |
| <i class="fas fa-server"></i> | |
| </div> | |
| <div> | |
| <h4 class="font-medium text-gray-700">Server Component</h4> | |
| <p class="text-xs text-gray-500">Next.js 13+ feature</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="p-4 border-t border-gray-200"> | |
| <button class="w-full py-2 bg-gradient-to-r from-indigo-600 to-purple-600 text-white rounded-md hover:opacity-90 flex items-center justify-center"> | |
| <i class="fas fa-magic mr-2"></i> AI Component | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Main Canvas --> | |
| <div class="flex-1 flex flex-col overflow-hidden"> | |
| <!-- Toolbar --> | |
| <div class="bg-white border-b border-gray-200 p-3 flex items-center justify-between"> | |
| <div class="flex space-x-2"> | |
| <button class="p-2 rounded-md hover:bg-gray-100 text-gray-600"> | |
| <i class="fas fa-undo"></i> | |
| </button> | |
| <button class="p-2 rounded-md hover:bg-gray-100 text-gray-600"> | |
| <i class="fas fa-redo"></i> | |
| </button> | |
| <button class="p-2 rounded-md hover:bg-gray-100 text-gray-600"> | |
| <i class="fas fa-save"></i> | |
| </button> | |
| <button class="p-2 rounded-md hover:bg-gray-100 text-gray-600"> | |
| <i class="fas fa-copy"></i> | |
| </button> | |
| </div> | |
| <div class="flex space-x-2"> | |
| <button class="px-3 py-1 rounded-md bg-gray-100 hover:bg-gray-200 text-gray-700 flex items-center"> | |
| <i class="fas fa-desktop mr-2"></i> Desktop | |
| </button> | |
| <button class="px-3 py-1 rounded-md hover:bg-gray-100 text-gray-600 flex items-center"> | |
| <i class="fas fa-tablet-alt mr-2"></i> Tablet | |
| </button> | |
| <button class="px-3 py-1 rounded-md hover:bg-gray-100 text-gray-600 flex items-center"> | |
| <i class="fas fa-mobile-alt mr-2"></i> Mobile | |
| </button> | |
| </div> | |
| <div class="flex space-x-2"> | |
| <button class="px-3 py-1 rounded-md hover:bg-gray-100 text-gray-600 flex items-center"> | |
| <i class="fas fa-eye mr-2"></i> Preview | |
| </button> | |
| <button class="px-3 py-1 rounded-md bg-indigo-600 text-white hover:bg-indigo-700 flex items-center"> | |
| <i class="fas fa-code mr-2"></i> Code | |
| </button> | |
| <button class="px-3 py-1 rounded-md bg-gray-800 text-white hover:bg-gray-900 flex items-center"> | |
| <i class="fab fa-github mr-2"></i> GitHub | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Canvas Area --> | |
| <div class="flex-1 overflow-auto p-6 bg-gray-100"> | |
| <div class="max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden"> | |
| <!-- Dropzone for components --> | |
| <div id="canvas-dropzone" class="dropzone p-6"> | |
| <div class="text-center py-10"> | |
| <i class="fas fa-arrow-circle-down text-4xl text-gray-300 mb-3"></i> | |
| <p class="text-gray-500">Drag components here or click to browse templates</p> | |
| <button id="import-template-btn" class="mt-4 px-4 py-2 bg-gradient-to-r from-indigo-600 to-purple-600 text-white rounded-md hover:opacity-90"> | |
| <i class="fas fa-file-import mr-2"></i> Import Template | |
| </button> | |
| <button id="ai-generate-btn" class="mt-4 ml-3 px-4 py-2 bg-gradient-to-r from-blue-600 to-cyan-600 text-white rounded-md hover:opacity-90"> | |
| <i class="fas fa-robot mr-2"></i> AI Generate Page | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Right Sidebar - Properties & AI --> | |
| <div class="property-panel w-80 bg-white border-l border-gray-200 flex flex-col"> | |
| <div class="p-4 border-b border-gray-200"> | |
| <div class="flex justify-between items-center"> | |
| <h3 class="font-semibold text-gray-700 flex items-center"> | |
| <i class="fas fa-sliders-h mr-2 text-indigo-500"></i> | |
| Properties | |
| </h3> | |
| <div class="flex space-x-1"> | |
| <button class="p-1 rounded-md hover:bg-gray-100 text-gray-600"> | |
| <i class="fas fa-history"></i> | |
| </button> | |
| <button class="p-1 rounded-md hover:bg-gray-100 text-gray-600"> | |
| <i class="fas fa-cog"></i> | |
| </button> | |
| <button class="p-1 rounded-md hover:bg-gray-100 text-gray-600"> | |
| <i class="fas fa-expand"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="flex-1 overflow-y-auto p-4 space-y-6"> | |
| <!-- Selected Component Properties --> | |
| <div> | |
| <h4 class="text-sm font-medium text-gray-500 mb-2">SELECTED COMPONENT</h4> | |
| <div class="bg-gray-50 p-3 rounded-md"> | |
| <p class="text-gray-400 italic">No component selected</p> | |
| </div> | |
| </div> | |
| <!-- Brand Kit --> | |
| <div> | |
| <h4 class="text-sm font-medium text-gray-500 mb-2">BRAND KIT</h4> | |
| <div class="bg-gray-50 p-3 rounded-md"> | |
| <div class="flex items-center mb-3"> | |
| <div class="w-10 h-10 rounded-full bg-indigo-100 flex items-center justify-center text-indigo-600 mr-3"> | |
| <i class="fas fa-palette"></i> | |
| </div> | |
| <div> | |
| <h4 class="font-medium text-gray-700">Brand Colors</h4> | |
| <div class="flex mt-1 space-x-1"> | |
| <div class="w-4 h-4 rounded-full bg-indigo-600"></div> | |
| <div class="w-4 h-4 rounded-full bg-purple-600"></div> | |
| <div class="w-4 h-4 rounded-full bg-gray-800"></div> | |
| </div> | |
| </div> | |
| </div> | |
| <button class="w-full py-1 text-xs bg-white border border-gray-200 rounded-md hover:bg-gray-50"> | |
| Edit Brand Kit | |
| </button> | |
| </div> | |
| </div> | |
| <!-- AI Suggestions --> | |
| <div class="ai-suggestion p-4 rounded-md border border-indigo-100"> | |
| <div class="flex items-start mb-3"> | |
| <div class="w-8 h-8 rounded-full bg-gradient-to-br from-indigo-100 to-purple-100 flex items-center justify-center text-indigo-600 mr-3"> | |
| <i class="fas fa-robot"></i> | |
| </div> | |
| <div> | |
| <h4 class="font-medium text-indigo-700">AI Design Assistant</h4> | |
| <p class="text-xs text-indigo-600">Try these suggestions</p> | |
| </div> | |
| </div> | |
| <div class="space-y-2"> | |
| <button class="w-full text-left px-3 py-2 bg-white rounded-md text-sm text-gray-700 hover:bg-indigo-50 border border-indigo-100"> | |
| "Make this section more modern" | |
| </button> | |
| <button class="w-full text-left px-3 py-2 bg-white rounded-md text-sm text-gray-700 hover:bg-indigo-50 border border-indigo-100"> | |
| "Suggest color palette" | |
| </button> | |
| <button class="w-full text-left px-3 py-2 bg-white rounded-md text-sm text-gray-700 hover:bg-indigo-50 border border-indigo-100"> | |
| "Generate content for this component" | |
| </button> | |
| </div> | |
| <div class="mt-3"> | |
| <div class="relative"> | |
| <input type="text" class="w-full p-2 pr-10 text-sm border border-indigo-200 rounded-md" placeholder="Ask AI for help..."> | |
| <button class="absolute right-2 top-2 text-indigo-600"> | |
| <i class="fas fa-paper-plane"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Export Options --> | |
| <div> | |
| <h4 class="text-sm font-medium text-gray-500 mb-2">EXPORT OPTIONS</h4> | |
| <div class="space-y-2"> | |
| <button class="w-full text-left px-3 py-2 bg-white rounded-md text-sm text-gray-700 hover:bg-gray-50 border border-gray-200 flex items-center"> | |
| <i class="fab fa-react text-blue-500 mr-2"></i> | |
| Next.js Project | |
| </button> | |
| <button class="w-full text-left px-3 py-2 bg-white rounded-md text-sm text-gray-700 hover:bg-gray-50 border border-gray-200 flex items-center"> | |
| <i class="fab fa-html5 text-orange-500 mr-2"></i> | |
| Static HTML/CSS | |
| </button> | |
| <button class="w-full text-left px-3 py-2 bg-white rounded-md text-sm text-gray-700 hover:bg-gray-50 border border-gray-200 flex items-center"> | |
| <i class="fas fa-file-code text-blue-400 mr-2"></i> | |
| JSON Schema | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="p-4 border-t border-gray-200"> | |
| <button class="w-full py-2 bg-gradient-to-r from-indigo-600 to-purple-600 text-white rounded-md hover:opacity-90 flex items-center justify-center"> | |
| <i class="fas fa-download mr-2"></i> Export Project | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- AI Generation Modal --> | |
| <div id="ai-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> | |
| <div class="bg-white rounded-lg shadow-xl w-full max-w-2xl max-h-[80vh] overflow-hidden"> | |
| <div class="p-4 border-b border-gray-200 flex justify-between items-center"> | |
| <h3 class="font-semibold text-lg">AI Page Generator</h3> | |
| <button class="text-gray-500 hover:text-gray-700" id="close-ai-modal"> | |
| <i class="fas fa-times"></i> | |
| </button> | |
| </div> | |
| <div class="p-4"> | |
| <div class="mb-4"> | |
| <label class="block text-sm font-medium text-gray-700 mb-2">Describe the page you want to create</label> | |
| <textarea class="w-full p-3 border border-gray-300 rounded-md h-32" placeholder="e.g. 'A modern landing page for a SaaS product with a hero section, features grid, testimonials, and pricing table'"></textarea> | |
| </div> | |
| <div class="grid grid-cols-2 gap-4 mb-4"> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-2">Page Type</label> | |
| <select class="w-full p-2 border border-gray-300 rounded-md"> | |
| <option>Landing Page</option> | |
| <option>Blog Post</option> | |
| <option>Product Page</option> | |
| <option>Portfolio</option> | |
| <option>Dashboard</option> | |
| </select> | |
| </div> | |
| <div> | |
| <label class="block text-sm font-medium text-gray-700 mb-2">Style</label> | |
| <select class="w-full p-2 border border-gray-300 rounded-md"> | |
| <option>Modern</option> | |
| <option>Minimal</option> | |
| <option>Corporate</option> | |
| <option>Creative</option> | |
| <option>Elegant</option> | |
| </select> | |
| </div> | |
| </div> | |
| <div class="flex justify-end"> | |
| <button class="px-4 py-2 bg-gradient-to-r from-blue-600 to-cyan-600 text-white rounded-md hover:opacity-90"> | |
| <i class="fas fa-robot mr-2"></i> Generate Page | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Template Import Modal --> | |
| <div id="template-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden"> | |
| <div class="bg-white rounded-lg shadow-xl w-full max-w-4xl max-h-[80vh] overflow-hidden"> | |
| <div class="p-4 border-b border-gray-200 flex justify-between items-center"> | |
| <h3 class="font-semibold text-lg">Import Next.js Template</h3> | |
| <button class="text-gray-500 hover:text-gray-700" id="close-template-modal"> | |
| <i class="fas fa-times"></i> | |
| </button> | |
| </div> | |
| <div class="p-4 border-b border-gray-200"> | |
| <div class="relative"> | |
| <input type="text" class="w-full p-2 pl-10 border border-gray-300 rounded-md" placeholder="Search templates..."> | |
| <i class="fas fa-search absolute left-3 top-3 text-gray-400"></i> | |
| </div> | |
| </div> | |
| <div class="p-4"> | |
| <div class="mb-4"> | |
| <h4 class="font-medium text-gray-700 mb-2">Import Source</h4> | |
| <div class="grid grid-cols-3 gap-4"> | |
| <div class="border border-gray-200 rounded-md p-4 text-center cursor-pointer hover:bg-gray-50"> | |
| <i class="fas fa-file-import text-3xl text-indigo-500 mb-2"></i> | |
| <p class="text-sm">Local File</p> | |
| </div> | |
| <div class="border border-gray-200 rounded-md p-4 text-center cursor-pointer hover:bg-gray-50"> | |
| <i class="fab fa-github text-3xl text-gray-800 mb-2"></i> | |
| <p class="text-sm">GitHub Repo</p> | |
| </div> | |
| <div class="border border-gray-200 rounded-md p-4 text-center cursor-pointer hover:bg-gray-50"> | |
| <i class="fas fa-cloud text-3xl text-blue-500 mb-2"></i> | |
| <p class="text-sm">Template Library</p> | |
| </div> | |
| </div> | |
| </div> | |
| <h4 class="font-medium text-gray-700 mb-2">Popular Templates</h4> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-4" id="template-list"> | |
| <div class="template-card border border-gray-200 rounded-md overflow-hidden hover:shadow-md transition-shadow cursor-pointer relative h-48"> | |
| <div class="template-overlay absolute inset-0 flex items-end p-4"> | |
| <div> | |
| <h4 class="font-medium text-white">SaaS Landing</h4> | |
| <p class="text-xs text-gray-200">Modern Next.js template</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="template-card border border-gray-200 rounded-md overflow-hidden hover:shadow-md transition-shadow cursor-pointer relative h-48"> | |
| <div class="template-overlay absolute inset-0 flex items-end p-4"> | |
| <div> | |
| <h4 class="font-medium text-white">E-commerce</h4> | |
| <p class="text-xs text-gray-200">Shopify integration</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="template-card border border-gray-200 rounded-md overflow-hidden hover:shadow-md transition-shadow cursor-pointer relative h-48"> | |
| <div class="template-overlay absolute inset-0 flex items-end p-4"> | |
| <div> | |
| <h4 class="font-medium text-white">Portfolio</h4> | |
| <p class="text-xs text-gray-200">Creative showcase</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="template-card border border-gray-200 rounded-md overflow-hidden hover:shadow-md transition-shadow cursor-pointer relative h-48"> | |
| <div class="template-overlay absolute inset-0 flex items-end p-4"> | |
| <div> | |
| <h4 class="font-medium text-white">Blog</h4> | |
| <p class="text-xs text-gray-200">MDX supported</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Initialize Konva stage for the canvas | |
| const stage = new Konva.Stage({ | |
| container: 'canvas-dropzone', | |
| width: document.querySelector('#canvas-dropzone').offsetWidth, | |
| height: document.querySelector('#canvas-dropzone').offsetHeight, | |
| }); | |
| const layer = new Konva.Layer(); | |
| stage.add(layer); | |
| // Modal controls | |
| const aiModal = document.getElementById('ai-modal'); | |
| const templateModal = document.getElementById('template-modal'); | |
| const aiGenerateBtn = document.getElementById('ai-generate-btn'); | |
| const importTemplateBtn = document.getElementById('import-template-btn'); | |
| const closeAiModal = document.getElementById('close-ai-modal'); | |
| const closeTemplateModal = document.getElementById('close-template-modal'); | |
| aiGenerateBtn.addEventListener('click', function() { | |
| aiModal.classList.remove('hidden'); | |
| }); | |
| importTemplateBtn.addEventListener('click', function() { | |
| templateModal.classList.remove('hidden'); | |
| }); | |
| closeAiModal.addEventListener('click', function() { | |
| aiModal.classList.add('hidden'); | |
| }); | |
| closeTemplateModal.addEventListener('click', function() { | |
| templateModal.classList.add('hidden'); | |
| }); | |
| // Template selection | |
| const templateCards = document.querySelectorAll('.template-card'); | |
| templateCards.forEach(card => { | |
| card.addEventListener('click', function() { | |
| const templateName = this.querySelector('h4').innerText; | |
| const dropzone = document.getElementById('canvas-dropzone'); | |
| dropzone.innerHTML = ` | |
| <div class="p-6"> | |
| <div class="bg-white p-4 rounded-md border border-gray-200 shadow-sm mb-3"> | |
| <div class="flex justify-between items-center mb-2"> | |
| <h4 class="font-medium text-gray-700">${templateName} Template</h4> | |
| <div class="flex space-x-2"> | |
| <button class="text-gray-400 hover:text-gray-600"> | |
| <i class="fas fa-cog"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <div class="text-xs text-gray-500">Imported template with multiple components</div> | |
| </div> | |
| <div class="text-center text-sm text-gray-500 mt-4"> | |
| <p>Template successfully imported. Start customizing!</p> | |
| </div> | |
| </div> | |
| `; | |
| templateModal.classList.add('hidden'); | |
| }); | |
| }); | |
| // Drag and Drop functionality | |
| const components = document.querySelectorAll('.component-item'); | |
| const dropzone = document.getElementById('canvas-dropzone'); | |
| components.forEach(component => { | |
| component.addEventListener('dragstart', function(e) { | |
| const componentName = this.querySelector('h4').innerText; | |
| e.dataTransfer.setData('text/plain', componentName); | |
| component.classList.add('opacity-50'); | |
| }); | |
| component.addEventListener('dragend', function() { | |
| component.classList.remove('opacity-50'); | |
| }); | |
| }); | |
| dropzone.addEventListener('dragover', function(e) { | |
| e.preventDefault(); | |
| dropzone.classList.add('active'); | |
| }); | |
| dropzone.addEventListener('dragleave', function() { | |
| dropzone.classList.remove('active'); | |
| }); | |
| dropzone.addEventListener('drop', function(e) { | |
| e.preventDefault(); | |
| dropzone.classList.remove('active'); | |
| const componentName = e.dataTransfer.getData('text/plain'); | |
| // Create a new component in the dropzone | |
| const newComponent = document.createElement('div'); | |
| newComponent.className = 'bg-white p-4 rounded-md border border-gray-200 shadow-sm mb-3'; | |
| newComponent.innerHTML = ` | |
| <div class="flex justify-between items-center mb-2"> | |
| <h4 class="font-medium text-gray-700">${componentName}</h4> | |
| <div class="flex space-x-2"> | |
| <button class="text-gray-400 hover:text-gray-600"> | |
| <i class="fas fa-cog"></i> | |
| </button> | |
| <button class="text-gray-400 hover:text-gray-600"> | |
| <i class="fas fa-trash"></i> | |
| </button> | |
| </div> | |
| </div> | |
| ${getComponentPreview(componentName)} | |
| `; | |
| // Replace the placeholder if it exists | |
| if (dropzone.querySelector('.text-center')) { | |
| dropzone.innerHTML = ''; | |
| } | |
| dropzone.appendChild(newComponent); | |
| // Initialize component-specific functionality | |
| initComponent(componentName, newComponent); | |
| }); | |
| // Helper functions | |
| function getComponentPreview(name) { | |
| const previews = { | |
| 'AI Page Generator': ` | |
| <div class="p-4 bg-blue-50 rounded-md text-center"> | |
| <i class="fas fa-robot text-3xl text-blue-500 mb-2"></i> | |
| <p class="text-sm text-blue-700">AI-generated page content</p> | |
| </div> | |
| `, | |
| 'AI Copywriter': ` | |
| <div class="p-4 bg-indigo-50 rounded-md"> | |
| <p class="text-sm text-indigo-700">AI-generated content will appear here</p> | |
| </div> | |
| `, | |
| 'API Route': ` | |
| <div class="p-3 bg-gray-100 rounded text-xs font-mono"> | |
| // pages/api/example.js<br> | |
| export default function handler(req, res) {<br> | |
| res.status(200).json({ name: 'John Doe' })<br> | |
| } | |
| </div> | |
| `, | |
| 'Server Component': ` | |
| <div class="p-3 bg-gray-100 rounded text-xs font-mono"> | |
| // app/page.js<br> | |
| export default function Page() {<br> | |
| const data = await fetchData();<br> | |
| return <div>{data}</div><br> | |
| } | |
| </div> | |
| `, | |
| 'Default': ` | |
| <div class="text-xs text-gray-500 italic">Component preview</div> | |
| ` | |
| }; | |
| return previews[name] || previews['Default']; | |
| } | |
| function initComponent(name, element) { | |
| // Initialize component-specific functionality | |
| console.log(`Initializing ${name} component`); | |
| } | |
| }); | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Yashomx/test-website" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |