Spaces:
Running
Running
Onde esta tudo o que eu pedi? So apareceu um botao enviar dados e alguns textos. O sistemas que quero é um gerador de formularios e nao um formulario apenas
b2363b3 verified Download index.html from mapolanski/formforge-geostudio: direct link, hf CLI and curl.
- Browser
- Download file 11.4 kB
-
https://huggingface.co/spaces/mapolanski/formforge-geostudio/resolve/main/index.html
- Command line
-
hf download hf://spaces/mapolanski/formforge-geostudio/index.html
-
curl -L -o index.html https://huggingface.co/spaces/mapolanski/formforge-geostudio/resolve/main/index.html
11.4 kB
| <html lang="pt-BR" class="dark"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>geoForms Studio - Dashboard</title> | |
| <link rel="icon" type="image/x-icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2'><path d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/><circle cx='12' cy='10' r='3'/></svg>"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" /> | |
| <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script> | |
| <script> | |
| tailwind.config = { | |
| darkMode: 'class', | |
| theme: { | |
| extend: { | |
| colors: { | |
| primary: { | |
| 50: '#eef2ff', | |
| 100: '#e0e7ff', | |
| 500: '#6366f1', | |
| 600: '#4f46e5', | |
| 700: '#4338ca', | |
| 900: '#312e81' | |
| }, | |
| secondary: { | |
| 50: '#ecfdf5', | |
| 100: '#d1fae5', | |
| 500: '#10b981', | |
| 600: '#059669', | |
| 700: '#047857' | |
| } | |
| } | |
| } | |
| } | |
| } | |
| </script> | |
| <link rel="stylesheet" href="style.css"> | |
| </head> | |
| <body class="bg-gray-50 dark:bg-gray-900 transition-colors duration-300"> | |
| <script src="components/navbar.js"></script> | |
| <script src="components/sidebar.js"></script> | |
| <geo-navbar></geo-navbar> | |
| <div class="flex h-screen pt-16"> | |
| <geo-sidebar></geo-sidebar> | |
| <main class="flex-1 overflow-y-auto p-6"> | |
| <div class="max-w-7xl mx-auto"> | |
| <div class="flex justify-between items-center mb-8"> | |
| <div> | |
| <h1 class="text-3xl font-bold text-gray-900 dark:text-white mb-2">Meus Formulários</h1> | |
| <p class="text-gray-600 dark:text-gray-400">Gerencie seus formulários geo-espaciais</p> | |
| </div> | |
| <button onclick="createNewForm()" class="bg-primary-600 hover:bg-primary-700 text-white px-6 py-3 rounded-lg flex items-center gap-2 shadow-lg transition-all transform hover:scale-105"> | |
| <i data-feather="plus-circle"></i> | |
| <span>Novo Formulário</span> | |
| </button> | |
| </div> | |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6" id="formsGrid"> | |
| <!-- Cards serão inseridos via JavaScript --> | |
| </div> | |
| <div id="emptyState" class="hidden text-center py-20"> | |
| <div class="bg-gray-100 dark:bg-gray-800 rounded-full w-24 h-24 flex items-center justify-center mx-auto mb-4"> | |
| <i data-feather="map" class="w-12 h-12 text-gray-400"></i> | |
| </div> | |
| <h3 class="text-xl font-semibold text-gray-900 dark:text-white mb-2">Nenhum formulário ainda</h3> | |
| <p class="text-gray-600 dark:text-gray-400 mb-6">Crie seu primeiro formulário geo-espacial</p> | |
| <button onclick="createNewForm()" class="text-primary-600 hover:text-primary-700 font-medium"> | |
| Começar agora → | |
| </button> | |
| </div> | |
| </div> | |
| </main> | |
| </div> | |
| <div id="newFormModal" class="hidden fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center"> | |
| <div class="bg-white dark:bg-gray-800 rounded-2xl p-8 max-w-md w-full mx-4 shadow-2xl transform transition-all"> | |
| <h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-4">Novo Formulário</h2> | |
| <input type="text" id="formName" placeholder="Nome do formulário" class="w-full px-4 py-3 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white mb-4 focus:ring-2 focus:ring-primary-500 outline-none"> | |
| <textarea id="formDescription" placeholder="Descrição (opcional)" rows="3" class="w-full px-4 py-3 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white mb-6 focus:ring-2 focus:ring-primary-500 outline-none resize-none"></textarea> | |
| <div class="flex gap-3 justify-end"> | |
| <button onclick="closeModal()" class="px-4 py-2 text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200">Cancelar</button> | |
| <button onclick="confirmNewForm()" class="px-6 py-2 bg-primary-600 hover:bg-primary-700 text-white rounded-lg">Criar</button> | |
| </div> | |
| </div> | |
| </div> | |
| <script src="script.js"></script> | |
| <script> | |
| feather.replace(); | |
| // Enhanced dashboard functionality | |
| document.addEventListener('DOMContentLoaded', () => { | |
| loadForms(); | |
| animateCounters(); | |
| }); | |
| function animateCounters() { | |
| // Animate any counter elements | |
| const counters = document.querySelectorAll('[data-count]'); | |
| counters.forEach(counter => { | |
| const target = parseInt(counter.dataset.count); | |
| const duration = 1000; | |
| const start = performance.now(); | |
| function update(currentTime) { | |
| const elapsed = currentTime - start; | |
| const progress = Math.min(elapsed / duration, 1); | |
| const easeOut = 1 - Math.pow(1 - progress, 3); | |
| const current = Math.floor(easeOut * target); | |
| counter.textContent = current.toLocaleString(); | |
| if (progress < 1) { | |
| requestAnimationFrame(update); | |
| } | |
| } | |
| requestAnimationFrame(update); | |
| }); | |
| } | |
| // Enhanced form creation with validation | |
| function confirmNewForm() { | |
| const nameInput = document.getElementById('formName'); | |
| const descInput = document.getElementById('formDescription'); | |
| const name = nameInput.value.trim(); | |
| const description = descInput.value.trim(); | |
| if (!name) { | |
| nameInput.classList.add('border-red-500'); | |
| nameInput.focus(); | |
| // Shake animation | |
| nameInput.animate([ | |
| { transform: 'translateX(0)' }, | |
| { transform: 'translateX(-5px)' }, | |
| { transform: 'translateX(5px)' }, | |
| { transform: 'translateX(0)' } | |
| ], { duration: 300 }); | |
| return; | |
| } | |
| // Create form with loading state | |
| const btn = document.querySelector('#newFormModal button[onclick="confirmNewForm()"]'); | |
| const originalText = btn.innerHTML; | |
| btn.innerHTML = '<span class="animate-spin">⏳</span> Criando...'; | |
| btn.disabled = true; | |
| setTimeout(() => { | |
| const form = { | |
| id: 'form_' + Date.now(), | |
| name, | |
| description, | |
| fields: [], | |
| createdAt: new Date().toISOString(), | |
| updatedAt: new Date().toISOString(), | |
| theme: 'dark', | |
| version: '2.0.0' | |
| }; | |
| const forms = JSON.parse(localStorage.getItem('geoforms_list') || '[]'); | |
| forms.push(form); | |
| localStorage.setItem('geoforms_list', JSON.stringify(forms)); | |
| localStorage.setItem(\`geoform_\${form.id}\`, JSON.stringify([])); | |
| window.location.href = \`builder.html?form=\${form.id}\`; | |
| }, 500); | |
| } | |
| // Quick actions | |
| function duplicateForm(formId) { | |
| const forms = JSON.parse(localStorage.getItem('geoforms_list') || '[]'); | |
| const form = forms.find(f => f.id === formId); | |
| if (form) { | |
| const newForm = { | |
| ...form, | |
| id: 'form_' + Date.now(), | |
| name: form.name + ' (Cópia)', | |
| createdAt: new Date().toISOString(), | |
| updatedAt: new Date().toISOString() | |
| }; | |
| forms.push(newForm); | |
| localStorage.setItem('geoforms_list', JSON.stringify(forms)); | |
| localStorage.setItem(\`geoform_\${newForm.id}\`, localStorage.getItem(\`geoform_\${formId}\`) || '[]'); | |
| loadForms(); | |
| // Show toast | |
| showToast('Formulário duplicado com sucesso!'); | |
| } | |
| } | |
| function showToast(message) { | |
| const toast = document.createElement('div'); | |
| toast.className = 'fixed bottom-4 right-4 bg-green-500 text-white px-6 py-3 rounded-lg shadow-lg z-50 animate-slide-in'; | |
| toast.textContent = message; | |
| document.body.appendChild(toast); | |
| setTimeout(() => toast.remove(), 3000); | |
| } | |
| // Enhanced export | |
| function exportForm(formId) { | |
| const form = JSON.parse(localStorage.getItem(\`geoform_\${formId}\`) || '[]'); | |
| const metadata = JSON.parse(localStorage.getItem('geoforms_list') || '[]').find(f => f.id === formId); | |
| if (!metadata) return; | |
| const exportData = { | |
| metadata: { | |
| ...metadata, | |
| exportedAt: new Date().toISOString(), | |
| exportVersion: '2.0.0' | |
| }, | |
| schema: form, | |
| stats: { | |
| totalFields: form.length, | |
| requiredFields: form.filter(f => f.required).length, | |
| geoFields: form.filter(f => ['map', 'photo', 'signature'].includes(f.type)).length | |
| } | |
| }; | |
| // Create formatted JSON | |
| const blob = new Blob([JSON.stringify(exportData, null, 2)], { type: 'application/json' }); | |
| const url = URL.createObjectURL(blob); | |
| const a = document.createElement('a'); | |
| a.href = url; | |
| a.download = \`\${metadata.name.replace(/\\s+/g, '_')}_v2.0.json\`; | |
| document.body.appendChild(a); | |
| a.click(); | |
| document.body.removeChild(a); | |
| URL.revokeObjectURL(url); | |
| showToast('📤 Exportação concluída!'); | |
| } | |
| // Initialize | |
| loadForms(); | |
| </script> | |
| <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script> | |
| </body> | |
| </html> |