const rootDomain = document.location.host.split('.')[0]; const styleSheet = document.createElement('style'); styleSheet.innerText = `.preloader .logo { background-image: url(/assets/img/${rootDomain}.png); }`; document.head.appendChild(styleSheet); const favicon = document.getElementById('favicon'); favicon.setAttribute('href', `/assets/favicon/${rootDomain}.ico`); fetch(`/assets/themes/${rootDomain}.json`) .then((response) => response.json()) .then((theme) => { document.documentElement.style.setProperty('--theme-accent', theme.accent); document.documentElement.style.setProperty( '--theme-primary', theme.primary ); document.documentElement.style.setProperty( '--theme-toolbar-bg', theme.toolbarBg ); document.documentElement.style.setProperty( '--theme-toolbar-fg', theme.toolbarFg ); document.documentElement.style.setProperty( '--theme-toolbar-1-bg', theme.toolbar1Bg ); document.documentElement.style.setProperty( '--theme-toolbar-1-fg', theme.toolbar1Fg ); document.documentElement.style.setProperty( '--theme-toolbar-2-bg', theme.toolbar2Bg ); document.documentElement.style.setProperty( '--theme-toolbar-2-fb', theme.toolbar2Fg ); });