refactor: implement smart navigation for "Get Mycelium Connector" button with smooth scroll utility

- Added smoothScrollToElement utility function in src/utils/scroll.ts with easeInOutQuad animation and configurable duration
- Changed Header and HeaderDark "Get Mycelium Connector" button from static /download link to onClick handler with conditional navigation
- Added handleGetConnectorClick function that scrolls to #download section when on /network page, otherwise navigates to /network
- Change
This commit is contained in:
2025-11-24 14:13:40 +01:00
parent a22a8ddcc9
commit 6b4c7b3329
6 changed files with 95 additions and 16 deletions

View File

@@ -2,6 +2,7 @@
import { Button } from '@/components/Button'
import { Eyebrow, H3, P } from '@/components/Texts'
import { smoothScrollToElement } from '@/utils/scroll'
export function NodeHero() {
return (
@@ -31,12 +32,7 @@ export function NodeHero() {
<Button
variant="solid"
color="cyan"
onClick={() => {
const el = document.getElementById('node-how-it-works')
if (el) {
el.scrollIntoView({ behavior: 'smooth', block: 'start' })
}
}}
onClick={() => smoothScrollToElement('node-how-it-works', 1200)}
>
How it works
</Button>