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