website: initial ooknet website commit
This commit is contained in:
parent
97be7a19c6
commit
a9280b78cd
55 changed files with 2424 additions and 2 deletions
30
outputs/pkgs/website/src/static/notebook_menu.js
Normal file
30
outputs/pkgs/website/src/static/notebook_menu.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
function initToggleMenu() {
|
||||
const menuToggle = document.querySelector(".menu-toggle");
|
||||
const notebook = document.querySelector(".notebook");
|
||||
|
||||
menuToggle.addEventListener("click", function (e) {
|
||||
e.preventDefault();
|
||||
notebook.classList.toggle("notebook--menu-toggled");
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", initToggleMenu);
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const toggles = document.querySelectorAll('[data-toggle="collapse"]');
|
||||
|
||||
toggles.forEach((toggle) => {
|
||||
toggle.addEventListener("click", function (e) {
|
||||
e.preventDefault();
|
||||
const target = document.querySelector(this.getAttribute("data-target"));
|
||||
if (target) {
|
||||
target.classList.toggle("show");
|
||||
this.classList.toggle("collapsed");
|
||||
this.setAttribute(
|
||||
"aria-expanded",
|
||||
this.classList.contains("collapsed") ? "false" : "true",
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue