bilden
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
887f53a09a
commit
8277de849c
|
@ -21,17 +21,27 @@ title: Start
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.addEventListener('scroll', () => {
|
function toggleMenuVisibility() {
|
||||||
const header = document.querySelector('.md-header');
|
const content = document.getElementById("main-content");
|
||||||
const tabs = document.querySelector('.md-tabs');
|
const header = document.querySelector(".md-header");
|
||||||
if (window.scrollY > window.innerHeight * 0.8) {
|
const sidebar = document.querySelector(".md-sidebar");
|
||||||
header.style.transform = "translateY(0)";
|
const contentTop = content.getBoundingClientRect().top;
|
||||||
if (tabs) tabs.style.transform = "translateY(0)";
|
|
||||||
|
if (contentTop <= 0) {
|
||||||
|
header.style.opacity = "1";
|
||||||
|
sidebar.style.opacity = "1";
|
||||||
|
header.style.pointerEvents = "auto";
|
||||||
|
sidebar.style.pointerEvents = "auto";
|
||||||
} else {
|
} else {
|
||||||
header.style.transform = "translateY(-100%)";
|
header.style.opacity = "0";
|
||||||
if (tabs) tabs.style.transform = "translateY(-100%)";
|
sidebar.style.opacity = "0";
|
||||||
|
header.style.pointerEvents = "none";
|
||||||
|
sidebar.style.pointerEvents = "none";
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
|
window.addEventListener("scroll", toggleMenuVisibility);
|
||||||
|
window.addEventListener("load", toggleMenuVisibility);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Bakgrundsbild med filter -->
|
<!-- Bakgrundsbild med filter -->
|
||||||
|
|
Loading…
Reference in New Issue