import { m, Variants } from "framer-motion";
import { useRouter } from "next/router";
import Link from "next/link";
import { useState } from "react";
interface NavBarProps {
initialPage: string;
}
function NavBar(props: NavBarProps) {
const [activePage, setActivePage] = useState(props.initialPage);
const ActiveLink = (props: {
href: string;
pageName: string;
children: React.ReactNode;
}) => {
const router = useRouter();
let styling = "text-white";
if (activePage === props.pageName) {
styling = "text-[#a855f7]";
}
return (
{props.children}
);
};
return (
{
setActivePage("dashboard");
}}
>
{
setActivePage("ranking");
}}
>
{
setActivePage("wiki");
}}
>
);
}
const NavSvgWrap = (props: { children: React.ReactNode }) => {
return (
{props.children}
);
};
const DashIcon = () => {
return (
);
};
const ExitIcon = () => {
return (
);
};
const RankingIcon = () => {
return (
);
};
const WikiIcon = () => {
return (
);
};
const navContainerVariants: Variants = {
initial: {
opacity: 0,
x: -100,
},
animate: {
opacity: 1,
x: 0,
transition: {
delay: 0.5,
duration: 1.0,
type: "spring",
bounce: 0.5,
stiffness: 80,
delayChildren: 1.25,
staggerChildren: 0.25,
},
},
};
const navStripVariants: Variants = {
initial: {
opacity: 0,
y: 40,
},
animate: {
opacity: 1,
y: 0,
transition: {
duration: 1.0,
type: "spring",
bounce: 0.5,
stiffness: 80,
staggerChildren: 0.25,
delayChildren: 0.1,
},
},
};
const navIconVariants: Variants = {
initial: {
opacity: 0,
},
animate: {
opacity: 1,
transition: {
duration: 1.0,
type: "spring",
bounce: 0.5,
stiffness: 80,
},
},
};
export default NavBar;