Benny-Tang commited on
Commit
580201f
·
verified ·
1 Parent(s): f8809ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +72 -20
app.py CHANGED
@@ -250,24 +250,75 @@ def run_query(query: str):
250
  return format_result(get_data(query))
251
 
252
 
253
- CSS = """
254
- #header-banner {
 
 
 
 
 
 
 
255
  background: linear-gradient(135deg, #0B1F3A 0%, #12294D 60%, #0D9488 100%);
256
  border-radius: 12px; padding: 28px 32px 20px; margin-bottom: 16px;
257
- }
258
- #header-banner h1 {
259
- font-size: 2.4rem; font-weight: 700; letter-spacing: 0.1em;
260
- color: white !important; margin: 0 0 4px;
261
- }
262
- #header-banner p { color: #5DCAA5; font-size: 1rem; margin: 0; }
263
- .result-panel {
264
- background: white; border: 1px solid #E2E8F0;
265
- border-radius: 10px; padding: 20px; margin-top: 12px;
266
- }
267
- """
268
 
269
- HEADER_HTML = """
270
- <div id="header-banner">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  <h1>🦥 SLOTH</h1>
272
  <p>AI Workforce Intelligence &nbsp;·&nbsp; Real-time compliance monitoring across 150+ countries</p>
273
  </div>
@@ -290,14 +341,14 @@ with gr.Blocks(title="Sloth — AI Workforce Intelligence") as demo:
290
  gr.Examples(examples=EXAMPLE_QUERIES, inputs=query_box, label="")
291
 
292
  with gr.Row():
293
- header_out = gr.Markdown(elem_classes=["result-panel"])
294
  with gr.Row():
295
  with gr.Column(scale=1):
296
- summary_out = gr.Markdown(elem_classes=["result-panel"])
297
  with gr.Column(scale=1):
298
- changes_out = gr.Markdown(elem_classes=["result-panel"])
299
  with gr.Row():
300
- expansion_out = gr.Markdown(elem_classes=["result-panel"])
301
 
302
  gr.Markdown(
303
  "<center style='color:#94A3B8;font-size:0.8rem;margin-top:16px'>"
@@ -313,4 +364,5 @@ with gr.Blocks(title="Sloth — AI Workforce Intelligence") as demo:
313
  outputs=[header_out, summary_out, changes_out, expansion_out])
314
 
315
  if __name__ == "__main__":
316
- demo.launch(server_name="0.0.0.0", server_port=7860, css=CSS, ssr_mode=False)
 
 
250
  return format_result(get_data(query))
251
 
252
 
253
+ CSS = "" # unused — styles injected via gr.HTML below
254
+
255
+ HEADER_HTML = """
256
+ <style>
257
+ /* ── Sloth global styles ── */
258
+ .gradio-container { background: #F1F5F9 !important; }
259
+
260
+ /* Header banner */
261
+ #sloth-header {
262
  background: linear-gradient(135deg, #0B1F3A 0%, #12294D 60%, #0D9488 100%);
263
  border-radius: 12px; padding: 28px 32px 20px; margin-bottom: 16px;
264
+ }
265
+ #sloth-header h1 {
266
+ font-size: 2.2rem; font-weight: 700; letter-spacing: 0.08em;
267
+ color: #FFFFFF !important; margin: 0 0 6px 0;
268
+ font-family: system-ui, sans-serif;
269
+ }
270
+ #sloth-header p {
271
+ color: #5DCAA5; font-size: 1rem; margin: 0;
272
+ font-family: system-ui, sans-serif;
273
+ }
 
274
 
275
+ /* Result panels — white cards with visible border */
276
+ .sloth-panel > .prose,
277
+ .sloth-panel .markdown-body,
278
+ .sloth-panel {
279
+ background: #FFFFFF !important;
280
+ border: 1.5px solid #CBD5E1 !important;
281
+ border-radius: 10px !important;
282
+ padding: 20px !important;
283
+ color: #1E293B !important;
284
+ }
285
+
286
+ /* Headings inside results */
287
+ .sloth-panel h1 { color: #0B1F3A !important; font-size: 1.4rem !important; }
288
+ .sloth-panel h2 { color: #0D9488 !important; font-size: 1.1rem !important;
289
+ border-bottom: 1px solid #E2E8F0; padding-bottom: 4px; margin-top: 16px; }
290
+ .sloth-panel p, .sloth-panel li { color: #1E293B !important; }
291
+ .sloth-panel code {
292
+ background: #F0FDFA !important; color: #0B1F3A !important;
293
+ border-radius: 4px; padding: 1px 6px;
294
+ }
295
+ .sloth-panel strong { color: #0B1F3A !important; }
296
+
297
+ /* Table styling */
298
+ .sloth-panel table { border-collapse: collapse; width: 100%; }
299
+ .sloth-panel th {
300
+ background: #F8FAFC !important; color: #0B1F3A !important;
301
+ border: 1px solid #E2E8F0; padding: 6px 10px; font-size: 0.88rem;
302
+ }
303
+ .sloth-panel td {
304
+ border: 1px solid #E2E8F0; padding: 6px 10px;
305
+ color: #1E293B !important; font-size: 0.88rem;
306
+ }
307
+
308
+ /* Query input */
309
+ textarea { color: #1E293B !important; background: #FFFFFF !important; }
310
+ label { color: #334155 !important; }
311
+
312
+ /* Submit button */
313
+ button.primary, .primary {
314
+ background: #0D9488 !important; color: #FFFFFF !important;
315
+ border: none !important; border-radius: 8px !important;
316
+ font-weight: 600 !important;
317
+ }
318
+ button.primary:hover { background: #0F6E56 !important; }
319
+ </style>
320
+
321
+ <div id="sloth-header">
322
  <h1>🦥 SLOTH</h1>
323
  <p>AI Workforce Intelligence &nbsp;·&nbsp; Real-time compliance monitoring across 150+ countries</p>
324
  </div>
 
341
  gr.Examples(examples=EXAMPLE_QUERIES, inputs=query_box, label="")
342
 
343
  with gr.Row():
344
+ header_out = gr.Markdown(elem_classes=["sloth-panel"])
345
  with gr.Row():
346
  with gr.Column(scale=1):
347
+ summary_out = gr.Markdown(elem_classes=["sloth-panel"])
348
  with gr.Column(scale=1):
349
+ changes_out = gr.Markdown(elem_classes=["sloth-panel"])
350
  with gr.Row():
351
+ expansion_out = gr.Markdown(elem_classes=["sloth-panel"])
352
 
353
  gr.Markdown(
354
  "<center style='color:#94A3B8;font-size:0.8rem;margin-top:16px'>"
 
364
  outputs=[header_out, summary_out, changes_out, expansion_out])
365
 
366
  if __name__ == "__main__":
367
+ demo.launch(server_name="0.0.0.0", server_port=7860, ssr_mode=False)
368
+