askrobots / dbbasic Public

Model-config web apps: describe the app in configuration instead of writing code. Built on Polars and DuckDB.

0 downloads

dbbasic/static/framework_comparison.html
Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 Add DBBasic crate engine logo and update README 0d628db 1 year, 2 months ago History
framework_comparison.html · 7.5 KB · 142 lines
1<!DOCTYPE html>
2<html>
3<head>
4 <title>Framework Comparison - DBBasic</title>
5 <style>
6 body { margin: 0; padding: 0; font-family: sans-serif; }
7 .header {
8 background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
9 color: white;
10 padding: 20px;
11 text-align: center;
12 }
13 .controls {
14 background: #f5f5f5;
15 padding: 15px;
16 text-align: center;
17 border-bottom: 1px solid #ddd;
18 }
19 .controls button {
20 padding: 10px 20px;
21 margin: 0 10px;
22 border: none;
23 background: #4CAF50;
24 color: white;
25 border-radius: 5px;
26 cursor: pointer;
27 font-size: 16px;
28 }
29 .controls button:hover {
30 background: #45a049;
31 }
32 .controls button.active {
33 background: #2196F3;
34 }
35 .comparison {
36 display: flex;
37 height: calc(100vh - 150px);
38 }
39 .frame-container {
40 flex: 1;
41 position: relative;
42 border-right: 1px solid #ddd;
43 }
44 .frame-container:last-child {
45 border-right: none;
46 }
47 .frame-label {
48 position: absolute;
49 top: 10px;
50 left: 10px;
51 background: rgba(0,0,0,0.7);
52 color: white;
53 padding: 5px 10px;
54 border-radius: 5px;
55 z-index: 10;
56 font-weight: bold;
57 }
58 iframe {
59 width: 100%;
60 height: 100%;
61 border: none;
62 }
63 .single-view { display: none; }
64 .code-view {
65 background: #1e1e1e;
66 color: #d4d4d4;
67 padding: 20px;
68 height: 100%;
69 overflow: auto;
70 display: none;
71 }
72 pre { margin: 0; white-space: pre-wrap; word-wrap: break-word; }
73 </style>
74</head>
75<body>
76 <div class="header">
77 <h1>🎨 Framework Comparison</h1>
78 <p>Same data structure, different frameworks - powered by DBBasic Presentation Layer</p>
79 </div>
80
81 <div class="controls">
82 <button onclick="showView('split')" id="btn-split" class="active">Split View</button>
83 <button onclick="showView('bootstrap')" id="btn-bootstrap">Bootstrap Only</button>
84 <button onclick="showView('tailwind')" id="btn-tailwind">Tailwind Only</button>
85 <button onclick="showView('code')" id="btn-code">View Data Structure</button>
86 </div>
87
88 <div class="comparison" id="split-view">
89 <div class="frame-container">
90 <div class="frame-label">Bootstrap 5.3</div>
91 <iframe src="demo_bootstrap.html"></iframe>
92 </div>
93 <div class="frame-container">
94 <div class="frame-label">Tailwind CSS 3.x</div>
95 <iframe src="demo_tailwind.html"></iframe>
96 </div>
97 </div>
98
99 <div class="single-view" id="bootstrap-view">
100 <iframe src="demo_bootstrap.html" style="width: 100%; height: calc(100vh - 150px); border: none;"></iframe>
101 </div>
102
103 <div class="single-view" id="tailwind-view">
104 <iframe src="demo_tailwind.html" style="width: 100%; height: calc(100vh - 150px); border: none;"></iframe>
105 </div>
106
107 <div class="code-view" id="code-view">
108 <h2>Data Structure (Same for both frameworks)</h2>
109 <pre>{'type': 'page', 'title': 'DBBasic Framework Comparison', 'components': [{'type': 'navbar', 'brand': 'DBBasic', 'variant': 'dark', 'links': [{'text': 'Dashboard', 'url': '#'}, {'text': 'Services', 'url': '#'}, {'text': 'Templates', 'url': '#'}]}, {'type': 'hero', 'title': 'One Data Structure, Multiple Frameworks', 'subtitle': 'Write once, render anywhere', 'variant': 'gradient-blue'}, {'type': 'container', 'children': [{'type': 'grid', 'columns': 4, 'items': [{'type': 'card', 'body': {'type': 'metric', 'label': 'Performance', 'value': '402M/sec', 'icon': 'bi-speedometer2', 'trend': 'up'}}, {'type': 'card', 'body': {'type': 'metric', 'label': 'Services', 'value': '4', 'icon': 'bi-layers'}}, {'type': 'card', 'body': {'type': 'metric', 'label': 'Templates', 'value': '25+', 'icon': 'bi-collection'}}, {'type': 'card', 'body': {'type': 'metric', 'label': 'Uptime', 'value': '99.9%', 'icon': 'bi-check-circle', 'trend': 'up'}}]}, {'type': 'div', 'class': 'mt-5', 'children': [{'type': 'h2', 'text': 'Features', 'class': 'mb-4'}, {'type': 'grid', 'columns': 3, 'items': [{'type': 'card', 'title': 'Config-Driven', 'description': 'Define entire applications with YAML configuration', 'footer': {'type': 'button', 'text': 'Learn More', 'variant': 'primary'}}, {'type': 'card', 'title': 'AI-Powered', 'description': 'Generate business logic from natural language', 'footer': {'type': 'button', 'text': 'Try It', 'variant': 'success'}}, {'type': 'card', 'title': 'Lightning Fast', 'description': '402M rows/sec with DuckDB backend', 'footer': {'type': 'button', 'text': 'Benchmark', 'variant': 'info'}}]}]}, {'type': 'div', 'class': 'mt-5', 'children': [{'type': 'h2', 'text': 'Contact Form', 'class': 'mb-4'}, {'type': 'card', 'body': {'type': 'form', 'fields': [{'type': 'input', 'name': 'name', 'label': 'Your Name', 'placeholder': 'John Doe', 'required': True}, {'type': 'input', 'input_type': 'email', 'name': 'email', 'label': 'Email', 'placeholder': 'john@example.com', 'required': True}, {'type': 'textarea', 'name': 'message', 'label': 'Message', 'rows': 4, 'placeholder': 'Your message here...'}], 'submit': {'text': 'Send Message', 'variant': 'primary'}}}]}, {'type': 'div', 'class': 'mt-5 mb-5', 'children': [{'type': 'h2', 'text': 'Service Status', 'class': 'mb-4'}, {'type': 'table', 'headers': ['Service', 'Status', 'Port', 'Uptime'], 'rows': [['Real-time Monitor', {'type': 'badge', 'text': 'Running', 'variant': 'success'}, '8004', '12h 34m'], ['Data Service', {'type': 'badge', 'text': 'Running', 'variant': 'success'}, '8005', '12h 34m'], ['AI Services', {'type': 'badge', 'text': 'Running', 'variant': 'success'}, '8003', '12h 34m'], ['Event Store', {'type': 'badge', 'text': 'Stopped', 'variant': 'danger'}, '8006', '-']]}]}]}]}</pre>
110 </div>
111
112 <script>
113 function showView(view) {
114 // Hide all views
115 document.getElementById('split-view').style.display = 'none';
116 document.getElementById('bootstrap-view').style.display = 'none';
117 document.getElementById('tailwind-view').style.display = 'none';
118 document.getElementById('code-view').style.display = 'none';
119
120 // Remove active class from all buttons
121 document.querySelectorAll('.controls button').forEach(btn => {
122 btn.classList.remove('active');
123 });
124
125 // Show selected view
126 if (view === 'split') {
127 document.getElementById('split-view').style.display = 'flex';
128 document.getElementById('btn-split').classList.add('active');
129 } else if (view === 'bootstrap') {
130 document.getElementById('bootstrap-view').style.display = 'block';
131 document.getElementById('btn-bootstrap').classList.add('active');
132 } else if (view === 'tailwind') {
133 document.getElementById('tailwind-view').style.display = 'block';
134 document.getElementById('btn-tailwind').classList.add('active');
135 } else if (view === 'code') {
136 document.getElementById('code-view').style.display = 'block';
137 document.getElementById('btn-code').classList.add('active');
138 }
139 }
140 </script>
141</body>
142</html>