|
34 | 34 | localStorage.setItem('theme', isLight ? 'dark' : 'light'); |
35 | 35 | } |
36 | 36 |
|
37 | | - // Set initial theme based on saved preference |
| 37 | + // Set initial theme based on saved preference, defaulting to light |
38 | 38 | document.addEventListener('DOMContentLoaded', () => { |
39 | 39 | const savedTheme = localStorage.getItem('theme'); |
| 40 | + const themeStyle = document.getElementById('theme-style'); |
| 41 | + const icon = document.querySelector('.theme-switch i'); |
| 42 | + |
| 43 | + // Default to light mode |
40 | 44 | if (savedTheme === 'dark') { |
41 | | - toggleTheme(); |
| 45 | + themeStyle.disabled = false; |
| 46 | + icon.className = 'fas fa-moon'; |
| 47 | + } else { |
| 48 | + themeStyle.disabled = true; |
| 49 | + icon.className = 'fas fa-sun'; |
| 50 | + // Explicitly set to light if no preference is saved |
| 51 | + if (!savedTheme) { |
| 52 | + localStorage.setItem('theme', 'light'); |
| 53 | + } |
42 | 54 | } |
43 | 55 | }); |
44 | 56 | </script> |
@@ -99,7 +111,7 @@ <h2 id="video">Video</h2> |
99 | 111 |
|
100 | 112 | <section class="section" id="citation"> |
101 | 113 | <div class="container is-max-desktop content"> |
102 | | - <h2 class="title">Citation</h2> |
| 114 | + <h2 id="citation-header">Citation</h2> |
103 | 115 | <div class="citation-box"> |
104 | 116 | <button class="copy" onclick="copyText()"><i class="fa fa-clipboard"></i></button> |
105 | 117 | <pre><code id="citation-content">@article{Anonymous2024, |
|
0 commit comments