nice-bill commited on
Commit
32fcfa6
·
1 Parent(s): d93103e

mobile ux enhanced

Browse files
Files changed (1) hide show
  1. frontend/src/App.jsx +22 -18
frontend/src/App.jsx CHANGED
@@ -71,20 +71,24 @@ function App() {
71
  return (
72
  <div className="h-screen flex flex-col overflow-hidden bg-bg-main text-sm">
73
 
74
- {/* 1. Compact Top Navigation Bar */}
75
- <header className="h-14 border-b border-border bg-bg-panel flex items-center px-4 justify-between shrink-0">
76
- <div className="flex items-center gap-3">
77
- <div className="w-8 h-8 text-accent flex items-center justify-center">
78
- <img src={Logo} alt="Cluster Protocol" className="w-full h-full text-accent" />
 
 
 
 
 
 
 
79
  </div>
80
- <h1 className="font-mono font-semibold tracking-tight text-text-primary">
81
- CLUSTER<span className="text-text-secondary">PROTOCOL</span>
82
- </h1>
83
  <span className="px-2 py-0.5 rounded-full bg-border text-[10px] text-text-secondary font-mono">v2.1.0</span>
84
  </div>
85
 
86
- {/* Dense Search Input */}
87
- <div className="flex items-center gap-2 w-full max-w-md">
88
  <div className="relative flex-grow group">
89
  <div className="absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary">
90
  <Terminal size={14} />
@@ -104,7 +108,7 @@ function App() {
104
  disabled={status === 'loading'}
105
  className="px-4 py-1.5 bg-accent hover:bg-amber-400 text-black font-semibold text-xs uppercase tracking-wide rounded-sm transition-colors disabled:opacity-50"
106
  >
107
- {status === 'loading' ? "RUNNING..." : "EXECUTE"}
108
  </button>
109
  </div>
110
  </header>
@@ -117,11 +121,11 @@ function App() {
117
  )}
118
 
119
  {/* Main Content - Flex Layout to avoid scroll */}
120
- <main className="flex-grow flex items-center justify-center p-4 md:p-6 overflow-hidden relative">
121
 
122
  {/* Empty State */}
123
  {status === 'idle' && (
124
- <div className="text-center text-text-secondary space-y-4 max-w-md">
125
  <Layers className="w-12 h-12 mx-auto opacity-20" />
126
  <div className="space-y-1">
127
  <h2 className="text-text-primary font-medium">Ready to Process</h2>
@@ -132,7 +136,7 @@ function App() {
132
 
133
  {/* Loading State */}
134
  {status === 'loading' && (
135
- <div className="w-64 space-y-2">
136
  <div className="h-1 bg-border overflow-hidden rounded-full">
137
  <div className="h-full bg-accent w-1/3 animate-[shimmer_1s_infinite_linear]"></div>
138
  </div>
@@ -150,11 +154,11 @@ function App() {
150
  initial={{ opacity: 0, scale: 0.98 }}
151
  animate={{ opacity: 1, scale: 1 }}
152
  transition={{ duration: 0.2 }}
153
- className="w-full max-w-6xl h-full grid grid-cols-1 md:grid-cols-12 gap-4 grid-rows-[auto_1fr] md:grid-rows-1"
154
  >
155
 
156
  {/* Col 1: Visuals (Radar) - 5 Cols */}
157
- <div className="md:col-span-5 bg-bg-panel border border-border flex flex-col">
158
  <div className="p-3 border-b border-border flex justify-between items-center">
159
  <span className="text-xs font-mono text-text-primary font-semibold uppercase tracking-wider">Behavioral Topology</span>
160
  <Activity size={12} className="text-text-secondary" />
@@ -177,10 +181,10 @@ function App() {
177
  </div>
178
 
179
  {/* Col 2: Metrics & Insights - 7 Cols */}
180
- <div className="md:col-span-7 flex flex-col gap-4 overflow-y-auto pr-1">
181
 
182
  {/* Top Row: Metrics */}
183
- <div className="grid grid-cols-3 gap-4 h-24 shrink-0">
184
  <MetricCard
185
  label="TX_COUNT"
186
  value={data.stats.tx_count}
 
71
  return (
72
  <div className="h-screen flex flex-col overflow-hidden bg-bg-main text-sm">
73
 
74
+ {/* 1. Compact Top Navigation Bar (Command Deck Layout) */}
75
+ <header className="h-auto md:h-14 border-b border-border bg-bg-panel flex flex-col md:flex-row items-stretch md:items-center px-4 py-3 md:py-0 gap-3 md:gap-0 justify-between shrink-0 z-20">
76
+
77
+ {/* Deck 1: Brand HUD */}
78
+ <div className="flex items-center justify-between md:justify-start gap-3">
79
+ <div className="flex items-center gap-3">
80
+ <div className="w-8 h-8 text-accent flex items-center justify-center">
81
+ <img src={Logo} alt="Cluster Protocol" className="w-full h-full text-accent" />
82
+ </div>
83
+ <h1 className="font-mono font-semibold tracking-tight text-text-primary">
84
+ CLUSTER<span className="text-text-secondary">PROTOCOL</span>
85
+ </h1>
86
  </div>
 
 
 
87
  <span className="px-2 py-0.5 rounded-full bg-border text-[10px] text-text-secondary font-mono">v2.1.0</span>
88
  </div>
89
 
90
+ {/* Deck 2: Command Line (Search) */}
91
+ <div className="flex items-center gap-2 w-full md:max-w-md">
92
  <div className="relative flex-grow group">
93
  <div className="absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary">
94
  <Terminal size={14} />
 
108
  disabled={status === 'loading'}
109
  className="px-4 py-1.5 bg-accent hover:bg-amber-400 text-black font-semibold text-xs uppercase tracking-wide rounded-sm transition-colors disabled:opacity-50"
110
  >
111
+ {status === 'loading' ? "..." : "RUN"}
112
  </button>
113
  </div>
114
  </header>
 
121
  )}
122
 
123
  {/* Main Content - Flex Layout to avoid scroll */}
124
+ <main className="flex-grow flex flex-col md:flex-row items-center justify-center p-4 md:p-6 overflow-y-auto md:overflow-hidden relative">
125
 
126
  {/* Empty State */}
127
  {status === 'idle' && (
128
+ <div className="text-center text-text-secondary space-y-4 max-w-md mt-10 md:mt-0">
129
  <Layers className="w-12 h-12 mx-auto opacity-20" />
130
  <div className="space-y-1">
131
  <h2 className="text-text-primary font-medium">Ready to Process</h2>
 
136
 
137
  {/* Loading State */}
138
  {status === 'loading' && (
139
+ <div className="w-64 space-y-2 mt-10 md:mt-0">
140
  <div className="h-1 bg-border overflow-hidden rounded-full">
141
  <div className="h-full bg-accent w-1/3 animate-[shimmer_1s_infinite_linear]"></div>
142
  </div>
 
154
  initial={{ opacity: 0, scale: 0.98 }}
155
  animate={{ opacity: 1, scale: 1 }}
156
  transition={{ duration: 0.2 }}
157
+ className="w-full max-w-6xl h-auto md:h-full grid grid-cols-1 md:grid-cols-12 gap-4 grid-rows-[auto_1fr] md:grid-rows-1 pb-10 md:pb-0"
158
  >
159
 
160
  {/* Col 1: Visuals (Radar) - 5 Cols */}
161
+ <div className="md:col-span-5 bg-bg-panel border border-border flex flex-col min-h-[350px] md:min-h-0">
162
  <div className="p-3 border-b border-border flex justify-between items-center">
163
  <span className="text-xs font-mono text-text-primary font-semibold uppercase tracking-wider">Behavioral Topology</span>
164
  <Activity size={12} className="text-text-secondary" />
 
181
  </div>
182
 
183
  {/* Col 2: Metrics & Insights - 7 Cols */}
184
+ <div className="md:col-span-7 flex flex-col gap-4 overflow-visible md:overflow-y-auto pr-1">
185
 
186
  {/* Top Row: Metrics */}
187
+ <div className="grid grid-cols-3 gap-2 md:gap-4 h-20 md:h-24 shrink-0">
188
  <MetricCard
189
  label="TX_COUNT"
190
  value={data.stats.tx_count}