Compare commits
2 commits
93ffa4a316
...
bff59baa04
| Author | SHA1 | Date | |
|---|---|---|---|
|
bff59baa04 |
|||
|
8936dc45be |
2 changed files with 10 additions and 6 deletions
|
|
@ -24,11 +24,10 @@ const sections: Array<Page> = [
|
||||||
|
|
||||||
<script is:inline define:vars={{ sections }}>
|
<script is:inline define:vars={{ sections }}>
|
||||||
document.addEventListener("scroll", () =>
|
document.addEventListener("scroll", () =>
|
||||||
sections.forEach(
|
sections.forEach(({ id }) => {
|
||||||
({ id }) =>
|
const rect = document.getElementById(id).getBoundingClientRect()
|
||||||
document.getElementById(id).getBoundingClientRect().bottom <
|
if (rect.bottom < window.innerHeight || rect.top < 200)
|
||||||
window.innerHeight &&
|
document.querySelector("mdui-navigation-bar").value = id
|
||||||
(document.querySelector("mdui-navigation-bar").value = id)
|
})
|
||||||
)
|
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ mdui-card {
|
||||||
main > * > section {
|
main > * > section {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
scroll-margin-top: 1em;
|
||||||
|
|
||||||
& div,
|
& div,
|
||||||
mdui-card {
|
mdui-card {
|
||||||
|
|
@ -116,4 +117,8 @@ main > * > section {
|
||||||
min-width: 300px;
|
min-width: 300px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1500px) {
|
||||||
|
scroll-margin-top: 5em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue