async function createSplash() { const dark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; const num = Math.floor(Math.random() * 7) + 1; const splash = `
`; document.body.insertAdjacentHTML('beforeend', splash); console.log('createSplash', dark); } async function removeSplash() { // called at the end of setHints const splash = document.getElementById('splash'); if (splash) splash.remove(); console.log('removeSplash'); } window.onload = createSplash;