aicodingfun commited on
Commit
da94bb2
·
verified ·
1 Parent(s): a4f7684

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -9
app.py CHANGED
@@ -220,16 +220,12 @@ def get_top_bottom_news(date_obj):
220
  return f"<ul>{top_news_html}</ul>", f"<ul>{bottom_news_html}</ul>"
221
 
222
  with gr.Blocks(
223
- theme=gr.themes.Soft(primary_hue="sky", secondary_hue="orange"),
224
- css=".gradio-container {background: #0B0F19}",
225
  js="""
226
- window.addEventListener('load', () => {
227
- const u = new URL(window.location.href);
228
- if (u.searchParams.get('__theme') !== 'dark') {
229
- u.searchParams.set('__theme', 'dark');
230
- window.location.replace(u);
231
- }
232
- });
233
  """
234
  ) as app:
235
  gr.Markdown(f"""<div style='text-align: center; padding: 20px; color: white;'><h1 style='font-size: 3em; color: #00BFFF;'>📈 Crypto Pulse</h1><p style='font-size: 1.2em; color: #A9A9A9;'>比特幣新聞情緒與價格分析儀表板</p><p style='font-size: 0.9em; color: #888;'>Designed by: {DEVELOPER_NAME}</p></div>""")
 
220
  return f"<ul>{top_news_html}</ul>", f"<ul>{bottom_news_html}</ul>"
221
 
222
  with gr.Blocks(
223
+ theme=gr.themes.Soft(primary_hue="sky", secondary_hue="orange")
 
224
  js="""
225
+ () => {
226
+ document.body.classList.toggle('dark');
227
+ document.querySelector('gradio-app').style.backgroundColor = 'var(--color-background-primary)'
228
+ }
 
 
 
229
  """
230
  ) as app:
231
  gr.Markdown(f"""<div style='text-align: center; padding: 20px; color: white;'><h1 style='font-size: 3em; color: #00BFFF;'>📈 Crypto Pulse</h1><p style='font-size: 1.2em; color: #A9A9A9;'>比特幣新聞情緒與價格分析儀表板</p><p style='font-size: 0.9em; color: #888;'>Designed by: {DEVELOPER_NAME}</p></div>""")