diff --git a/client/index.html b/client/index.html index d3018b1..1174dff 100644 --- a/client/index.html +++ b/client/index.html @@ -12,7 +12,7 @@ Drawn2Shoe - +
diff --git a/client/package-lock.json b/client/package-lock.json index 916e939..4295bdd 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -15,9 +15,11 @@ "react-burger-menu": "^3.0.9", "react-dom": "^18.2.0", "react-hot-toast": "^2.4.1", + "react-icons": "^5.2.1", "react-razorpay": "^2.0.1", - "react-redux": "^8.1.2", - "react-router-dom": "^6.16.0" + "react-redux": "^8.1.3", + "react-router-dom": "^6.16.0", + "redux": "^4.2.1" }, "devDependencies": { "@types/react": "^18.2.15", @@ -3960,6 +3962,14 @@ "react-dom": ">=16" } }, + "node_modules/react-icons": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.2.1.tgz", + "integrity": "sha512-zdbW5GstTzXaVKvGSyTaBalt7HSfuK5ovrzlpyiWHAFXndXTdd/1hdDHI4xBM1Mn7YriT6aqESucFl9kEXzrdw==", + "peerDependencies": { + "react": "*" + } + }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", @@ -3974,9 +3984,9 @@ } }, "node_modules/react-redux": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.1.2.tgz", - "integrity": "sha512-xJKYI189VwfsFc4CJvHqHlDrzyFTY/3vZACbE+rr/zQ34Xx1wQfB4OTOSeOSNrF6BDVe8OOdxIrAnMGXA3ggfw==", + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.1.3.tgz", + "integrity": "sha512-n0ZrutD7DaX/j9VscF+uTALI3oUPa/pO4Z3soOBIjuRn/FzVu6aehhysxZCLi6y7duMf52WNZGMl7CtuK5EnRw==", "dependencies": { "@babel/runtime": "^7.12.1", "@types/hoist-non-react-statics": "^3.3.1", diff --git a/client/package.json b/client/package.json index 84b231b..02859da 100644 --- a/client/package.json +++ b/client/package.json @@ -17,9 +17,11 @@ "react-burger-menu": "^3.0.9", "react-dom": "^18.2.0", "react-hot-toast": "^2.4.1", + "react-icons": "^5.2.1", "react-razorpay": "^2.0.1", - "react-redux": "^8.1.2", - "react-router-dom": "^6.16.0" + "react-redux": "^8.1.3", + "react-router-dom": "^6.16.0", + "redux": "^4.2.1" }, "devDependencies": { "@types/react": "^18.2.15", diff --git a/client/src/App.jsx b/client/src/App.jsx index 4b29281..5414a29 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -15,25 +15,27 @@ import Product from "./pages/Product"; import Cart from "./pages/Cart"; function App() { return ( - - - }> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - }> - } /> +
+ + + }> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + }> + } /> + - - - + + +
); } diff --git a/client/src/ThemeContext.jsx b/client/src/ThemeContext.jsx new file mode 100644 index 0000000..2ddd645 --- /dev/null +++ b/client/src/ThemeContext.jsx @@ -0,0 +1,34 @@ +// ThemeContext.js +import React, { createContext, useState, useEffect } from 'react'; + +export const ThemeContext = createContext(); + +export const ThemeProvider = ({ children }) => { + const [theme, setTheme] = useState(null); + + useEffect(() => { + if (window.matchMedia('(prefers-color-scheme: dark)').matches) { + setTheme('dark'); + } else { + setTheme('light'); + } + }, []); + + useEffect(() => { + if (theme === 'dark') { + document.documentElement.classList.add('dark'); + } else { + document.documentElement.classList.remove('dark'); + } + }, [theme]); + + const handleThemeSwitch = () => { + setTheme((prevTheme) => (prevTheme === 'dark' ? 'light' : 'dark')); + }; + + return ( + + {children} + + ); +}; diff --git a/client/src/assets/logoblack.png b/client/src/assets/logoblack.png new file mode 100644 index 0000000..fd8d8ac Binary files /dev/null and b/client/src/assets/logoblack.png differ diff --git a/client/src/assets/logowhite.png b/client/src/assets/logowhite.png new file mode 100644 index 0000000..f805c40 Binary files /dev/null and b/client/src/assets/logowhite.png differ diff --git a/client/src/components/Carousel2/index.jsx b/client/src/components/Carousel2/index.jsx index 5ff5ca3..0fb44ac 100644 --- a/client/src/components/Carousel2/index.jsx +++ b/client/src/components/Carousel2/index.jsx @@ -5,12 +5,12 @@ const Carousel2 = () => { return (
@@ -74,13 +74,13 @@ const Carousel2 = () => {
-
+
Divyansh Bisht
-
+
I was surprised. The quality was much higher than I expected! The best feeling is having people coming up to me in the street and asking where I got them. @@ -89,7 +89,7 @@ const Carousel2 = () => {
{
-
+
Divij Sharma
-
+
I was pleasantly surprised by the exceptional design quality! The best part is that I created the design myself, and they never fail to draw admiration diff --git a/client/src/components/Footer/index.jsx b/client/src/components/Footer/index.jsx index 48f268c..414ba56 100644 --- a/client/src/components/Footer/index.jsx +++ b/client/src/components/Footer/index.jsx @@ -1,21 +1,31 @@ -import React from "react"; +import React, { useContext } from "react"; import { NavLink, Link } from "react-router-dom"; import logo from "../../assets/logo-final.png"; +import logowhite from '../../assets/logowhite.png' +import logoblack from '../../assets/logoblack.png' +import { useSelector } from "react-redux"; + + const Footer = () => { + + // For Dark Mode using Redux + const theme = useSelector((state) => state.theme.theme); + // For Dark Mode using Redux + return (
- +
-
+
Home Categories Customize Shop
-
+
{ aria-labelledby="anxzlakyplg77qoc9l64rzi4s0sin9od" role="img" viewBox="0 0 24 24" - className="icon h-[1rem]" + className="icon h-[1rem] dark:fill-white" > Facebook icon @@ -60,7 +70,7 @@ const Footer = () => { strokeLinejoin="round" strokeMiterlimit="1.414" role="img" - className="icon h-[1rem]" + className="icon h-[1rem] dark:fill-white" > <path d="M8 0C5.827 0 5.555.01 4.702.048 3.85.088 3.27.222 2.76.42c-.526.204-.973.478-1.417.923-.445.444-.72.89-.923 1.417-.198.51-.333 1.09-.372 1.942C.008 5.555 0 5.827 0 8s.01 2.445.048 3.298c.04.852.174 1.433.372 1.942.204.526.478.973.923 1.417.444.445.89.72 1.417.923.51.198 1.09.333 1.942.372.853.04 1.125.048 3.298.048s2.445-.01 3.298-.048c.852-.04 1.433-.174 1.942-.372.526-.204.973-.478 1.417-.923.445-.444.72-.89.923-1.417.198-.51.333-1.09.372-1.942.04-.853.048-1.125.048-3.298s-.01-2.445-.048-3.298c-.04-.852-.174-1.433-.372-1.942-.204-.526-.478-.973-.923-1.417-.444-.445-.89-.72-1.417-.923-.51-.198-1.09-.333-1.942-.372C10.445.008 10.173 0 8 0zm0 1.44c2.136 0 2.39.01 3.233.048.78.036 1.203.166 1.485.276.374.145.64.318.92.598.28.28.453.546.598.92.11.282.24.705.276 1.485.038.844.047 1.097.047 3.233s-.01 2.39-.048 3.233c-.036.78-.166 1.203-.276 1.485-.145.374-.318.64-.598.92-.28.28-.546.453-.92.598-.282.11-.705.24-1.485.276-.844.038-1.097.047-3.233.047s-2.39-.01-3.233-.048c-.78-.036-1.203-.166-1.485-.276-.374-.145-.64-.318-.92-.598-.28-.28-.453-.546-.598-.92-.11-.282-.24-.705-.276-1.485C1.45 10.39 1.44 10.136 1.44 8s.01-2.39.048-3.233c.036-.78.166-1.203.276-1.485.145-.374.318-.64.598-.92.28-.28.546-.453.92-.598.282-.11.705-.24 1.485-.276C5.61 1.45 5.864 1.44 8 1.44zm0 2.452c-2.27 0-4.108 1.84-4.108 4.108 0 2.27 1.84 4.108 4.108 4.108 2.27 0 4.108-1.84 4.108-4.108 0-2.27-1.84-4.108-4.108-4.108zm0 6.775c-1.473 0-2.667-1.194-2.667-2.667 0-1.473 1.194-2.667 2.667-2.667 1.473 0 2.667 1.194 2.667 2.667 0 1.473-1.194 2.667-2.667 2.667zm5.23-6.937c0 .53-.43.96-.96.96s-.96-.43-.96-.96.43-.96.96-.96.96.43.96.96z"></path> </svg> @@ -82,7 +92,7 @@ const Footer = () => { </a> </div> </div> - <div className="flex items-center justify-center w-[80%] flex-wrap min-h-[3rem] max-lg:flex-col text-[#6e6d7a] text-[15px]"> + <div className="flex items-center justify-center w-[80%] flex-wrap min-h-[3rem] max-lg:flex-col text-[#6e6d7a] dark:text-slate-400 text-[15px]"> <div className="flex w-[50%] my-3 flex-wrap max-lg:justify-center"> © 2023 Drawn2Shoe. </div> diff --git a/client/src/components/Guide/guide.jsx b/client/src/components/Guide/guide.jsx index 1c880da..c7a95fe 100644 --- a/client/src/components/Guide/guide.jsx +++ b/client/src/components/Guide/guide.jsx @@ -6,13 +6,13 @@ import step1 from "../../assets/step_3.png"; const Guide = () => { return ( - <div className=" flex justify-center my-11 flex-col items-center"> + <div className=" flex justify-center my-11 flex-col items-center dark:text-white"> <div className="w-[80%] flex flex-col gap-6"> <div className="text-[50px] text-center custom max-md:text-[30px]"> Create Custom Shoes in 3 Easy Steps! </div> <div className="flex gap-4 max-md:flex-col"> - <div className="rounded-2xl shadow-[2px_4px_35px_4px_rgba(0,0,0,0.10)] px-10 py-5"> + <div className="rounded-2xl shadow-[2px_4px_35px_4px_rgba(0,0,0,0.10)] px-10 py-5 dark:shadow-gray-800 dark:bg-slate-700"> <img src={step1} alt="" /> <br /> <p className="font-bold text-[24px] custom"> @@ -26,7 +26,7 @@ const Guide = () => { <li>Many styles have black or white soles.</li> </ul> </div> - <div className="rounded-2xl shadow-[2px_4px_35px_4px_rgba(0,0,0,0.10)] px-10 py-5"> + <div className="rounded-2xl shadow-[2px_4px_35px_4px_rgba(0,0,0,0.10)] px-10 py-5 dark:shadow-gray-800 dark:bg-slate-700"> <img src={step2} alt="" /> <br /> <p className="font-bold text-[24px] custom"> @@ -40,7 +40,7 @@ const Guide = () => { <li>View mockup of custom shoes in real time</li> </ul> </div> - <div className="rounded-2xl shadow-[2px_4px_35px_4px_rgba(0,0,0,0.10)] px-10 py-5"> + <div className="rounded-2xl shadow-[2px_4px_35px_4px_rgba(0,0,0,0.10)] px-10 py-5 dark:shadow-gray-800 dark:bg-slate-700"> <img src={step3} alt="" /> <br /> <p className="font-bold text-[24px] custom"> @@ -58,7 +58,7 @@ const Guide = () => { </div> <div className="mt-[40px] shadow-[2px_4px_35px_4px_rgba(0,0,0,0.10)] rounded-full"> <Link to="/customize"> - <button className="inline-block bg-black text-white rounded-full border-2 border-black px-5 py-3 text-[25px] font-medium leading-normal transition duration-150 ease-in-out hover:bg-white hover:text-black focus:border-neutral-800 focus:text-neutral-800 focus:outline-none focus:ring-0 active:border-neutral-900 active:text-neutral-900 max-lg:text-[14px] hover:border-black"> + <button className="inline-block bg-black text-white rounded-full border-2 border-black px-5 py-3 text-[25px] font-medium leading-normal transition duration-150 ease-in-out hover:bg-white hover:text-black focus:border-neutral-800 focus:text-neutral-800 focus:outline-none focus:ring-0 active:border-neutral-900 active:text-neutral-900 max-lg:text-[14px] hover:border-black dark:bg-white dark:text-black dark:hover:bg-transparent dark:hover:border-white dark:hover:text-white"> Customize Now! </button> </Link> diff --git a/client/src/components/Home-banner/HomeBanner.jsx b/client/src/components/Home-banner/HomeBanner.jsx index b9dbeaf..acac4eb 100644 --- a/client/src/components/Home-banner/HomeBanner.jsx +++ b/client/src/components/Home-banner/HomeBanner.jsx @@ -4,7 +4,7 @@ import { Link } from "react-router-dom"; const HomeBanner = () => { return ( - <div className="flex justify-center items-center my-8"> + <div className="flex justify-center items-center my-8 dark:text-white"> <div className="w-[80%] flex max-md:flex-col-reverse justify-center items-center max-md:text-center"> <div className="w-[50%] max-md:w-full p-3"> <div className="text-[50px] max-md:text-[36px] leading-tight custom"> @@ -20,14 +20,14 @@ const HomeBanner = () => { <div className="flex gap-2 max-lg:justify-center"> <div> <Link to="/shop"> - <button className="inline-block rounded-full border-2 border-neutral-800 px-4 pb-[6px] pt-2 text-[16px] font-medium leading-normal text-neutral-800 transition duration-150 ease-in-out hover:border-neutral-800 hover:bg-black hover:text-white focus:border-neutral-800 focus:text-neutral-800 focus:outline-none focus:ring-0 active:border-neutral-900 active:text-neutral-900 max-lg:text-[14px]"> + <button className="inline-block rounded-full border-2 border-neutral-800 px-4 pb-[6px] pt-2 text-[16px] font-medium leading-normal text-neutral-800 transition duration-150 ease-in-out hover:border-neutral-800 hover:bg-black hover:text-white focus:border-neutral-800 focus:text-neutral-800 focus:outline-none focus:ring-0 active:border-neutral-900 active:text-neutral-900 max-lg:text-[14px] dark:border-white dark:text-white dark:hover:bg-gray-100 dark:hover:text-black"> Shop Now! </button> </Link> </div> <div> <Link to="/categories"> - <button className="inline-block bg-black rounded-full border-2 border-neutral-800 px-6 pb-[6px] pt-2 text-[16px] font-medium leading-normal text-white transition duration-150 ease-in-out hover:border-neutral-800 hover:bg-white hover:text-black focus:border-neutral-800 focus:text-neutral-800 focus:outline-none focus:ring-0 active:border-neutral-900 active:text-neutral-900 max-lg:text-[14px]"> + <button className="inline-block bg-black rounded-full border-2 border-neutral-800 px-6 pb-[6px] pt-2 text-[16px] font-medium leading-normal text-white transition duration-150 ease-in-out hover:border-neutral-800 hover:bg-white hover:text-black focus:border-neutral-800 focus:text-neutral-800 focus:outline-none focus:ring-0 active:border-neutral-900 active:text-neutral-900 max-lg:text-[14px] dark:border-white dark:text-black dark:hover:bg-transparent dark:hover:text-white dark:bg-white "> Explore </button> </Link> diff --git a/client/src/components/Home-retailers/index.jsx b/client/src/components/Home-retailers/index.jsx index 3a045e9..39e1474 100644 --- a/client/src/components/Home-retailers/index.jsx +++ b/client/src/components/Home-retailers/index.jsx @@ -2,7 +2,7 @@ import React from "react"; import { Link } from "react-router-dom"; const Home_retailers_comp = () => { return ( - <div className="bg-[#f8d5d1] h-[500px] flex flex-col justify-center items-center gap-7"> + <div className="bg-[#f8d5d1] h-[500px] flex flex-col justify-center items-center gap-7 dark:bg-black/20 dark:text-white"> <div className="text-center"> Your Journey to Entrepreneurship Starts Here – Explore Our Franchise. @@ -10,7 +10,7 @@ const Home_retailers_comp = () => { <div className="text-[50px]">Join us today!</div> <div className="flex gap-4"> <Link to="/retailer"> - <button className="inline-block bg-black text-white rounded-full border-2 border-black px-4 pb-[6px] pt-2 text-[16px] font-medium leading-normal transition duration-150 ease-in-out hover:border-white hover:bg-white hover:text-black focus:border-neutral-800 focus:text-neutral-800 focus:outline-none focus:ring-0 active:border-neutral-900 active:text-neutral-900 max-lg:text-[14px]"> + <button className="inline-block bg-black text-white rounded-full border-2 border-black px-4 pb-[6px] pt-2 text-[16px] font-medium leading-normal transition duration-150 ease-in-out hover:border-white hover:bg-white hover:text-black focus:border-neutral-800 focus:text-neutral-800 focus:outline-none focus:ring-0 active:border-neutral-900 active:text-neutral-900 max-lg:text-[14px] dark:bg-transparent dark:border-white dark:hover:bg-white"> Get started now </button> </Link> diff --git a/client/src/components/Navbar/navbar.jsx b/client/src/components/Navbar/navbar.jsx index 31594c1..8568291 100644 --- a/client/src/components/Navbar/navbar.jsx +++ b/client/src/components/Navbar/navbar.jsx @@ -4,9 +4,21 @@ import { Divide, Divide as Hamburger } from "hamburger-react"; import { stack as Menu } from "react-burger-menu"; import logo from "../../assets/logo-final.png"; import axios from "axios"; +import { MdLightMode } from "react-icons/md"; +import { MdDarkMode } from "react-icons/md"; +import logowhite from '../../assets/logowhite.png' +import logoblack from '../../assets/logoblack.png' +import { useSelector, useDispatch } from 'react-redux'; +import { toggleTheme, setTheme } from '../../redux/actions/themeActions'; const Navbar = () => { const [user, setUser] = useState(); + + // For Dark Mode + const theme = useSelector((state) => state.theme.theme); + const dispatch = useDispatch(); + // For Dark Mode + useEffect(() => { const checklogin = async () => { const { data } = await axios.get( @@ -22,6 +34,25 @@ const Navbar = () => { }; checklogin(); }, []); + + // For Dark Mode using Redux + useEffect(() => { + if (window.matchMedia('(prefers-color-scheme: dark)').matches) { + dispatch(setTheme('dark')); + } else { + dispatch(setTheme('light')); + } + }, [dispatch]); + + useEffect(() => { + if (theme === 'dark') { + document.documentElement.classList.add('dark'); + } else { + document.documentElement.classList.remove('dark'); + } + }, [theme]); + // For Dark Mode using Redux + var styles = { bmBurgerButton: { display: "none", @@ -60,6 +91,7 @@ const Navbar = () => { }, }; const [toggled, setToggled] = useState(false); + return ( <> <Menu @@ -114,7 +146,7 @@ const Navbar = () => { Login </Link> </Menu> - <nav className="flex items-center py-4 px-2 text-sm"> + <nav className="flex items-center py-4 px-2 text-sm dark:text-white"> <div className="flex gap-4 w-[30%] justify-center items-center max-lg:hidden"> <NavLink to="/" @@ -158,7 +190,7 @@ const Navbar = () => { /> </div> <Link to="/" className="font-bold text-[25px]"> - <img src={logo} alt="" className="w-40" /> + <img src={theme === "dark" ? logowhite : logoblack} alt="" className="w-40" /> </Link> </div> <div @@ -166,21 +198,24 @@ const Navbar = () => { user ? "hidden" : "" }`} > + <div onClick={() => dispatch(toggleTheme())} className="text-2xl border rounded-full border-lg border-black dark:border dark:border-lg dark:rounded-full dark:border-yellow-500 p-1 cursor-pointer hover:scale-110 transition-all dark:text-yellow-400 text-center self-center"> + {theme === "dark" ? <MdLightMode /> : <MdDarkMode />} + </div> <Link to="login"> {" "} - <button className="inline-block rounded-full border-2 border-neutral-800 px-4 pb-[6px] pt-2 text-[12px] font-medium uppercase leading-normal text-neutral-800 transition duration-150 ease-in-out hover:border-neutral-800 hover:bg-black hover:text-white focus:border-neutral-800 focus:text-neutral-800 focus:outline-none focus:ring-0 active:border-neutral-900 active:text-neutral-900 max-lg:hidden"> + <button className="inline-block rounded-full border-2 border-neutral-800 px-4 pb-[6px] pt-2 text-[12px] font-medium uppercase leading-normal text-neutral-800 transition duration-150 ease-in-out hover:border-neutral-800 hover:bg-black hover:text-white focus:border-neutral-800 focus:outline-none focus:ring-0 active:border-neutral-900 active:text-neutral-900 max-lg:hidden dark:border-white dark:text-white dark:hover:bg-gray-100 dark:hover:text-black"> Login </button>{" "} </Link> <Link to="signup"> {" "} - <button className="inline-block bg-black rounded-full border-2 border-neutral-800 px-6 pb-[6px] pt-2 text-[12px] font-medium uppercase leading-normal text-white transition duration-150 ease-in-out hover:border-neutral-800 hover:bg-white hover:text-black focus:border-neutral-800 focus:text-neutral-800 focus:outline-none focus:ring-0 active:border-neutral-900 active:text-neutral-900 "> + <button className="inline-block bg-black rounded-full border-2 border-neutral-800 px-6 pb-[6px] pt-2 text-[12px] font-medium uppercase leading-normal text-white transition duration-150 ease-in-out hover:border-neutral-800 hover:bg-white hover:text-black focus:border-neutral-800 focus:text-white focus:outline-none focus:ring-0 active:border-neutral-900 active:text-neutral-900 dark:border-white dark:bg-gray-100 dark:text-black dark:hover:text-white dark:hover:bg-black"> SignUp </button>{" "} </Link> </div> <div - className={`flex w-[30%] text-base items-center justify-center gap-4 max-lg:w-full max-lg:justify-end ${ + className={`flex w-[30%] text-base items-center justify-center gap-4 max-lg:w-full max-lg:justify-end dark:text-white ${ !user ? "hidden" : "" }`} > diff --git a/client/src/components/carousel/index.jsx b/client/src/components/carousel/index.jsx index c89485a..0d78fd4 100644 --- a/client/src/components/carousel/index.jsx +++ b/client/src/components/carousel/index.jsx @@ -13,7 +13,7 @@ const Carousel = () => { return ( <div ref={carousel} - className="relative overflow-x-hidden flex w-[100vw] h-[300px] items-center scroll-auto transition-transform: flex-row my-8" + className="relative overflow-x-hidden flex w-[100vw] h-[300px] items-center scroll-auto transition-transform: flex-row my-8 " > <div className="flex animate-marquee"> <Link to="/categories" className="mx-3 h-[250px] w-[250px]"> diff --git a/client/src/index.css b/client/src/index.css index fe7684a..6c572f2 100644 --- a/client/src/index.css +++ b/client/src/index.css @@ -1,8 +1,10 @@ @tailwind base; @tailwind components; @tailwind utilities; + body { font-family: "Source Serif 4", Georgia, serif; + @apply transition-colors duration-1000 } .custom{ font-family: "Mona Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; diff --git a/client/src/pages/Categories/categories.jsx b/client/src/pages/Categories/categories.jsx index 8058b0d..438e80e 100644 --- a/client/src/pages/Categories/categories.jsx +++ b/client/src/pages/Categories/categories.jsx @@ -12,13 +12,13 @@ const Categories = () => { return ( <div> <div className="text-center p-10"> - <h1 className="categories text-4xl mb-4 font-medium"> + <h1 className="categories text-4xl mb-4 font-medium dark:text-white"> Explore our amazing Categories! </h1> </div> <div id="Projects" - className="w-fit mx-auto grid grid-cols-1 lg:grid-cols-3 md:grid-cols-2 justify-items-center justify-center gap-y-20 gap-x-14 mt-10 mb-5" + className="w-fit mx-auto grid grid-cols-1 lg:grid-cols-3 md:grid-cols-2 justify-items-center justify-center gap-y-20 gap-x-14 mt-10 mb-5 dark:text-white" > {todisplay} </div> diff --git a/client/src/pages/Customize/customize.jsx b/client/src/pages/Customize/customize.jsx index 99fd4db..86586f9 100644 --- a/client/src/pages/Customize/customize.jsx +++ b/client/src/pages/Customize/customize.jsx @@ -46,12 +46,12 @@ const Customize = () => { } return ( <div> - <div className="min-h-screen p-6 bg-gray-100 flex items-center justify-center"> + <div className="min-h-screen p-6 bg-gray-100 dark:bg-gray-800 flex items-center justify-center"> <div className="container max-w-screen-lg mx-auto"> <div> - <div className="bg-white rounded shadow-lg p-4 px-4 md:p-8 mb-6"> + <div className="bg-white dark:bg-gray-900 dark:text-white rounded shadow-lg p-4 px-4 md:p-8 mb-6"> <div className="grid gap-4 gap-y-2 text-sm grid-cols-1 lg:grid-cols-3"> - <div className="text-gray-600"> + <div className="text-gray-600 dark:text-white"> <p className="font-medium text-lg"> You'll Design, We'll Create! </p> @@ -69,7 +69,7 @@ const Customize = () => { <select name="shoe_model" id="shoe_model" - className="h-10 border mt-1 rounded px-4 w-full bg-gray-50" + className="h-10 border mt-1 rounded px-4 w-full bg-gray-50 dark:bg-gray-800" > <option>Crocs</option> <option>Air Force 1</option> @@ -83,7 +83,7 @@ const Customize = () => { <select name="shoe_size" id="shoe_size" - className="h-10 border mt-1 rounded px-4 w-full bg-gray-50" + className="h-10 border mt-1 rounded px-4 w-full bg-gray-50 dark:bg-gray-800" > <option>7</option> <option>8</option> @@ -104,7 +104,7 @@ const Customize = () => { name="desc" id="design_desc" rows={"4"} - className="border mt-1 rounded px-4 w-full bg-gray-50" + className="border mt-1 rounded px-4 w-full bg-gray-50 dark:bg-gray-800" placeholder="Describe your design..." onChange={handleChange} value={formData.desc} @@ -118,7 +118,7 @@ const Customize = () => { <input type="text" name="link" - className="h-10 border mt-1 rounded px-4 w-full bg-gray-50" + className="h-10 border mt-1 rounded px-4 w-full bg-gray-50 dark:bg-gray-800" onChange={handleChange} value={formData.link} /> diff --git a/client/src/pages/Login/login.jsx b/client/src/pages/Login/login.jsx index bff6f17..04e0ca2 100644 --- a/client/src/pages/Login/login.jsx +++ b/client/src/pages/Login/login.jsx @@ -41,8 +41,8 @@ const Login = () => { <> <div className=""> <div className="p-8 lg:w-1/2 mx-auto"> - <div className="bg-gray-100 rounded-b-lg py-12 px-4 lg:px-24"> - <p className="text-center text-sm text-gray-500 font-light"> + <div className="bg-gray-100 rounded-b-lg py-12 px-4 lg:px-24 dark:bg-slate-800"> + <p className="text-center text-sm text-gray-500 font-light dark:text-white"> Sign in with credentials </p> @@ -115,7 +115,7 @@ const Login = () => { </div> <hr className="m-4" /> <div className="flex items-center justify-center mt-5"> - <span className=" text-gray-500"> + <span className=" text-gray-500 dark:text-white"> DO NOT HAVE A ACCOUNT ?! </span>{" "} <Link diff --git a/client/src/pages/Shop/shop.jsx b/client/src/pages/Shop/shop.jsx index 6614ba9..b270669 100644 --- a/client/src/pages/Shop/shop.jsx +++ b/client/src/pages/Shop/shop.jsx @@ -38,8 +38,8 @@ const Shop = () => { </button> ); return ( - <div> - <div> + <div className="dark:text-white"> + <div > <button onClick={() => handleFilterChange("type", "1")} className={`my-3 ml-3 underline underline-offset-8`} diff --git a/client/src/pages/Signup/signup.jsx b/client/src/pages/Signup/signup.jsx index adf4ac7..87af78e 100644 --- a/client/src/pages/Signup/signup.jsx +++ b/client/src/pages/Signup/signup.jsx @@ -64,8 +64,8 @@ const Signup = () => { <> <div className=""> <div className="p-8 lg:w-1/2 mx-auto"> - <div className="bg-gray-100 rounded-b-lg py-12 px-4 lg:px-24"> - <h1 className="text-center text-sm text-gray-500 font-semibold"> + <div className="bg-gray-100 rounded-b-lg py-12 px-4 lg:px-24 dark:bg-slate-800"> + <h1 className="text-center text-sm text-gray-500 font-semibold dark:text-white"> REGISTER HERE!!! </h1> @@ -232,7 +232,7 @@ const Signup = () => { </div> <div className="relative mt-3"> <input - className="appearance-none border pl-12 border-gray-100 shadow-sm focus:shadow-md focus:placeholder-gray-600 transition rounded-md w-full py-3 text-gray-600 leading-tight focus:outline-none focus:ring-gray-600 focus:shadow-outline" + className="appearance-none border pl-12 border-gray-100 shadow-sm focus:shadow-md focus:placeholder-gray-600 transition rounded-md w-full py-3 text-gray-600 leading-tight focus:outline-none focus:ring-gray-600 focus:shadow-outline [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none" id="password" type="number" placeholder="Pincode" @@ -274,7 +274,7 @@ const Signup = () => { </div> <hr className="m-4" /> <div className="flex items-center justify-center mt-5"> - <p className=" text-gray-500 "> + <p className=" text-gray-500 dark:text-white"> HAVE A ACCOUNT ?! </p> <Link diff --git a/client/src/reducers/themeReducer.js b/client/src/reducers/themeReducer.js new file mode 100644 index 0000000..1363ba5 --- /dev/null +++ b/client/src/reducers/themeReducer.js @@ -0,0 +1,24 @@ +import { TOGGLE_THEME, SET_THEME } from '../../actions/themeActions'; + +const initialState = { + theme: null, +}; + +const themeReducer = (state = initialState, action) => { + switch (action.type) { + case TOGGLE_THEME: + return { + ...state, + theme: state.theme === 'dark' ? 'light' : 'dark', + }; + case SET_THEME: + return { + ...state, + theme: action.payload, + }; + default: + return state; + } +}; + +export default themeReducer; diff --git a/client/src/redux/actions/themeActions.js b/client/src/redux/actions/themeActions.js new file mode 100644 index 0000000..d42b17c --- /dev/null +++ b/client/src/redux/actions/themeActions.js @@ -0,0 +1,11 @@ +export const TOGGLE_THEME = 'TOGGLE_THEME'; +export const SET_THEME = 'SET_THEME'; + +export const toggleTheme = () => ({ + type: TOGGLE_THEME, +}); + +export const setTheme = (theme) => ({ + type: SET_THEME, + payload: theme, +}); diff --git a/client/src/redux/reducers/index.js b/client/src/redux/reducers/index.js new file mode 100644 index 0000000..2e71a24 --- /dev/null +++ b/client/src/redux/reducers/index.js @@ -0,0 +1,8 @@ +import { combineReducers } from 'redux'; +import themeReducer from './themeReducer'; + +const rootReducer = combineReducers({ + theme: themeReducer, +}); + +export default rootReducer; diff --git a/client/src/redux/reducers/themeReducer.js b/client/src/redux/reducers/themeReducer.js new file mode 100644 index 0000000..4bbffe9 --- /dev/null +++ b/client/src/redux/reducers/themeReducer.js @@ -0,0 +1,24 @@ +import { TOGGLE_THEME, SET_THEME } from '../actions/themeActions'; + +const initialState = { + theme: null, +}; + +const themeReducer = (state = initialState, action) => { + switch (action.type) { + case TOGGLE_THEME: + return { + ...state, + theme: state.theme === 'dark' ? 'light' : 'dark', + }; + case SET_THEME: + return { + ...state, + theme: action.payload, + }; + default: + return state; + } +}; + +export default themeReducer; diff --git a/client/src/redux/store.js b/client/src/redux/store.js index 0ed93d0..d129ddf 100644 --- a/client/src/redux/store.js +++ b/client/src/redux/store.js @@ -1,7 +1,10 @@ import { configureStore } from "@reduxjs/toolkit"; +import themeReducer from './reducers/themeReducer'; + export const store = configureStore({ reducer: { - // reducer - } -}) \ No newline at end of file + // reducers + theme: themeReducer, + }, +}); \ No newline at end of file diff --git a/client/tailwind.config.js b/client/tailwind.config.js index f60a30b..8dfaabe 100644 --- a/client/tailwind.config.js +++ b/client/tailwind.config.js @@ -2,7 +2,7 @@ export default { content: [ "./index.html", - "./src/**/*.{js,ts,jsx,tsx}", + "./src/**/*.{js,ts,jsx,tsx,css}", ], theme: { extend: { @@ -25,6 +25,7 @@ export default { plugins: [require("daisyui")], daisyui:{ themes:["light"] - } + }, + darkMode: "class", }