diff --git a/frontend/src/components/Layout/Navbar.tsx b/frontend/src/components/Layout/Navbar.tsx index ed85efe..71ad8a0 100644 --- a/frontend/src/components/Layout/Navbar.tsx +++ b/frontend/src/components/Layout/Navbar.tsx @@ -73,17 +73,22 @@ const Navbar: React.FC = ({ {isLoggedIn && ( <> - - {showSideBar && } +
+ +
)} diff --git a/frontend/src/components/Layout/Sidebar.tsx b/frontend/src/components/Layout/Sidebar.tsx index 01a26a6..f7dd449 100644 --- a/frontend/src/components/Layout/Sidebar.tsx +++ b/frontend/src/components/Layout/Sidebar.tsx @@ -1,16 +1,16 @@ import React, { useEffect, useState } from "react"; +import { SunMoon as SunMoonIcon} from "lucide-react" import Theme from "./Theme"; import "../../assets/styles/sidebar.css" interface SideBarProps { extraClasses?: string; - scrollActiveSideBar: boolean; } -const Sidebar: React.FC = ( {scrollActiveSideBar}) => { +const Sidebar: React.FC = () => { const [thisTheme, setThisTheme] = useState(false); const [isCursorOnSidebar, setIsCursorOnSidebar] = useState(false); - + const [triggerAnimation, setTriggerAnimation] = useState(false); useEffect(() => { const sideBarScroll = () => { document.body.style.overflow = isCursorOnSidebar ? "hidden" : "unset"; @@ -23,17 +23,21 @@ const Sidebar: React.FC = ( {scrollActiveSideBar}) => { }, [isCursorOnSidebar]); const handleTheme = () => { - setThisTheme(!thisTheme); - } + setThisTheme(!thisTheme); + setTriggerAnimation(false); // Reset animation + setTimeout(() => setTriggerAnimation(true), 0); // Re-trigger animation + }; - return ); }; export default Sidebar; diff --git a/frontend/src/components/Layout/Theme.tsx b/frontend/src/components/Layout/Theme.tsx index c792f96..510c538 100644 --- a/frontend/src/components/Layout/Theme.tsx +++ b/frontend/src/components/Layout/Theme.tsx @@ -1,18 +1,22 @@ -import React from 'react' +import React from 'react'; +import { SunMoon as SunMoonIcon } from 'lucide-react'; interface ThemeProps { - children? : React.ReactNode; - onClick : () => void; + children?: React.ReactNode; + onClick: () => void; } -const Theme: React.FC = ( {onClick, children} ) => { +const Theme: React.FC = ({ onClick }) => { return ( - - ) -} + ); +}; -export default Theme +export default Theme; diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index cb09d7c..e6f6959 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -13,7 +13,8 @@ export default { moving_text_colour: "moving_text_colour 6s ease-in-out infinite alternate", moving_bg: 'moving_bg 200s linear infinite', 'border-spin': 'border-spin linear infinite', - floating: "floating 30s linear infinite" + floating: "floating 30s linear infinite", + burnIn: 'burnIn 1s ease-out', }, @@ -48,6 +49,12 @@ export default { '80%': { transform: 'translate(10px, -7px) rotateX(-2.5deg) rotateY(1.5deg)' }, /* Top-right tilt */ '100%': { transform: 'translate(0px, -5px) rotateX(0deg) rotateY(0deg)' }, }, + + burnIn: { + '0%' : { opacity: '0'}, + '50%' : { opacity: '0.8'}, + '100%' : { opacity: '1'}, + }, }, }, plugins: [