mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
updated docs for v1 and polished some minor fixes across the code
This commit is contained in:
27
exampleSite/assets/js/home.js
Normal file
27
exampleSite/assets/js/home.js
Normal file
@@ -0,0 +1,27 @@
|
||||
function switchHomeLayout() {
|
||||
const pageDiv = document.getElementById("page");
|
||||
const profileDiv = document.getElementById("profile");
|
||||
const layoutCode = document.querySelectorAll("code[id=layout]");
|
||||
if (profileDiv.style.display === "none") {
|
||||
profileDiv.style.display = "block";
|
||||
pageDiv.style.display = "none";
|
||||
layoutCode.forEach(function (el) {
|
||||
el.innerText = "profile";
|
||||
});
|
||||
} else {
|
||||
profileDiv.style.display = "none";
|
||||
pageDiv.style.display = "block";
|
||||
layoutCode.forEach(function (el) {
|
||||
el.innerText = "page";
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener("DOMContentLoaded", (event) => {
|
||||
document.querySelectorAll("#switch-layout-button").forEach((button) =>
|
||||
button.addEventListener("click", function (e) {
|
||||
e.preventDefault();
|
||||
switchHomeLayout();
|
||||
})
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user