congo/exampleSite/layouts/partials/home/custom.html

28 lines
808 B
HTML
Raw Normal View History

<div id="page">
{{ partial "partials/home/page.html" . }}
</div>
<div id="profile" class="hidden h-full">
{{ partial "partials/home/profile.html" . }}
</div>
2021-08-15 08:41:40 +00:00
<script type="text/javascript">
2021-08-16 07:19:10 +00:00
function switchLayout() {
const pageDiv = document.getElementById("page");
const profileDiv = document.getElementById("profile");
const layoutCode = document.querySelectorAll("code[id=layout]");
2021-08-15 08:41:40 +00:00
if (pageDiv.style.display === "none") {
pageDiv.style.display = "block";
profileDiv.style.display = "none";
layoutCode.forEach(function (el) {
el.innerText = "page";
});
2021-08-15 08:41:40 +00:00
} else {
pageDiv.style.display = "none";
profileDiv.style.display = "block";
layoutCode.forEach(function (el) {
el.innerText = "profile";
});
2021-08-15 08:41:40 +00:00
}
}
</script>