From 54bcb80b447805f673e875ee98fd849879b73a4f Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 5 Mar 2021 13:51:22 +0900 Subject: Splash screen :sparkles: --- src/client/init.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/client') diff --git a/src/client/init.ts b/src/client/init.ts index 596312ff71..1c44e7f23e 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -220,11 +220,23 @@ components(app); await router.isReady(); -//document.body.innerHTML = '
'; +const splash = document.getElementById('splash'); +// 念のためnullチェック(HTMLが古い場合があるため(そのうち消す)) +if (splash) splash.addEventListener('transitionend', () => { + splash.remove(); +}); + +const rootEl = document.createElement('div'); +document.body.appendChild(rootEl); +app.mount(rootEl); -app.mount('body'); reactionPicker.init(); +if (splash) { + splash.style.opacity = '0'; + splash.style.pointerEvents = 'none'; +} + watch(defaultStore.reactiveState.darkMode, (darkMode) => { import('@/scripts/theme').then(({ builtinThemes }) => { const themes = builtinThemes.concat(getThemes()); -- cgit v1.2.3-freya