2019-01-18 13:33:13 +00:00
|
|
|
<template>
|
2019-01-21 10:56:12 +00:00
|
|
|
<div class="background-image-loader">
|
|
|
|
<div class="background-container">
|
|
|
|
<div class="background background-loading"
|
|
|
|
:style="loadingStyle"></div>
|
|
|
|
<div class="background background-img"
|
|
|
|
:style="backgroundStyle"></div>
|
|
|
|
</div>
|
2019-01-18 13:33:13 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import imageLoader from '~/mixins/imageLoader.js'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
mixins: [ imageLoader ],
|
2019-01-21 10:56:12 +00:00
|
|
|
|
2019-01-18 13:33:13 +00:00
|
|
|
props: {
|
2019-01-21 10:56:12 +00:00
|
|
|
bgLoading: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: function () {
|
|
|
|
return 'linear-gradient(310deg, #35405d, #6174aa, #a8b3d0, #e2e5ef)'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
img: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: function () {
|
|
|
|
return 'url(https://via.placeholder.com/1920x1080)'
|
|
|
|
}
|
|
|
|
},
|
2019-01-18 13:33:13 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2019-01-21 10:56:12 +00:00
|
|
|
computed: {
|
|
|
|
loadingStyle () {
|
|
|
|
return {
|
|
|
|
background: this.bgLoading
|
|
|
|
}
|
|
|
|
},
|
|
|
|
backgroundStyle () {
|
|
|
|
return {
|
|
|
|
backgroundImage: this.img
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2019-01-18 13:33:13 +00:00
|
|
|
methods: {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
2019-01-21 10:56:12 +00:00
|
|
|
.background-image-loader {
|
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.background {
|
2019-01-18 13:33:13 +00:00
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
top: 0;
|
2019-01-21 10:56:12 +00:00
|
|
|
left: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.background-img {
|
|
|
|
background-size: cover;
|
|
|
|
background-position: center center;
|
|
|
|
opacity: .5;
|
2019-01-18 13:33:13 +00:00
|
|
|
}
|
|
|
|
</style>
|