From 6e9360fabf1645736aa0f93a2b7260c6cab2eb96 Mon Sep 17 00:00:00 2001 From: sasha-astiadi Date: Tue, 14 Oct 2025 12:56:44 +0200 Subject: [PATCH] refactor: update navigation and section IDs with smoother scroll behavior --- src/components/AnimatedSection.tsx | 2 +- src/components/Benefits.tsx | 2 +- src/components/NavLinks.tsx | 14 +++++++++++--- src/components/PrimaryFeatures.tsx | 2 +- src/components/SecondaryFeatures.tsx | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/components/AnimatedSection.tsx b/src/components/AnimatedSection.tsx index a1402e0..ceb4684 100644 --- a/src/components/AnimatedSection.tsx +++ b/src/components/AnimatedSection.tsx @@ -5,7 +5,7 @@ import { motion, useInView } from 'framer-motion' export function AnimatedSection({ children }: { children: React.ReactNode }) { const ref = useRef(null) - const isInView = useInView(ref, { once: false, margin: '-50% 0px -50% 0px' }) + const isInView = useInView(ref, { once: true, margin: '-20% 0px -20% 0px' }) return ( +

diff --git a/src/components/NavLinks.tsx b/src/components/NavLinks.tsx index d89909e..d4c9f76 100644 --- a/src/components/NavLinks.tsx +++ b/src/components/NavLinks.tsx @@ -10,9 +10,9 @@ export function NavLinks() { return [ ['About', '/#about'], - ['Benefits', '/#benefits'], ['Features', '/#features'], - ['Use Cases', '/#usecases'], + ['How it Works', '/#howitworks'], + ['Coming Soon', '/#comingsoon'], ['FAQs', '/#faqs'], ].map(([label, href], index) => ( { timeoutRef.current = window.setTimeout(() => { setHoveredIndex(null) - }, 200) + }, 50) + }} + onClick={(e) => { + e.preventDefault() + const targetId = href.substring(2) + const targetElement = document.getElementById(targetId) + if (targetElement) { + targetElement.scrollIntoView({ behavior: 'smooth' }) + } }} > diff --git a/src/components/PrimaryFeatures.tsx b/src/components/PrimaryFeatures.tsx index d34033e..ff7c51a 100644 --- a/src/components/PrimaryFeatures.tsx +++ b/src/components/PrimaryFeatures.tsx @@ -570,7 +570,7 @@ function FeaturesMobile() { export function PrimaryFeatures() { return (
diff --git a/src/components/SecondaryFeatures.tsx b/src/components/SecondaryFeatures.tsx index dbfdfbb..2c31ed9 100644 --- a/src/components/SecondaryFeatures.tsx +++ b/src/components/SecondaryFeatures.tsx @@ -189,7 +189,7 @@ function DeviceChartIcon(props: React.ComponentPropsWithoutRef<'svg'>) { export function SecondaryFeatures() { return (