Skip to content

Commit 04f73b2

Browse files
authored
Update index.html
1 parent 00670d0 commit 04f73b2

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

index.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@
5858
.onboarding-screen h1 { font-size: 24px; }
5959
.onboarding-logo img { width: 56px; height: 56px; }
6060
}
61+
62+
/* Dark Mode Styles */
63+
body.dark-mode { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important; }
64+
body.dark-mode .bg-white { background-color: rgba(255, 140, 66, 0.15) !important; backdrop-filter: blur(10px); }
65+
body.dark-mode .text-gray-600, body.dark-mode .text-gray-700, body.dark-mode .text-gray-800 { color: rgba(255, 255, 255, 0.9) !important; }
66+
body.dark-mode .border-orange-300, body.dark-mode .border-orange-200 { border-color: rgba(255, 140, 66, 0.3) !important; }
67+
body.dark-mode .bg-gradient-to-br { background: rgba(255, 140, 66, 0.1) !important; }
68+
body.dark-mode #mainContent .bg-white { background-color: rgba(255, 140, 66, 0.12) !important; }
69+
body.dark-mode input, body.dark-mode select, body.dark-mode textarea { background-color: rgba(255, 255, 255, 0.1) !important; color: white !important; border-color: rgba(255, 140, 66, 0.3) !important; }
70+
body.dark-mode input::placeholder { color: rgba(255, 255, 255, 0.5) !important; }
71+
body.dark-mode .bg-orange-100, body.dark-mode .bg-yellow-100 { background-color: rgba(255, 140, 66, 0.2) !important; }
72+
body.dark-mode .text-orange-700, body.dark-mode .text-orange-900 { color: rgba(255, 200, 100, 0.9) !important; }
73+
body.dark-mode #settingsModal > div, body.dark-mode #walletModal > div { background-color: rgba(255, 140, 66, 0.95) !important; backdrop-filter: blur(10px); border-color: rgba(255, 140, 66, 0.5) !important; }
74+
body.dark-mode #settingsModal h3, body.dark-mode #walletModal h3 { color: #1a1a2e !important; }
6175
</style>
6276
<body class="bg-gradient-to-br from-orange-100 via-yellow-50 to-green-100 min-h-screen transition-colors duration-300">
6377

@@ -210,6 +224,9 @@ <h3>Sit back and relax</h3>
210224
</div>
211225
</div>
212226
</div>
227+
<button id="themeToggle" class="bg-gradient-to-r from-orange-400 to-yellow-400 hover:from-orange-500 hover:to-yellow-500 text-white px-4 py-2 rounded-lg font-bold shadow-md transition transform hover:scale-105" title="Toggle Dark Mode">
228+
<span id="themeIcon">🌙</span>
229+
</button>
213230
</div>
214231
<!-- End Onboarding Modal -->
215232

@@ -1842,6 +1859,31 @@ <h3 class="font-bold text-orange-800 mb-2 text-sm">🎯 Target Price</h3>
18421859
if (localStorage.getItem('mangoswapOnboardingComplete') === 'true') {
18431860
document.getElementById('onboardingModal').classList.add('hidden');
18441861
}
1862+
1863+
// Dark Mode Toggle
1864+
const themeToggle = document.getElementById('themeToggle');
1865+
const themeIcon = document.getElementById('themeIcon');
1866+
const body = document.body;
1867+
1868+
// Check for saved theme preference or default to light mode
1869+
const currentTheme = localStorage.getItem('mangoswapTheme') || 'light';
1870+
if (currentTheme === 'dark') {
1871+
body.classList.add('dark-mode');
1872+
themeIcon.textContent = '☀️';
1873+
}
1874+
1875+
// Toggle theme
1876+
themeToggle.addEventListener('click', function() {
1877+
body.classList.toggle('dark-mode');
1878+
1879+
if (body.classList.contains('dark-mode')) {
1880+
themeIcon.textContent = '☀️';
1881+
localStorage.setItem('mangoswapTheme', 'dark');
1882+
} else {
1883+
themeIcon.textContent = '🌙';
1884+
localStorage.setItem('mangoswapTheme', 'light');
1885+
}
1886+
});
18451887
});
18461888
</script>
18471889

0 commit comments

Comments
 (0)