From fea54e947ed1c7a587dc6f1beb85c83d78a0d6a1 Mon Sep 17 00:00:00 2001 From: Aryan Ramesh Jain <138214350+jainaryan04@users.noreply.github.com> Date: Mon, 4 Nov 2024 18:05:19 +0530 Subject: [PATCH] implements #469 for landing page --- frontend/src/Pages/Herosection.jsx | 52 +++++++++++++++--------------- frontend/src/Pages/hamburger.jsx | 5 +-- frontend/src/components/navbar.jsx | 2 +- frontend/src/components/popup.jsx | 16 ++++----- frontend/src/hooks/useDarkMode.js | 2 ++ frontend/tailwind.config.js | 7 ++-- 6 files changed, 44 insertions(+), 40 deletions(-) diff --git a/frontend/src/Pages/Herosection.jsx b/frontend/src/Pages/Herosection.jsx index 3fbc936..a6e72a0 100644 --- a/frontend/src/Pages/Herosection.jsx +++ b/frontend/src/Pages/Herosection.jsx @@ -57,7 +57,7 @@ const Herosection = () => { return ( <>
-
+
@@ -68,7 +68,7 @@ const Herosection = () => {
@@ -79,7 +79,7 @@ const Herosection = () => { -

+

Namaste !! Yatree{" "}

@@ -94,7 +94,7 @@ const Herosection = () => {


-
+
{ src={contributorsvg} alt="" className=" - bg-blue-200 border-2 border-blue-100 rounded-full + bg-blue-200 border-2 border-blue-100 rounded-full dark:bg-black w-[64px] h-[64px] p-2 " /> -

Contributors

+

Contributors

{ src={navigationsvg} alt="" srcset="" - className="bg-blue-200 border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg" + className="dark:bg-black bg-blue-200 border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg" /> -
{ src={bookingsvg} alt="" srcset="" - className="bg-blue-200 border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg " + className="bg-blue-200 border-2 dark:bg-black border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg " />
{ src={stationsvg} alt="" srcset="" - className="bg-blue-200 border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg" + className="bg-blue-200 dark:bg-black border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg" /> -
{ src={mapsvg} alt="" srcset="" - className="bg-blue-200 border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg" + className="bg-blue-200 dark:bg-black border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg" />{" "}
@@ -190,15 +190,15 @@ const Herosection = () => { src={schedulesvg} alt="" srcset="" - className="bg-blue-200 border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg" + className="bg-blue-200 dark:bg-black border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg" />
@@ -211,22 +211,22 @@ const Herosection = () => { src={noticationsvg} alt="" srcset="" - className="bg-blue-200 border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg " + className="bg-blue-200 dark:bg-black border-2 border-blue-200 rounded-full w-[64px] h-[64px] p-2 shadow-lg " />{" "}
-
+
-

Saarthi

+

Saarthi

); diff --git a/frontend/src/Pages/hamburger.jsx b/frontend/src/Pages/hamburger.jsx index 83d24a8..d581f49 100644 --- a/frontend/src/Pages/hamburger.jsx +++ b/frontend/src/Pages/hamburger.jsx @@ -214,8 +214,8 @@ const Hamburger = () => { return (
- - + + { onChange={handleSearchChange} onFocus={handleFocus} onBlur={handleBlur} + className="dark:bg-black dark:text-white dark:placeholder:text-gray-300" /> {showSearch && searchTerm && } diff --git a/frontend/src/components/navbar.jsx b/frontend/src/components/navbar.jsx index 00c09a5..6953bbf 100644 --- a/frontend/src/components/navbar.jsx +++ b/frontend/src/components/navbar.jsx @@ -93,7 +93,7 @@ const Navbar = () => { return ( <> {/* Navigation Toggle for All Screens (Mobile and Larger Screens) */} -
+
diff --git a/frontend/src/components/popup.jsx b/frontend/src/components/popup.jsx index 37495e7..d24c3f8 100644 --- a/frontend/src/components/popup.jsx +++ b/frontend/src/components/popup.jsx @@ -28,10 +28,10 @@ const Popup = () => { return ( isVisible && ( -
-
+
+
-

Welcome to Station Saarthi

-

Travel without stress. Sign in now!

+

Welcome to Station Saarthi

+

Travel without stress. Sign in now!

setEmail(e.target.value)} @@ -54,12 +54,12 @@ const Popup = () => { />
-

+

By signing in, I agree to Station Saarthi's{' '} Terms of Service and{' '} Privacy Policy. diff --git a/frontend/src/hooks/useDarkMode.js b/frontend/src/hooks/useDarkMode.js index 1513686..b391abf 100644 --- a/frontend/src/hooks/useDarkMode.js +++ b/frontend/src/hooks/useDarkMode.js @@ -7,8 +7,10 @@ const useDarkMode = () => { const root = document.documentElement; const isDark = theme === 'dark'; root.classList.toggle('dark', isDark); + console.log(`Theme set to ${theme}, dark mode is ${isDark ? 'enabled' : 'disabled'}`); localStorage.setItem('theme', theme); }, [theme]); + return [theme, setTheme]; }; diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index 6bdcac8..52339c9 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -1,9 +1,10 @@ /** @type {import('tailwindcss').Config} */ export default { content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'], + darkMode: 'class', theme: { - extend: {}, + extend: { + }, }, plugins: [], -} - +};