diff --git a/src/components/FabButton.tsx b/src/components/FabButton.tsx index 34c5f874..6d9ebf10 100644 --- a/src/components/FabButton.tsx +++ b/src/components/FabButton.tsx @@ -1,65 +1,54 @@ -import { Fab, Action } from "react-tiny-fab"; -import { MdExplore } from "react-icons/md"; -import { FaCircleQuestion } from "react-icons/fa6"; -import tour from "../components/Tour"; +import { useEffect, useState } from "react"; +import { ArrowDownOutlined } from "@ant-design/icons"; const FloatingFAB = () => { - const startTourEvent = () => { - void tour.start(); + const [isVisible, setIsVisible] = useState(false); + + // Function to scroll smoothly to the footer + const scrollToFooter = () => { + const footer = document.getElementById("footer"); // Ensure footer has this ID in your HTML + if (footer) { + footer.scrollIntoView({ behavior: "smooth" }); + } }; + // Show the button only when the user scrolls up + useEffect(() => { + const handleScroll = () => { + setIsVisible(window.scrollY < window.innerHeight * 0.2); + }; + + window.addEventListener("scroll", handleScroll); + return () => window.removeEventListener("scroll", handleScroll); + }, []); + return ( - } - alwaysShowTitle - mainButtonStyles={{ - backgroundColor: "#1B2540", - color: "white", - width: "50px", - height: "50px", - boxShadow: "0px 6px 10px rgba(0, 0, 0, 0.25)", - borderRadius: "50%", - transition: "all 0.3s ease-in-out", - display: "flex", - justifyContent: "center", - alignItems: "center", - fontSize: "24px", - }} - style={{ - position: "fixed", - bottom: "20px", - right: "20px", - zIndex: 1000, - marginBottom: "2.813rem", - marginRight: "0.625rem" - }} - > - - (e.currentTarget.style.transform = "scale(1.1)") - } - onMouseLeave={(e) => - (e.currentTarget.style.transform = "scale(1)") - } + aria-label="Scroll to footer" > - - - + + + ) ); }; diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 881391ea..cbf9bc17 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -9,14 +9,16 @@ import { InfoOutlined, BookOutlined, CaretDownFilled, + PlayCircleOutlined, } from "@ant-design/icons"; import ToggleDarkMode from "./ToggleDarkMode"; +import tour from "../components/Tour"; const { useBreakpoint } = Grid; -function Navbar({ scrollToFooter }: { scrollToFooter: any }) { +function Navbar({ }: { scrollToFooter: any }) { const [hovered, setHovered] = useState< - null | "home" | "explore" | "help" | "github" | "join" + null | "home" | "help" | "github" | "join" >(null); const screens = useBreakpoint(); const location = useLocation(); @@ -31,6 +33,10 @@ function Navbar({ scrollToFooter }: { scrollToFooter: any }) { config: { duration: 1000 }, }); + const startTour = () => { + void tour.start(); + }; + const helpMenu = ( @@ -72,6 +78,10 @@ function Navbar({ scrollToFooter }: { scrollToFooter: any }) { Documentation + + + Start Tour + ); @@ -129,17 +139,6 @@ function Navbar({ scrollToFooter }: { scrollToFooter: any }) { {screens.md && ( <> -
setHovered("explore")} - onMouseLeave={() => setHovered(null)} - > - Explore -