From d7fcd8ca7233892b08a0850a83ed09eac675088d Mon Sep 17 00:00:00 2001 From: kudinDmitriyUp Date: Mon, 22 Jun 2026 11:35:46 +0000 Subject: [PATCH] Bob AI: Replaced navigation bar with a tabbed navigation layout --- src/components/Layout.tsx | 70 ++++++++++++++++++++++++++++++++++----- 1 file changed, 61 insertions(+), 9 deletions(-) diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index ebe0ae6..41343ca 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -1,11 +1,14 @@ import FooterSimpleCard from '@/components/sections/footer/FooterSimpleCard'; -import NavbarFloatingLogo from '@/components/ui/NavbarFloatingLogo'; import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; import SiteBackgroundSlot from "@/components/ui/SiteBackgroundSlot"; import { Outlet } from 'react-router-dom'; import { StyleProvider } from "@/components/ui/StyleProvider"; +import { useState, useEffect } from 'react'; +import { motion } from 'motion/react'; export default function Layout() { + const [activeTab, setActiveTab] = useState("hero"); + const navItems = [ { "name": "Home", @@ -41,18 +44,67 @@ export default function Layout() { } ]; + useEffect(() => { + const handleScroll = () => { + const sections = navItems.map(item => item.href.slice(1)); + let current = "hero"; + for (const section of sections) { + const el = document.getElementById(section); + if (el && window.scrollY >= el.offsetTop - 200) { + current = section; + } + } + setActiveTab(current); + }; + window.addEventListener("scroll", handleScroll); + return () => window.removeEventListener("scroll", handleScroll); + }, []); + return ( - +
+ Logo +
+ {navItems.map(item => ( + + ))} +
+
+ +
+ Logo +
+ {navItems.map(item => ( + + ))} +
+
-- 2.49.1