Skip to content

Commit 9967ecf

Browse files
committed
style: improve UI with better contrast and visible theme toggle
1 parent 652ae71 commit 9967ecf

File tree

4 files changed

+27
-15
lines changed

4 files changed

+27
-15
lines changed

src/app/globals.css

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@
66

77
/* Light Theme (Default) */
88
:root {
9-
--bg-primary: #ffffff;
10-
--bg-secondary: #f8fafc;
9+
--bg-primary: #f8fafc;
10+
--bg-secondary: #ffffff;
1111
--bg-tertiary: #f1f5f9;
1212
--bg-elevated: #e2e8f0;
1313
--text-primary: #1e293b;
1414
--text-secondary: #475569;
15-
--text-muted: #94a3b8;
15+
--text-muted: #64748b;
1616
--accent-primary: #3b82f6;
1717
--accent-secondary: #10b981;
1818
--accent-warning: #f59e0b;
1919
--accent-danger: #ef4444;
20-
--border-color: rgba(0, 0, 0, 0.08);
21-
--border-hover: rgba(0, 0, 0, 0.15);
22-
--glass-bg: rgba(255, 255, 255, 0.9);
23-
--shadow-color: rgba(0, 0, 0, 0.1);
24-
--code-bg: #f8fafc;
20+
--border-color: rgba(0, 0, 0, 0.12);
21+
--border-hover: rgba(0, 0, 0, 0.2);
22+
--glass-bg: rgba(255, 255, 255, 0.95);
23+
--shadow-color: rgba(0, 0, 0, 0.08);
24+
--code-bg: #f1f5f9;
25+
--section-divider: #e2e8f0;
2526
}
2627

2728
/* Dark Theme */
@@ -37,11 +38,12 @@
3738
--accent-secondary: #10b981;
3839
--accent-warning: #f59e0b;
3940
--accent-danger: #ef4444;
40-
--border-color: rgba(255, 255, 255, 0.08);
41-
--border-hover: rgba(255, 255, 255, 0.15);
41+
--border-color: rgba(255, 255, 255, 0.1);
42+
--border-hover: rgba(255, 255, 255, 0.2);
4243
--glass-bg: rgba(26, 31, 38, 0.95);
4344
--shadow-color: rgba(0, 0, 0, 0.3);
4445
--code-bg: #0f1419;
46+
--section-divider: #2d353f;
4547
}
4648

4749
* {
@@ -59,6 +61,10 @@ body {
5961
overflow: hidden;
6062
}
6163

64+
* {
65+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
66+
}
67+
6268
/* Custom Scrollbar */
6369
::-webkit-scrollbar {
6470
width: 8px;

src/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export default function RootLayout({
1919
children: React.ReactNode
2020
}) {
2121
return (
22-
<html lang="en">
23-
<body className="antialiased">
22+
<html lang="en" suppressHydrationWarning>
23+
<body className="antialiased" suppressHydrationWarning>
2424
{children}
2525
</body>
2626
</html>

src/components/3d/NetworkVisualization.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ export default function NetworkVisualization() {
378378

379379
{/* Scene */}
380380
<NetworkScene />
381-
<GridFloor />
382381

383382
{/* Background stars effect - dark mode only */}
384383
<BackgroundStars />

src/components/NeuralNetworkVisualizer.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function HeaderBar({ isMobile }: { isMobile: boolean }) {
129129
{/* Theme Toggle */}
130130
<button
131131
onClick={toggleTheme}
132-
className="p-2 rounded-lg hover:bg-[var(--bg-tertiary)] transition-colors text-[var(--text-secondary)] hover:text-[var(--text-primary)]"
132+
className="p-2 rounded-lg bg-[var(--bg-tertiary)] border border-[var(--border-color)] hover:bg-[var(--bg-elevated)] transition-colors text-[var(--text-primary)]"
133133
aria-label={`Switch to ${ui.theme === 'light' ? 'dark' : 'light'} mode`}
134134
title={`Switch to ${ui.theme === 'light' ? 'dark' : 'light'} mode`}
135135
>
@@ -244,14 +244,21 @@ function useKeyboardShortcuts() {
244244
// Hook to apply theme to document
245245
function useTheme() {
246246
const theme = useNetworkStore(state => state.ui.theme);
247+
const [mounted, setMounted] = useState(false);
247248

248249
useEffect(() => {
250+
setMounted(true);
251+
}, []);
252+
253+
useEffect(() => {
254+
if (!mounted) return;
255+
249256
if (theme === 'dark') {
250257
document.documentElement.setAttribute('data-theme', 'dark');
251258
} else {
252259
document.documentElement.removeAttribute('data-theme');
253260
}
254-
}, [theme]);
261+
}, [theme, mounted]);
255262
}
256263

257264
// Main component

0 commit comments

Comments
 (0)