diff --git a/apps/web/app/(landing)/Hero.tsx b/apps/web/app/(landing)/Hero.tsx index d571cc26..3fe3a3b7 100644 --- a/apps/web/app/(landing)/Hero.tsx +++ b/apps/web/app/(landing)/Hero.tsx @@ -4,6 +4,7 @@ import { motion } from "framer-motion"; import { Twitter } from "@repo/ui/src/components/icons"; import EmailInput from "./EmailInput"; import LinkArrow from "./linkArrow"; +import { TwitterBorder } from "./twitterLink"; const slap = { initial: { @@ -22,18 +23,7 @@ function Hero() { return ( <>
- - -
- {" "} - Follow us on Twitter{" "} - -
-
+
Supermemory logo @@ -30,8 +39,45 @@ function Navbar() {
- ); } -export default Navbar; +export const Navbar = () => { + const { scrollYProgress } = useScroll(); + + const [visible, setVisible] = useState(true); + + useMotionValueEvent(scrollYProgress, "change", (current) => { + // Check if current is not undefined and is a number + if (typeof current === "number") { + let direction = current! - scrollYProgress.getPrevious()!; + if (direction < 0) { + setVisible(true); + } else { + setVisible(false); + } + } + }); + + return ( + + + + + + ); +}; + diff --git a/apps/web/app/(landing)/linkArrow.tsx b/apps/web/app/(landing)/linkArrow.tsx index def37e91..01343231 100644 --- a/apps/web/app/(landing)/linkArrow.tsx +++ b/apps/web/app/(landing)/linkArrow.tsx @@ -1,9 +1,10 @@ import React from "react"; -function LinkArrow({ classname }: { classname?: string }) { +function LinkArrow({ classname, stroke }: { classname?: string, stroke? : string}) { return ( + + +
+ {" "} + Follow us on Twitter{" "} + +
+ + + ); +} + +type Direction = "TOP" | "LEFT" | "BOTTOM" | "RIGHT"; + +export function HoverBorderGradient({ + children, + containerClassName, + className, + as: Tag = "button", + duration = 1, + clockwise = true, + ...props +}: React.PropsWithChildren< + { + as?: React.ElementType; + containerClassName?: string; + className?: string; + duration?: number; + clockwise?: boolean; + } & React.HTMLAttributes +>) { + const [hovered, setHovered] = useState(false); + const [direction, setDirection] = useState("TOP"); + + const rotateDirection = (currentDirection: Direction): Direction => { + const directions: Direction[] = ["TOP", "LEFT", "BOTTOM", "RIGHT"]; + const currentIndex = directions.indexOf(currentDirection); + const nextIndex = clockwise + ? (currentIndex - 1 + directions.length) % directions.length + : (currentIndex + 1) % directions.length; + return directions[nextIndex]; + }; + + const movingMap: Record = { + TOP: "radial-gradient(20.7% 50% at 50% 0%, hsl(0, 0%, 100%) 0%, rgba(255, 255, 255, 0) 100%)", + LEFT: "radial-gradient(16.6% 43.1% at 0% 50%, hsl(0, 0%, 100%) 0%, rgba(255, 255, 255, 0) 100%)", + BOTTOM: + "radial-gradient(20.7% 50% at 50% 100%, hsl(0, 0%, 100%) 0%, rgba(255, 255, 255, 0) 100%)", + RIGHT: + "radial-gradient(16.2% 41.199999999999996% at 100% 50%, hsl(0, 0%, 100%) 0%, rgba(255, 255, 255, 0) 100%)", + }; + + const highlight = + "radial-gradient(75% 181.15942028985506% at 50% 50%, #3275F8 0%, rgba(255, 255, 255, 0) 100%)"; + useEffect(() => { + if (!hovered) { + const interval = setInterval(() => { + setDirection((prevState) => rotateDirection(prevState)); + }, duration * 1000); + return () => clearInterval(interval); + } + }, [hovered]); + return ( + ) => { + setHovered(true); + }} + onMouseLeave={() => setHovered(false)} + className={cn( + "relative h-min w-fit transition duration-500 group/anchor flex items-center justify-center gap-4 rounded-full text-white/80 bg-white/5 text-sm", + containerClassName, + )} + {...props} + > +
+ {children} +
+ +
+ + ); +} diff --git a/apps/web/app/globals.css b/apps/web/app/globals.css index b1902464..429e17ba 100644 --- a/apps/web/app/globals.css +++ b/apps/web/app/globals.css @@ -2,6 +2,30 @@ @tailwind components; @tailwind utilities; +html { + scroll-behavior: smooth; +} + +/* width */ +::-webkit-scrollbar { + width: 8px; +} + +/* Track */ +::-webkit-scrollbar-track { + background: transparent; +} + +/* Handle */ +::-webkit-scrollbar-thumb { + background: #131F2C; +} + +/* Handle on hover */ +::-webkit-scrollbar-thumb:hover { + background: #22303d; +} + /* :root { --foreground-rgb: 0, 0, 0; --background-start-rgb: 214, 219, 220; diff --git a/package.json b/package.json index d169b935..fd955db4 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "@cloudflare/next-on-pages": "1", "@cloudflare/workers-types": "^4.20240512.0", "@repo/eslint-config": "*", - "@repo/shared-types": "*", +"@repo/shared-types": "*", "@repo/tailwind-config": "*", "@repo/typescript-config": "*", "@repo/ui": "*", @@ -51,6 +51,7 @@ "@hookform/resolvers": "^3.4.2", "@iarna/toml": "^2.2.5", "@langchain/cloudflare": "^0.0.6", + "@million/lint": "^1.0.0-rc.18", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-progress": "^1.0.3",