prithivMLmods commited on
Commit
6991f72
1 Parent(s): 5717146

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -34,14 +34,24 @@ def check_text(prompt, negative=""):
34
 
35
  js_func = """
36
 
37
- function () {
 
38
  const url = new URL(window.location);
39
- if (url.searchParams.get('__theme') !== 'dark') {
 
 
40
  url.searchParams.set('__theme', 'dark');
41
- window.location.href = url.href;
 
42
  }
43
- }
44
 
 
 
 
 
 
 
45
  """
46
 
47
 
 
34
 
35
  js_func = """
36
 
37
+ <script>
38
+ (function() {
39
  const url = new URL(window.location);
40
+ const currentTheme = url.searchParams.get('__theme');
41
+
42
+ if (currentTheme !== 'dark') {
43
  url.searchParams.set('__theme', 'dark');
44
+ history.pushState({}, '', url.href);
45
+ applyDarkTheme();
46
  }
47
+ })();
48
 
49
+ function applyDarkTheme() {
50
+ // Example: Apply dark theme styles to body or specific elements
51
+ document.body.classList.add('dark-theme');
52
+ // Additional logic as needed
53
+ }
54
+ </script>
55
  """
56
 
57