1
0
Fork 1
mirror of https://example.com synced 2024-11-24 07:16:38 +09:00

Splash screen

This commit is contained in:
syuilo 2021-03-05 13:51:22 +09:00
parent f871cf1053
commit 54bcb80b44
4 changed files with 26 additions and 22 deletions

View file

@ -56,7 +56,9 @@ gulp.task('build:client:script', () => {
gulp.task('build:client:style', () => {
return gulp.src(['./src/server/web/style.css', './src/server/web/bios.css', './src/server/web/cli.css'])
.pipe(cssnano())
.pipe(cssnano({
zindex: false
}))
.pipe(gulp.dest('./built/server/web/'));
});

View file

@ -220,11 +220,23 @@ components(app);
await router.isReady();
//document.body.innerHTML = '<div id="app"></div>';
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());

View file

@ -3,17 +3,20 @@ html {
color: var(--fg);
}
#ini {
#splash {
position: fixed;
z-index: 1;
z-index: 10000;
top: 0;
left: 0;
width: 100%;
height: 100%;
cursor: wait;
background-color: var(--bg);
opacity: 1;
transition: opacity 0.5s ease;
}
#ini > svg {
#splash > img {
position: absolute;
top: 0;
right: 0;
@ -22,16 +25,5 @@ html {
margin: auto;
width: 64px;
height: 64px;
animation: ini 0.6s infinite linear;
color: var(--accent);
fill: currentColor;
}
@keyframes ini {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
pointer-events: none;
}

View file

@ -44,8 +44,6 @@ html
| JavaScriptを有効にしてください
br
| Please turn on your JavaScript
div#ini.
<svg viewBox="0 0 50 50">
<path d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" />
</svg>
div#splash
img(src='/favicon.ico')
block content