alarv commited on
Commit
96f7185
·
1 Parent(s): 830adc3

fix: ui for dark theme

Browse files
Files changed (1) hide show
  1. Gradio_UI.py +42 -9
Gradio_UI.py CHANGED
@@ -261,16 +261,49 @@ class GradioUI:
261
  def launch(self, **kwargs):
262
  import gradio as gr
263
 
264
- with gr.Blocks(fill_height=True) as demo:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
  # Add disclaimers and project information
266
  gr.HTML("""
267
- <div style="background-color: #fff3cd; border: 1px solid #ffeaa7; border-radius: 5px; padding: 15px; margin: 10px 0;">
268
- <h3 style="color: #856404; margin-top: 0;">⚠️ Important Disclaimers</h3>
269
- <p style="margin: 5px 0;"><strong>Early Development Version:</strong> This is an early development version of QSARion. All results should be handled carefully and verified before use in any real applications.</p>
270
- <p style="margin: 5px 0;"><strong>AI/ML-Generated Results:</strong> All predictions are generated using artificial intelligence and machine learning models. Results may contain inaccuracies and should not be used as the sole basis for decision-making.</p>
271
- <p style="margin: 5px 0;"><strong>Verification Required:</strong> Always verify predictions through experimental validation or consultation with domain experts before practical application.</p>
272
- <hr style="margin: 10px 0; border-color: #ffeaa7;">
273
- <p style="margin: 5px 0; font-size: 12px;"><strong>Supported by:</strong> This work is supported by the <a href="https://pink-project.eu/" target="_blank" style="color: #007bff;">PINK Project</a> - a Horizon Europe initiative for Safe-and-Sustainable-by-Design computational approaches for chemicals and materials.</p>
274
  </div>
275
  """)
276
 
@@ -305,4 +338,4 @@ class GradioUI:
305
  demo.launch(debug=True, share=True, **kwargs)
306
 
307
 
308
- __all__ = ["stream_to_gradio", "GradioUI"]
 
261
  def launch(self, **kwargs):
262
  import gradio as gr
263
 
264
+ banner_css = """
265
+ :root {
266
+ --banner-bg: #fff3cd;
267
+ --banner-border: #ffeaa7;
268
+ --banner-text: #856404;
269
+ --banner-link: #007bff;
270
+ }
271
+ @media (prefers-color-scheme: dark) {
272
+ :root {
273
+ --banner-bg: #2b2a1f;
274
+ --banner-border: #6b5e00;
275
+ --banner-text: #f5e6a7;
276
+ --banner-link: #7cb7ff;
277
+ }
278
+ }
279
+ .qsar-banner {
280
+ background-color: var(--banner-bg);
281
+ border: 1px solid var(--banner-border);
282
+ border-radius: 5px;
283
+ padding: 15px;
284
+ margin: 10px 0;
285
+ color: var(--banner-text);
286
+ }
287
+ .qsar-banner h3 {
288
+ color: var(--banner-text);
289
+ margin-top: 0;
290
+ }
291
+ .qsar-banner a { color: var(--banner-link); }
292
+ .qsar-banner hr { border-color: var(--banner-border); }
293
+ .qsar-banner p { margin: 5px 0; }
294
+ .qsar-banner .support { font-size: 12px; }
295
+ """
296
+
297
+ with gr.Blocks(fill_height=True, css=banner_css) as demo:
298
  # Add disclaimers and project information
299
  gr.HTML("""
300
+ <div class=\"qsar-banner\">
301
+ <h3>⚠️ Important Disclaimers</h3>
302
+ <p><strong>Early Development Version:</strong> This is an early development version of QSARion. All results should be handled carefully and verified before use in any real applications.</p>
303
+ <p><strong>AI/ML-Generated Results:</strong> All predictions are generated using artificial intelligence and machine learning models. Results may contain inaccuracies and should not be used as the sole basis for decision-making.</p>
304
+ <p><strong>Verification Required:</strong> Always verify predictions through experimental validation or consultation with domain experts before practical application.</p>
305
+ <hr>
306
+ <p class=\"support\"><strong>Supported by:</strong> This work is supported by the <a href=\"https://pink-project.eu/\" target=\"_blank\">PINK Project</a> - a Horizon Europe initiative for Safe-and-Sustainable-by-Design computational approaches for chemicals and materials.</p>
307
  </div>
308
  """)
309
 
 
338
  demo.launch(debug=True, share=True, **kwargs)
339
 
340
 
341
+ __all__ = ["stream_to_gradio", "GradioUI"]