Portfolio/src/composables/scrollToSection.ts
Matthew L McPeak f03f34f12e
Some checks failed
ci / build (push) Successful in 38s
ci / publish (push) Failing after 8s
Initial Portfolio (#1)
Reviewed-on: #1
Co-authored-by: Matthew L McPeak <m.mcpeak98@icloud.com>
Co-committed-by: Matthew L McPeak <m.mcpeak98@icloud.com>
2026-06-11 16:21:00 -04:00

6 lines
221 B
TypeScript

export function scrollToSection(id: string) {
const el = document.getElementById(id)
if (!el) return
const top = el.getBoundingClientRect().top + window.scrollY - 68
window.scrollTo({ top, behavior: 'smooth' })
}