KawAnime/components/loader.vue

44 lines
885 B
Vue
Raw Normal View History

2017-04-15 14:16:14 +00:00
<template>
<transition name="fade">
<div class="loading-gif">
<h3 class="loading-text">少々お待ち下さいね</h3>
<img v-if="number === 1" src="~static/images/loading-gif1.gif" height="500"/>
<img v-else-if="number === 2" src="~static/images/loading-gif2.gif" height="500"/>
</div>
</transition>
2017-04-15 14:16:14 +00:00
</template>
<style scoped>
2017-05-13 14:38:17 +00:00
.loading-text
{
width: 100%;
padding: 0;
margin: 0 0 15px -20%;
color: rgba(255, 255, 255, 0.8);
font-family: "Hiragino Mincho Pro", serif;
}
2017-04-15 14:16:14 +00:00
2017-05-13 14:38:17 +00:00
.loading-gif
{
position: absolute;
bottom: 0;
left: 37%;
}
2017-04-15 14:16:14 +00:00
</style>
<script>
export default{
data: function () {
return {
number: this.ran()
}
},
methods: {
2017-05-13 14:38:17 +00:00
ran () {
return parseInt(Math.random() * 2 + 1)
}
},
2017-05-13 14:38:17 +00:00
mounted () {
this.number = this.ran()
}
}
2017-04-15 14:16:14 +00:00
</script>