Added loading screen

This commit is contained in:
Fabio Manganiello 2021-04-24 22:35:33 +02:00
parent b45168074c
commit 2817cc5f18
3 changed files with 132 additions and 5 deletions

View File

@ -128,6 +128,7 @@ html, body {
font-size: 1.05em;
}
/* Splash screen */
.splash {
width: 100vw;
height: 100vh;
@ -140,3 +141,124 @@ html, body {
font-size: 1.2em;
z-index: 1000;
}
.splash .icon {
width: 150px;
height: 150px;
display: flex;
margin-bottom: .5em;
}
.splash .icon img {
width: 100%;
height: 100%;
}
/* Fade in/out animations */
.fade-in {
animation-duration: 0.5s;
-webkit-animation-duration: 0.5s;
animation-fill-mode: both;
animation-name: fadeIn;
-webkit-animation-name: fadeIn;
}
.fade-out {
animation-duration: 0.5s;
-webkit-animation-duration: 0.5s;
animation-fill-mode: both;
animation-name: fadeOut;
-webkit-animation-name: fadeOut;
}
@keyframes fadeIn {
0% {opacity: 0;}
100% {opacity: 1;}
}
@keyframes fadeOut {
0% {opacity: 1;}
100% {
opacity: 0;
display: none;
}
}
/* Loading animation */
.loading {
display: flex;
align-items: center;
justify-content: center;
font-size: 3em;
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: #909090;
opacity: 0.5;
}
.icon {
display: inline-block;
position: relative;
width: 80px;
height: 80px;
}
.icon div {
position: absolute;
top: 33px;
width: 13px;
height: 13px;
border-radius: 50%;
background: #fff;
animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
.icon div:nth-child(1) {
left: 8px;
animation: lds-ellipsis1 0.6s infinite;
}
.icon div:nth-child(2) {
left: 8px;
animation: lds-ellipsis2 0.6s infinite;
}
.icon div:nth-child(3) {
left: 32px;
animation: lds-ellipsis2 0.6s infinite;
}
.icon div:nth-child(4) {
left: 56px;
animation: lds-ellipsis3 0.6s infinite;
}
@keyframes lds-ellipsis1 {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
@keyframes lds-ellipsis3 {
0% {
transform: scale(1);
}
100% {
transform: scale(0);
}
}
@keyframes lds-ellipsis2 {
0% {
transform: translate(0, 0);
}
100% {
transform: translate(24px, 0);
}
}

View File

@ -11,17 +11,22 @@
<div id="app">
<div class="splash" v-if="splash">
<div class="icon">
<img src="img/icon.png">
<img src="img/icon.png" alt="">
</div>
<div class="app-name">
Platypush
</div>
</div>
<div class="loading" v-if="loading">
<div class="icon">
<div v-for="n in 4" :key="n"></div>
</div>
</div>
<div class="services">
<div class="no-items" v-if="loading || !Object.keys(services).length">
<div class="loading" v-if="loading">Loading...</div>
<div class="empty" v-else>No Platypush web services found on the network</div>
<div class="no-items" v-if="!Object.keys(services).length">
<div class="empty">No Platypush web services found on the network</div>
</div>
<div class="service" v-for="(service, i) in services" :key="i" @click="onClick(service)">

View File

@ -43,7 +43,7 @@ new Vue({
},
mounted: function() {
this.splashScreen(3000)
this.splashScreen(2500)
app.startServicesPoll()
window.setInterval(this.refresh, 500)
}