import { useState, useEffect } from 'react' import { motion, AnimatePresence } from 'framer-motion' import { FiSun, FiMoon, FiX, FiTerminal } from 'react-icons/fi' import { useScrollSpy } from '../hooks/useScrollSpy' import resumePDF from '../assets/Resume.pdf' const NAV_LINKS = [ { id: 'about', label: 'About' }, { id: 'skills', label: 'Skills' }, { id: 'experience', label: 'Experience' }, { id: 'publications', label: 'Publications' }, { id: 'projects', label: 'Projects' }, { id: 'education', label: 'Education' }, { id: 'blog', label: 'Blog' }, { id: 'contact', label: 'Contact' }, ] export default function Navbar({ theme, setTheme }) { const [scrolled, setScrolled] = useState(false) const [mobileOpen, setMobileOpen] = useState(false) const activeId = useScrollSpy(NAV_LINKS.map(l => l.id)) useEffect(() => { const fn = () => setScrolled(window.scrollY > 40) window.addEventListener('scroll', fn, { passive: true }) return () => window.removeEventListener('scroll', fn) }, []) const scrollTo = (id) => { document.getElementById(id)?.scrollIntoView({ behavior: 'smooth' }) setMobileOpen(false) } return ( <>
window.scrollTo({ top: 0, behavior: 'smooth' })} whileHover={{ scale: 1.04 }}> Parthib Karak.
Resume ↓
{mobileOpen && ( {NAV_LINKS.map((link, i) => ( { e.preventDefault(); scrollTo(link.id) }}> {link.label} ))} )} ) }