Model-config web apps: describe the app in configuration instead of writing code. Built on Polars and DuckDB.
demo_tailwind.html · 3.7 KB · 53 lines
| 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | <title>DBBasic Demo - Same Data, Different Frameworks</title> |
| 7 | <script src="https://cdn.tailwindcss.com"></script> |
| 8 | </head> |
| 9 | <body class="bg-gray-50"> |
| 10 | |
| 11 | <nav class="bg-white shadow-lg"> |
| 12 | <div class="container mx-auto px-4"> |
| 13 | <div class="flex justify-between items-center py-4"> |
| 14 | <span class="text-xl font-bold">DBBasic Demo</span> |
| 15 | <div class="flex space-x-4"> |
| 16 | <a class="px-3 py-2 text-gray-700 hover:text-gray-900" href="/dashboard">Dashboard</a> <a class="px-3 py-2 text-gray-700 hover:text-gray-900" href="/data">Data</a> <a class="px-3 py-2 text-gray-700 hover:text-gray-900" href="/settings">Settings</a> |
| 17 | </div> |
| 18 | </div> |
| 19 | </div> |
| 20 | </nav><div class="bg-blue-100 border border-blue-400 text-blue-700 px-4 py-3 rounded">This page demonstrates how the same data structure renders in different UI frameworks</div> |
| 21 | <div class="bg-gradient-to-r from-blue-500 to-purple-600 text-white text-center py-16"> |
| 22 | <div class="container mx-auto px-4"> |
| 23 | <h1 class="text-5xl font-bold mb-4">🎨 Framework Flexibility</h1> |
| 24 | <p class="text-xl">One data structure, infinite possibilities</p> |
| 25 | </div> |
| 26 | </div> |
| 27 | <div class="container mx-auto px-4 my-8"> |
| 28 | <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> |
| 29 | |
| 30 | <div class="bg-white rounded-lg shadow-md hover:shadow-lg transition-shadow p-6"> |
| 31 | <div class="flex justify-between items-start mb-2"> |
| 32 | <h3 class="text-xl font-semibold">Bootstrap Version</h3> |
| 33 | <span class="bg-blue-500 text-white px-2 py-1 rounded text-sm">Framework</span> |
| 34 | </div> |
| 35 | <p class="text-gray-600 mb-4">Uses Bootstrap 5.3 classes and components</p> |
| 36 | <div class="flex justify-end space-x-2"><button class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded" onclick="deployTemplate('Bootstrap Version')">Deploy</button> <button class="bg-gray-500 hover:bg-gray-600 text-white px-4 py-2 rounded" onclick="previewTemplate('Bootstrap Version')">Preview</button></div> |
| 37 | </div> |
| 38 | <div class="bg-white rounded-lg shadow-md hover:shadow-lg transition-shadow p-6"> |
| 39 | <div class="flex justify-between items-start mb-2"> |
| 40 | <h3 class="text-xl font-semibold">Tailwind Version</h3> |
| 41 | <span class="bg-blue-500 text-white px-2 py-1 rounded text-sm">Framework</span> |
| 42 | </div> |
| 43 | <p class="text-gray-600 mb-4">Uses Tailwind utility classes</p> |
| 44 | <div class="flex justify-end space-x-2"><button class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded" onclick="deployTemplate('Tailwind Version')">Deploy</button> <button class="bg-gray-500 hover:bg-gray-600 text-white px-4 py-2 rounded" onclick="previewTemplate('Tailwind Version')">Preview</button></div> |
| 45 | </div> |
| 46 | </div> |
| 47 | </div>{'type': 'container', 'children': ['<hr class="my-5">', '<h2 class="text-center">Benefits of This Approach</h2>', {'type': 'grid', 'columns': 3, 'items': [{'type': 'card', 'title': '🤖 AI-Friendly', 'description': 'AI can generate UI by creating data structures'}, {'type': 'card', 'title': '🎨 Customizable', 'description': 'Users can add their own UI framework renderers'}, {'type': 'card', 'title': '🧹 Clean Code', 'description': 'No HTML mixed with Python business logic'}]}]} |
| 48 | <script> |
| 49 | function deployTemplate(id) { alert('Deploying: ' + id); } |
| 50 | function previewTemplate(id) { alert('Preview: ' + id); } |
| 51 | </script> |
| 52 | </body> |
| 53 | </html> |