AhmadMustafa commited on
Commit
ceacbcf
·
1 Parent(s): 9e7848a

update: dark mode

Browse files
Files changed (2) hide show
  1. app.py +1 -3
  2. utils.py +9 -3
app.py CHANGED
@@ -345,10 +345,8 @@ def create_chat_interface():
345
  css=css,
346
  head=head,
347
  js=js,
348
- theme=gr.themes.Monochrome(
349
  font=[gr.themes.GoogleFont("Inconsolata"), "Arial", "sans-serif"]
350
- ).set(
351
- background_fill_secondary_dark="#181818",
352
  ),
353
  ) as demo:
354
  chatbot = gr.Chatbot(
 
345
  css=css,
346
  head=head,
347
  js=js,
348
+ theme=gr.themes.Default(
349
  font=[gr.themes.GoogleFont("Inconsolata"), "Arial", "sans-serif"]
 
 
350
  ),
351
  ) as demo:
352
  chatbot = gr.Chatbot(
utils.py CHANGED
@@ -257,6 +257,12 @@ head = f"""
257
  </script>
258
  """
259
 
260
- js = """() => {
261
- document.body.classList.toggle('dark');
262
- }"""
 
 
 
 
 
 
 
257
  </script>
258
  """
259
 
260
+ js = """function refresh() {
261
+ const url = new URL(window.location);
262
+
263
+ if (url.searchParams.get('__theme') !== 'dark') {
264
+ url.searchParams.set('__theme', 'dark');
265
+ window.location.href = url.href;
266
+ }
267
+ }
268
+ """