blur content when the menu is open

This commit is contained in:
Daniel Schön
2020-05-22 13:28:30 +02:00
parent 5547352ff2
commit 7ed89b8b4f
6 changed files with 36 additions and 8 deletions

View File

@@ -32,4 +32,16 @@
}
}
}
// Blur content when the menu is open
const checkbox = document.getElementById("menu-trigger");
const wrapper = document.getElementById("wrapper");
checkbox.addEventListener("change", function() {
if (this.checked) {
wrapper.classList.add("trigger-wrapper");
} else {
wrapper.classList.remove("trigger-wrapper");
}
});
})();