/** * loading placeholder * Solve the problem that the white background will be displayed first when refreshing the page under the dark theme */ (function () { const _root = document.querySelector('#root'); const theme = localStorage.getItem('navTheme'); // Solve the problem that the white background will be displayed first when refreshing the page under the dark theme try { const html = document.documentElement; if(theme === 'realDark') { html.dataset.theme = 'dark'; }else { html.removeAttribute('data-theme'); } } catch (error) {} if (_root && _root.innerHTML === '') { _root.innerHTML = `
`; } })();