'use client' import React, { useEffect, useState } from 'react'; import { motion } from 'framer-motion'; import { FaBriefcase, FaUser, FaFileAlt } from 'react-icons/fa'; import { GoHomeFill } from "react-icons/go"; import Link from 'next/link'; import { Inter } from 'next/font/google'; const inter = Inter({ subsets: ["latin"], weight: "500" }); function TubeLightNavbar() { const [activeTab, setActiveTab] = useState('Home'); const [isMobile, setIsMobile] = useState(false); const tabs = [ { name: 'Home', url: '#', icon: }, { name: 'About', url: '#', icon: }, { name: 'Projects', url: '#', icon: }, { name: 'Resume', url: '#', icon: } ]; useEffect(() => { const handleResize = () => { setIsMobile(window.innerWidth < 768); }; handleResize(); window.addEventListener('resize', handleResize); return () => { window.removeEventListener('resize', handleResize); }; }, []); const getLeftPosition = (tabName:string) => { // Adjust the positioning of the lamp according to your content if (isMobile) { // Mobile view switch (tabName) { case 'Home': return 'calc(0% + 16px)'; case 'About': return 'calc(23% + 2px)'; case 'Projects': return 'calc(22% + 2px)'; case 'Resume': return 'calc(22% + 2px)'; } } else { // Desktop view switch (tabName) { case 'Home': return 'calc(0% + 44px)'; case 'About': return 'calc(30% + 2px)'; case 'Projects': return 'calc(32% + 2px)'; case 'Resume': return 'calc(32% + 2px)'; } } }; return (
{tabs.map((tab) => ( setActiveTab(tab.name)} className={`relative cursor-pointer text-sm text-white px-6 py-2 rounded-full ${ activeTab === tab.name ? 'bg-zinc-500' : '' }`} style={{ backdropFilter: 'blur(10px)', backgroundColor: activeTab === tab.name ? 'rgba(255, 255, 255, 0.2)' : 'transparent' }} > {tab.name} {tab.icon} {activeTab === tab.name && ( {/* Lamp elements */} )} ))}
); } export default TubeLightNavbar;