✨ feat: enhance HeroBlock with SPA navigation for anchor links and update feature card styles
This commit is contained in:
@@ -173,6 +173,16 @@ export const spaLink = (node: HTMLAnchorElement, options: SpaNavigateOptions = {
|
||||
return
|
||||
}
|
||||
|
||||
// Handle anchor links: scroll to element instead of SPA navigation
|
||||
if (href.startsWith("#")) {
|
||||
event.preventDefault()
|
||||
const target = document.getElementById(href.slice(1))
|
||||
if (target) {
|
||||
target.scrollIntoView({ behavior: "smooth" })
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Skip if target is set (e.g., _blank)
|
||||
if (node.target && node.target !== "_self") {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user