refactor: update navigation and section IDs with smoother scroll behavior

This commit is contained in:
2025-10-14 12:56:44 +02:00
parent 2288a2b113
commit 6e9360fabf
5 changed files with 15 additions and 7 deletions

View File

@@ -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) => (
<Link
@@ -28,7 +28,15 @@ export function NavLinks() {
onMouseLeave={() => {
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' })
}
}}
>
<AnimatePresence>