blowfish/public/js/home.min.d4eae8fb7c04ad6084190050b568f6af5f3c453e6e688101a3d854ff64e8c2a5b5f85f44c0b48ea71100f48da4564f61a62afaab4d071a5ea38344a7e9d63c2a.js

1 line
1.4 KiB
JavaScript
Raw Normal View History

var layouts=["background","hero","profile","page","card"],list_config,titles,currentConfig,currentLayout=0;function switchHomeLayout(){var e,t,n=currentLayout;currentLayout=currentLayout==layouts.length-1?0:currentLayout+1,e=document.getElementById(layouts[n]),t=document.getElementById(layouts[currentLayout]);const s=document.querySelectorAll("code[id=layout]");t.style.display="block",e.style.display="none",s.forEach(function(e){e.innerText=layouts[currentLayout]})}window.addEventListener("DOMContentLoaded",e=>{document.querySelectorAll("#switch-layout-button").forEach(e=>e.addEventListener("click",function(e){e.preventDefault(),switchHomeLayout()}))}),list_config=["CardViewProse","CardViewScreenWidth","NormalView"],titles={CardViewProse:"card view with constrained width",CardViewScreenWidth:"card view with full width",NormalView:"standard list view"},currentConfig=0;function switchList(){var e,t,n=currentConfig;currentConfig=currentConfig==list_config.length-1?0:currentConfig+1,e=document.getElementById(list_config[n]),t=document.getElementById(list_config[currentConfig]);const s=document.querySelectorAll("code[id=config]");t.style.display="block",e.style.display="none",s.forEach(function(e){e.innerText=titles[list_config[currentConfig]]})}window.addEventListener("DOMContentLoaded",e=>{document.querySelectorAll("#switch-config-button").forEach(e=>e.addEventListener("click",function(e){e.preventDefault(),switchList()}))})