Working bottom bar
This commit is contained in:
parent
0ebcba97a8
commit
dfb5f54c84
2 changed files with 683 additions and 2 deletions
|
|
@ -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>
|
||||
|
|
|
|||
13
src/components/ButtonLink.astro
Normal file
13
src/components/ButtonLink.astro
Normal 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>
|
||||
Loading…
Reference in a new issue