loading text

This commit is contained in:
ManjaroOne666 2019-01-23 12:44:34 +00:00
parent f13a8c38d1
commit c6f998a6ab
1 changed files with 36 additions and 2 deletions

View File

@ -8,9 +8,13 @@
:style="backgroundStyle" :style="backgroundStyle"
></div> ></div>
</transition> </transition>
<div class="image-container"> <div class="image-container loading-container">
<transition name="trans-bg-image"> <transition name="trans-bg-image">
<img v-if="showLoading" class="image" :src="loadingImageUrl"> <span v-if="showLoading"
class="text-loading animation-pulse"
>
Loading
</span>
</transition> </transition>
</div> </div>
<div class="image-container"> <div class="image-container">
@ -99,6 +103,7 @@ export default {
methods: { methods: {
setImages(url) { setImages(url) {
this.displayImageUrl = null this.displayImageUrl = null
this.showLoading = false
this.loadingTimeout = setTimeout(() => { this.loadingTimeout = setTimeout(() => {
this.showLoading = true this.showLoading = true
}, 1000) }, 1000)
@ -146,6 +151,21 @@ export default {
box-shadow: 2px 4px 12px -2px rgba($color__neutral-200, .4); box-shadow: 2px 4px 12px -2px rgba($color__neutral-200, .4);
} }
.loading-container {
display: flex;
align-items: center;
justify-content: center;
}
.text-loading {
font-size: 2rem;
color: $color__neutral-900;
}
.animation-pulse {
animation: pulse 3s infinite;
}
@media (max-width: $bp__layout) { @media (max-width: $bp__layout) {
.close-viewer { .close-viewer {
position: absolute; position: absolute;
@ -227,6 +247,10 @@ export default {
filter: blur(100px); filter: blur(100px);
opacity: .3; opacity: .3;
} }
.loading-container {
padding-bottom: $gallery-thumbs-height;
}
} }
.trans-image { .trans-image {
@ -252,4 +276,14 @@ export default {
opacity: 0; opacity: 0;
} }
} }
@keyframes pulse {
0%, 50%, 100% {
opacity: 1;
}
80% {
opacity: 0.1;
}
}
</style> </style>