added 2 new homepage layouts

This commit is contained in:
Nuno Coração
2022-10-11 23:40:31 +01:00
parent 9e3a07237c
commit cb156c0097
50 changed files with 249 additions and 284 deletions

View File

@@ -1,20 +1,31 @@
var layouts = [
"hero",
"profile",
"card",
"page"
]
var currentLayout = 0
function switchHomeLayout() {
const pageDiv = document.getElementById("page");
const profileDiv = document.getElementById("profile");
//document.getElementById(
var old = currentLayout
currentLayout = currentLayout == layouts.length - 1 ? 0 : currentLayout + 1
var oldDiv = document.getElementById(layouts[old])
var currentDiv = document.getElementById(layouts[currentLayout])
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";
});
}
currentDiv.style.display = "block";
oldDiv.style.display = "none";
layoutCode.forEach(function (el) {
el.innerText = layouts[currentLayout];
});
}
window.addEventListener("DOMContentLoaded", (event) => {