diff --git a/frontend/src/components/Navbar.jsx b/frontend/src/components/Navbar.jsx index 295e23ec..fa26baaa 100644 --- a/frontend/src/components/Navbar.jsx +++ b/frontend/src/components/Navbar.jsx @@ -1,6 +1,8 @@ import { useState, useEffect, useRef } from "react"; import { useNavigate, useLocation, Link } from "react-router-dom"; import ProfileInfo from "./Cards/ProfileInfo"; + +import { useNavigate, useLocation, Link } from "react-router-dom"; import SearchBar from "./SearchBar/SearchBar"; import { toast } from "react-hot-toast"; import gsap from "gsap/all"; @@ -26,6 +28,19 @@ const Navbar = ({ userInfo, onSearchNote, handleClearSearch }) => { }; useEffect(() => { + + // GSAP animations + gsap.fromTo(logoRef.current, { y: -20, opacity: 0, scale: 0.8 }, { duration: 1, y: 0, opacity: 1, scale: 1, ease: "power3.out" }); + gsap.fromTo(searchBarRef.current, { x: 50, opacity: 0 }, { duration: 1, x: 0, opacity: 1, ease: "power3.out", delay: 0.5 }); + gsap.fromTo(profileRef.current, { opacity: 0, scale: 0.8 }, { duration: 1, opacity: 1, scale: 1, ease: "power3.out", delay: 1 }); + + // Animating login/signup buttons + if (loginButtonRef.current) { + gsap.fromTo(loginButtonRef.current, { opacity: 0, y: 20 }, { duration: 1, opacity: 1, y: 0, ease: "bounce.out", delay: 1.7 }); + } + if (signupButtonRef.current) { + gsap.fromTo(signupButtonRef.current, { opacity: 0, y: 20 }, { duration: 1, opacity: 1, y: 0, ease: "bounce.out", delay: 1.5 }); + // Animate logo gsap.fromTo( logoRef.current, @@ -63,6 +78,7 @@ const Navbar = ({ userInfo, onSearchNote, handleClearSearch }) => { { opacity: 0, y: 20 }, { duration: 1, opacity: 1, y: 0, ease: "bounce.out", delay: 1.5 } ); + } }, []); @@ -94,6 +110,40 @@ const Navbar = ({ userInfo, onSearchNote, handleClearSearch }) => { console.log(location.pathname); return ( + +
+
+ {/* Logo */} + +
+ logo +

+ cribbie +

+
+ + + + + {/* Tabs */} + + + {/* Search bar (hidden on specific paths) */} + {userInfo && !hideSearchBarPaths.includes(location.pathname) && ( +
+ { + setSearchQuery(target.value); + onSearchNote(target.value); + }} + onClearSearch={onClearSearch} + /> +
+ )} + + {/* Profile or Signup/Login */} +
{ )} + {userInfo ? (
) : ( + + location.pathname !== "/login" && location.pathname !== "/signup" && ( +
+ + +
+ ) + )} +
+ <> {location.pathname !== "/login" && (
{/* Theme toggle button */} + ); }; diff --git a/frontend/src/components/Tabs.jsx b/frontend/src/components/Tabs.jsx index c30ec160..a92a9c68 100644 --- a/frontend/src/components/Tabs.jsx +++ b/frontend/src/components/Tabs.jsx @@ -5,8 +5,13 @@ import { Link, useLocation } from "react-router-dom"; // Accept theme as a prop in SlideTabsExample export const SlideTabsExample = ({ theme }) => { return ( + +
+ +
+
); }; @@ -30,6 +35,35 @@ const SlideTabs = ({ theme }) => { })); setHoveredTab(null); }} + + className="relative mx-auto b flex w-fit bg-white p-1" + > + + Home + + + Dashboard + + + className={`relative mx-auto flex w-fit p-1 ${ theme === "dark" ? "bg-black" : "bg-white" }`} @@ -38,6 +72,7 @@ const SlideTabs = ({ theme }) => { Home + About diff --git a/frontend/src/pages/Login/Login.jsx b/frontend/src/pages/Login/Login.jsx index 14314b83..6809b199 100644 --- a/frontend/src/pages/Login/Login.jsx +++ b/frontend/src/pages/Login/Login.jsx @@ -167,10 +167,6 @@ const Login = ({ setUser }) => { return (
-
- -
-
diff --git a/frontend/src/pages/Signup/Signup.jsx b/frontend/src/pages/Signup/Signup.jsx index fb59c27c..c0601dd1 100644 --- a/frontend/src/pages/Signup/Signup.jsx +++ b/frontend/src/pages/Signup/Signup.jsx @@ -219,9 +219,7 @@ const Signup = () => { return (
-
- -
+