ViannyCruz commited on
Commit
b7078c7
·
verified ·
1 Parent(s): 92c7351

Update web/index.html

Browse files
Files changed (1) hide show
  1. web/index.html +20 -17
web/index.html CHANGED
@@ -3,15 +3,16 @@
3
  <head>
4
  <meta charset="utf-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
 
 
 
 
 
 
 
6
  <meta name="description" content="">
7
  <meta name="author" content="">
8
- <script>
9
- (function() {
10
- if (localStorage.getItem('theme') === 'dark') {
11
- document.documentElement.style.visibility = 'hidden';
12
- }
13
- })();
14
- </script>
15
  <link rel="icon" href="favicon.ico">
16
  <title>Dashboard</title>
17
  <link rel="stylesheet" href="css/simplebar.css">
@@ -1999,17 +2000,19 @@
1999
  <script>
2000
  (function () {
2001
  function applyTheme(theme) {
2002
- const lightTheme = document.getElementById('lightTheme');
2003
- const darkTheme = document.getElementById('darkTheme');
2004
- if (theme === 'dark') {
2005
- lightTheme.disabled = true;
2006
- darkTheme.disabled = false;
2007
- } else {
2008
- lightTheme.disabled = false;
2009
- darkTheme.disabled = true;
2010
- }
2011
- document.documentElement.style.visibility = 'visible';
2012
  }
 
 
2013
 
2014
  applyTheme(localStorage.getItem('theme') || 'light');
2015
 
 
3
  <head>
4
  <meta charset="utf-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6
+ <script>
7
+ (function() {
8
+ const isDark = localStorage.getItem('theme') === 'dark';
9
+ document.documentElement.setAttribute('data-theme', isDark ? 'dark' : 'light');
10
+ if (isDark) document.documentElement.style.backgroundColor = '#1a1a2e';
11
+ })();
12
+ </script>
13
  <meta name="description" content="">
14
  <meta name="author" content="">
15
+
 
 
 
 
 
 
16
  <link rel="icon" href="favicon.ico">
17
  <title>Dashboard</title>
18
  <link rel="stylesheet" href="css/simplebar.css">
 
2000
  <script>
2001
  (function () {
2002
  function applyTheme(theme) {
2003
+ const lightTheme = document.getElementById('lightTheme');
2004
+ const darkTheme = document.getElementById('darkTheme');
2005
+ if (theme === 'dark') {
2006
+ lightTheme.disabled = true;
2007
+ darkTheme.disabled = false;
2008
+ document.documentElement.style.backgroundColor = '#1a1a2e';
2009
+ } else {
2010
+ lightTheme.disabled = false;
2011
+ darkTheme.disabled = true;
2012
+ document.documentElement.style.backgroundColor = '';
2013
  }
2014
+ document.documentElement.style.visibility = 'visible';
2015
+ }
2016
 
2017
  applyTheme(localStorage.getItem('theme') || 'light');
2018