Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
SOD/public/javascripts/layout.js

39 lines
1.1 KiB
JavaScript
Raw Normal View History

const more = document.getElementById("more");
const dark = document.getElementById("dark");
const about = document.getElementById("about");
const contact = document.getElementById("contact");
more.firstChild.addEventListener("click", () => {
dark.classList.remove("hide");
about.classList.remove("hide");
});
more.lastChild.addEventListener("click", () => {
dark.classList.remove("hide");
contact.classList.remove("hide")
});
dark.addEventListener("click", () => {
dark.classList.add("hide");
if (! about.classList.contains("hide"))
about.classList.add("hide");
else
contact.classList.add("hide");
});
2020-09-27 17:52:35 +02:00
document.addEventListener("DOMContentLoaded", function() {
M.Sidenav.init(document.querySelectorAll(".sidenav"));
});
function cb(token) {
document.querySelectorAll("div.recaptcha.recaptcha-cb").forEach(el => {
el.classList.remove("recaptcha-cb");
let input = document.createElement("input");
input.setAttribute("type", "hidden");
input.setAttribute("name", "g-recaptcha-response");
input.setAttribute("value", token);
el.appendChild(input);
});
}