From 52bcb94d039a55cca08b18f7c19f1d00706b85e6 Mon Sep 17 00:00:00 2001 From: wameup Date: Tue, 10 Mar 2026 03:16:12 +0000 Subject: [PATCH] Implemented a fully responsive dark/light mode toggle switch in the navigation bar with smooth transitions across all components. --- src/App.jsx | 43 +++++++++++---------- src/components/layout/Footer.jsx | 28 +++++++------- src/components/layout/Navbar.jsx | 44 ++++++++++++++++----- src/context/ThemeContext.jsx | 50 ++++++++++++++++++++++++ src/index.css | 20 +++++++--- src/pages/Home.jsx | 66 ++++++++++++++++---------------- tailwind.config.js | 2 + 7 files changed, 171 insertions(+), 82 deletions(-) create mode 100644 src/context/ThemeContext.jsx diff --git a/src/App.jsx b/src/App.jsx index d7289db..f8519c5 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,4 +1,5 @@ import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; +import { ThemeProvider } from './context/ThemeContext'; import Navbar from './components/layout/Navbar'; import Footer from './components/layout/Footer'; import Home from './pages/Home'; @@ -14,26 +15,28 @@ import NotFound from './pages/NotFound'; function App() { return ( - -
- -
- - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - -
-
-
-
+ + +
+ +
+ + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + +
+
+
+
+
); } diff --git a/src/components/layout/Footer.jsx b/src/components/layout/Footer.jsx index 586fec1..068b8b4 100644 --- a/src/components/layout/Footer.jsx +++ b/src/components/layout/Footer.jsx @@ -4,13 +4,13 @@ import { FaDiscord } from 'react-icons/fa'; function Footer() { return ( -