From 472fc22de7a7e9ad4dc7410c953924522c0fc2f8 Mon Sep 17 00:00:00 2001 From: justuche224 Date: Sun, 10 Aug 2025 01:20:55 +0100 Subject: [PATCH] feat(theme): add dark mode support for TreeAnimation and page text Update TreeAnimation component to use theme-aware stroke color and modify page text styling to support dark mode. The changes ensure consistent visibility across both light and dark themes. --- src/app/page.tsx | 4 ++-- src/components/bg/TreeAnimation.tsx | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index b24c945..125b8d3 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -143,10 +143,10 @@ export default function Home() { initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 1, delay: 0.4 }} - className="mt-6 text-lg sm:text-xl md:text-2xl max-w-2xl mx-auto text-muted-foreground drop-shadow-[0_0_12px_rgba(94,234,212,0.25)]" + className="mt-6 text-lg sm:text-xl md:text-2xl max-w-2xl mx-auto text-gray-700 dark:text-muted-foreground dark:drop-shadow-[0_0_12px_rgba(94,234,212,0.25)]" > Welcome to AlgoFlow — where tough algorithms become - interactive visual stories that stick with you forever. + interactive visual stories that stick with you forever. nodes.find((n) => n.id === id)!; export default function TreeAnimation() { const [highlightedNode, setHighlightedNode] = useState(null); const numberOfSparks = 4; + const { theme } = useTheme(); return (
@@ -86,7 +88,7 @@ export default function TreeAnimation() { y1={a.y} x2={b.x} y2={b.y} - stroke="white" + stroke={theme === "light" ? "black" : "white"} strokeWidth="0.3" filter="url(#glow)" />