forked from emre/www_projectmycelium_com
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user