GOWREESH M G commited on
Commit
546b2f5
·
verified ·
1 Parent(s): 87e5bdc

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +16 -0
templates/index.html CHANGED
@@ -13,9 +13,15 @@
13
  <meta name="apple-mobile-web-app-title" content="RetinaScan">
14
  <meta name="apple-mobile-web-app-capable" content="yes">
15
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
 
16
 
17
  <!-- Tailwind CSS -->
18
  <script src="https://cdn.tailwindcss.com"></script>
 
 
 
 
 
19
  <!-- Lucide Icons -->
20
  <script src="https://unpkg.com/lucide@latest"></script>
21
 
@@ -444,10 +450,20 @@
444
 
445
  function toggleTheme() {
446
  const body = document.body;
 
447
  const current = body.getAttribute('data-theme');
448
  const target = current === 'light' ? 'dark' : 'light';
 
 
449
  body.setAttribute('data-theme', target);
450
 
 
 
 
 
 
 
 
451
  const icon = document.getElementById('theme-btn-icon');
452
  icon.setAttribute('data-lucide', target === 'light' ? 'moon' : 'sun');
453
  lucide.createIcons();
 
13
  <meta name="apple-mobile-web-app-title" content="RetinaScan">
14
  <meta name="apple-mobile-web-app-capable" content="yes">
15
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
16
+ <meta name="color-scheme" content="light dark">
17
 
18
  <!-- Tailwind CSS -->
19
  <script src="https://cdn.tailwindcss.com"></script>
20
+ <script>
21
+ tailwind.config = {
22
+ darkMode: 'class',
23
+ }
24
+ </script>
25
  <!-- Lucide Icons -->
26
  <script src="https://unpkg.com/lucide@latest"></script>
27
 
 
450
 
451
  function toggleTheme() {
452
  const body = document.body;
453
+ const html = document.documentElement;
454
  const current = body.getAttribute('data-theme');
455
  const target = current === 'light' ? 'dark' : 'light';
456
+
457
+ // Toggle custom CSS variables
458
  body.setAttribute('data-theme', target);
459
 
460
+ // Toggle Tailwind dark mode classes
461
+ if (target === 'dark') {
462
+ html.classList.add('dark');
463
+ } else {
464
+ html.classList.remove('dark');
465
+ }
466
+
467
  const icon = document.getElementById('theme-btn-icon');
468
  icon.setAttribute('data-lucide', target === 'light' ? 'moon' : 'sun');
469
  lucide.createIcons();