congo/js/home.min.096b4f9179ef7ad3af...

1 line
554 B
JavaScript

function switchHomeLayout(){const e=document.getElementById("page"),t=document.getElementById("profile"),n=document.querySelectorAll("code[id=layout]");e.style.display==="none"?(e.style.display="block",t.style.display="none",n.forEach(function(e){e.innerText="page"})):(e.style.display="none",t.style.display="block",n.forEach(function(e){e.innerText="profile"}))}window.addEventListener("DOMContentLoaded",e=>{document.querySelectorAll("#switch-layout-button").forEach(e=>e.addEventListener("click",function(e){e.preventDefault(),switchHomeLayout()}))})