diff --git a/src/components/contact/ContactComponent.astro b/src/components/contact/ContactComponent.astro index 5ef84bd..72c9dc3 100644 --- a/src/components/contact/ContactComponent.astro +++ b/src/components/contact/ContactComponent.astro @@ -8,7 +8,7 @@ import { AnimatedTooltip } from "@/components/ui/AnimatedToolTip"; class="relative flex w-full flex-col-reverse items-center justify-start gap-10 lg:h-[400px] lg:flex-row lg:items-start lg:justify-center" >
rythondev@gmail.comSend me a Message
diff --git a/src/components/ui/DesktopNav.tsx b/src/components/ui/DesktopNav.tsx deleted file mode 100644 index 7fa3a5e..0000000 --- a/src/components/ui/DesktopNav.tsx +++ /dev/null @@ -1,221 +0,0 @@ -// retractable navigation -// do not retract if it's on contact page - -// mobile: display hamburger + available for work - -import { cn } from "@/lib/utils"; -import { - AnimatePresence, - motion, - useScroll, - useMotionValueEvent, -} from "motion/react"; -import { Cross as HamburgerCross } from "hamburger-react"; -import { useEffect, useState } from "react"; -import pfp from "@/components/images/contact_photo_small.webp"; - -function getWindowDimensions() { - const { innerWidth: width, innerHeight: height } = window; - return { - width, - height, - }; -} - -function useWindowDimensions() { - const hasWindow = typeof window !== "undefined"; - - function getWindowDimensions() { - const width = hasWindow ? window.innerWidth : 0; - const height = hasWindow ? window.innerHeight : 0; - return { - width, - height, - }; - } - - const [windowDimensions, setWindowDimensions] = useState( - getWindowDimensions(), - ); - - useEffect(() => { - if (hasWindow) { - function handleResize() { - setWindowDimensions(getWindowDimensions()); - } - - window.addEventListener("resize", handleResize); - return () => window.removeEventListener("resize", handleResize); - } - }, [hasWindow]); - - return windowDimensions; -} - -export const HoverNavigation = ({ - items, - className, -}: { - items: { - label: string; - link: string; - }[]; - className?: string; -}) => { - const [hoveredIndex, setHoveredIndex] = useState(null); - const { scrollYProgress } = useScroll(); - const [visible, setVisible] = useState(true); - const [navVisible, setNavVisible] = useState(false); - const [availableVisible, setAvailableVisible] = useState(false); - const [onContactPage, setOnContactPage] = useState(false); - const [hamburgerOpen, setHamburgerOpen] = useState(false); - const { width } = useWindowDimensions(); - - // if on contact page, do not do width 0% - useEffect(() => { - setOnContactPage(window.location.href.endsWith("/contact")); - }, []); - - useEffect(() => { - updateNavBarState(width); - }, [width]); - - const updateNavBarState = ( - width: number, - scrollProgress: number = 0, - scrollUp: boolean = false, - ) => { - if (width && width < 1024) { - setNavVisible(false); - setAvailableVisible(true); - } else if (scrollProgress < 0.05) { - setNavVisible(true); - setAvailableVisible(false); - } else if (!onContactPage) { - setNavVisible(scrollUp); - setAvailableVisible(!scrollUp); - } else { - setNavVisible(true); - setAvailableVisible(false); - } - }; - - useMotionValueEvent(scrollYProgress, "change", (current) => { - // Check if current is not undefined and is a number - if (typeof current === "number") { - let direction = current! - scrollYProgress.getPrevious()!; - let scrollUp = direction <= 0; - let scrollProgress = scrollYProgress.get(); - - updateNavBarState(width, scrollProgress, scrollUp); - } - }); - - return ( - <> - Ryan - - - Available for work - -
-
-
-
-
- - {items.map((item, idx) => ( - setHoveredIndex(idx)} - onMouseLeave={() => setHoveredIndex(null)} - > - - {hoveredIndex === idx && ( - - )} - - {item.label} - - ))} - - -
- -
- - ); -}; - -export const NavBarLink = ({ - className, - children, -}: { - className?: string; - children: React.ReactNode; -}) => { - return ( -
- {children} -
- ); -}; diff --git a/src/components/ui/MobileNav.tsx b/src/components/ui/MobileNav.tsx deleted file mode 100644 index e69de29..0000000