Home

Loading your world…0%

// ---- Focus: a dialog takes focus when it opens and gives it back to whatever opened it; a new page moves focus to its heading. {let wasOpen=false,opener=null,lastTab=S.tab;const _rf=render;render=function(){const before=document.activeElement;_rf();try{ const open=modal!=null||gm!=null,m=document.getElementById('modal'); if(open&&!wasOpen){opener=before&&before!==document.body?before:null;if(m&&!m.contains(document.activeElement)){const f=m.querySelector('.btn:not(:disabled),button:not(:disabled),[href],input,select,[tabindex]:not([tabindex="-1"])');f&&f.focus({preventScroll:true})}} if(!open&&wasOpen&&opener&&opener.isConnected&&(document.activeElement===document.body||!document.activeElement)){opener.focus({preventScroll:true})} if(!open)opener=open?opener:(wasOpen?null:opener);wasOpen=open; if(S.tab!==lastTab){lastTab=S.tab;const ae=document.activeElement;if(!ae||ae===document.body||ae.closest('.view[hidden]')||ae.closest('.rail,header.top')){const v=document.querySelector('.view:not([hidden])'),h=v&&v.querySelector('h1,h2');if(h){h.setAttribute('tabindex','-1');h.focus({preventScroll:true})}}document.title=(NAV.find(n=>n[0]===S.tab)||[,'Home'])[1]+' · Sworn To Core'} }catch(e){}}}