From 46860ed59427301fa716105d2bebd5d60ea70b57 Mon Sep 17 00:00:00 2001 From: Nayan Mahera Date: Sat, 12 Oct 2024 15:44:33 +0530 Subject: [PATCH 1/3] custom cursor added --- client/package-lock.json | 10 ++ client/package.json | 1 + client/src/App.jsx | 315 ++++++++++++++++++++++++++++++--------- client/src/index.css | 83 ++++++----- client/src/main.jsx | 12 +- 5 files changed, 305 insertions(+), 116 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index b9d9209..9f66c5d 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -36,6 +36,7 @@ "otp-input-react": "^0.3.0", "prop-types": "^15.8.1", "react": "^18.2.0", + "react-animated-cursor": "^2.11.2", "react-bootstrap": "^2.10.2", "react-dom": "^18.2.0", "react-google-recaptcha": "^3.1.0", @@ -7591,6 +7592,15 @@ "node": ">=0.10.0" } }, + "node_modules/react-animated-cursor": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/react-animated-cursor/-/react-animated-cursor-2.11.2.tgz", + "integrity": "sha512-LV0PtST61tdeW/chCqFt1JLp6i0d5fD9v2uradBcPAkKKCi2Iw7sAcD11ADS1TjXPPj9MOoD9YubEt++/IbZ+g==", + "peerDependencies": { + "react": "^18.2.0", + "react-dom": "^18.2.0" + } + }, "node_modules/react-async-script": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/react-async-script/-/react-async-script-1.2.0.tgz", diff --git a/client/package.json b/client/package.json index 336849e..f0c76dd 100644 --- a/client/package.json +++ b/client/package.json @@ -38,6 +38,7 @@ "otp-input-react": "^0.3.0", "prop-types": "^15.8.1", "react": "^18.2.0", + "react-animated-cursor": "^2.11.2", "react-bootstrap": "^2.10.2", "react-dom": "^18.2.0", "react-google-recaptcha": "^3.1.0", diff --git a/client/src/App.jsx b/client/src/App.jsx index 1b93f97..d99a553 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -1,66 +1,66 @@ -import { useEffect, useState } from 'react'; -import { BrowserRouter as Router, Routes, Route, useLocation } from 'react-router-dom'; -import './App.css'; -import './index.css'; -import LoadingBar from 'react-top-loading-bar'; -import About from './component/About'; -import Alert from './component/Alert'; -import Footer from './component/Footer'; -import Home from './component/Home'; -import Login from './component/Login'; -import Navbar from './component/Navbar'; -import Signup from './component/Signup'; -import ProjectState from './context/ProjectState'; -import ProfileState from './context/ProfileState'; -import CodeOfConduct from './component/Footers/Codeofconduct'; -import Feedback from './component/Footers/Feedback'; -import ContactUs from './component/Footers/Contactus'; -import PrivacyPolicy from './component/Footers/Privacypolicy'; -import TermOfUse from './component/Footers/TermOfUse'; -import Community from './component/Community'; -import MyProfile from './component/MyProfile'; -import ScrollTop from './component/ScrollTop'; -import EditProfile from './component/EditProfile'; -import Contributers from './component/Contributers'; -import Discussion from './component/Discussion'; -import { useAtom } from 'jotai'; -import { modeAtom } from './atom/Atom'; -import ForgotPassword from './component/forgotpass'; -import VerifyEmail from './component/Verify'; -import NotFound from './component/NotFound'; +import { useEffect, useState } from "react"; +import { + BrowserRouter as Router, + Routes, + Route, + useLocation, +} from "react-router-dom"; +import "./App.css"; +import "./index.css"; +import LoadingBar from "react-top-loading-bar"; +import About from "./component/About"; +import Alert from "./component/Alert"; +import Footer from "./component/Footer"; +import Home from "./component/Home"; +import Login from "./component/Login"; +import Navbar from "./component/Navbar"; +import Signup from "./component/Signup"; +import ProjectState from "./context/ProjectState"; +import ProfileState from "./context/ProfileState"; +import CodeOfConduct from "./component/Footers/Codeofconduct"; +import Feedback from "./component/Footers/Feedback"; +import ContactUs from "./component/Footers/Contactus"; +import PrivacyPolicy from "./component/Footers/Privacypolicy"; +import TermOfUse from "./component/Footers/TermOfUse"; +import Community from "./component/Community"; +import MyProfile from "./component/MyProfile"; +import ScrollTop from "./component/ScrollTop"; +import EditProfile from "./component/EditProfile"; +import Contributers from "./component/Contributers"; +import Discussion from "./component/Discussion"; +import { useAtom } from "jotai"; +import { modeAtom } from "./atom/Atom"; +import ForgotPassword from "./component/forgotpass"; +import VerifyEmail from "./component/Verify"; +import NotFound from "./component/NotFound"; +import AnimatedCursor from "react-animated-cursor"; + // Main Layout Component const Layout = ({ children, mode, setProgress, toggleMode, showAlert }) => { const location = useLocation(); // Use location inside Router - + // Define routes where the footer or navbar should not be shown - const hideNavbarRoutes = ['/login', '/signup']; - const hideFooterRoutes = ['/login', '/signup']; + const hideNavbarRoutes = ["/login", "/signup"]; + const hideFooterRoutes = ["/login", "/signup"]; return ( <> {/* Conditionally render the Navbar */} - {!hideNavbarRoutes.includes(location.pathname) && ( - - )} + {!hideNavbarRoutes.includes(location.pathname) && } {/* Main content */} {children} {/* Conditionally render the Footer */} {!hideFooterRoutes.includes(location.pathname) && ( -