Working bottom bar

This commit is contained in:
Henry Hiles 2025-03-30 12:34:12 -04:00
commit dfb5f54c84
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
2 changed files with 683 additions and 2 deletions

View file

@ -21,3 +21,14 @@ const sections: Array<Page> = [
))
}
</mdui-navigation-bar>
<script is:inline define:vars={{ sections }}>
document.addEventListener("scroll", () =>
sections.forEach(
({ id }) =>
document.getElementById(id).getBoundingClientRect().bottom <
window.innerHeight &&
(document.querySelector("mdui-navigation-bar").value = id)
)
)
</script>

View file

@ -0,0 +1,13 @@
---
import "../styles/button.css"
interface Props {
href: string
}
const { href } = Astro.props
---
<a href={href} class="button-link">
<slot />
</a>