add: loading changed

This commit is contained in:
JimQing 2020-07-13 21:13:46 +08:00
parent 8233c9aba3
commit ee1c0007d0
2 changed files with 28 additions and 30 deletions

View File

@ -1,5 +1,7 @@
<template> <template>
<loading v-if="loading" /> <transition name="fade" v-if="loading">
<loading />
</transition>
<codemirror-editor v-else /> <codemirror-editor v-else />
</template> </template>
@ -20,11 +22,20 @@ export default {
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {
this.loading = false this.loading = false
}, 200) }, 280);
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.fade-enter,.fade-leave-to{
opacity: 0;
}
.fade-enter-to,.fade-leave{
opacity: 1;
}
.fade-enter-active,.fade-leave-active{
transition: all 2s;
}
</style> </style>

View File

@ -1,8 +1,8 @@
<template> <template>
<div class="loading" id="loading"> <div class="loading" id="loading">
<div class="loading-wrapper"> <div class="loading-wrapper">
<div class="loading-text">Loading...</div>
<div class="loading-anim"></div> <div class="loading-anim"></div>
<div class="loading-text">致力于让MD编辑更简单</div>
</div> </div>
</div> </div>
</template> </template>
@ -10,7 +10,13 @@
<script> <script>
</script> </script>
<style scoped> <style lang="less" scoped>
.loading-wrapper {
position: fixed;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
}
.loading { .loading {
text-align: center; text-align: center;
position: fixed; position: fixed;
@ -25,37 +31,18 @@
background-color: #303133; background-color: #303133;
} }
.loading-wrapper {
position: fixed;
top: 50%;
left: 50%;
-webkit-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
-ms-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
}
.loading-text { .loading-text {
line-height: 1.4; font-size: 18px;
font-size: 1.2rem;
font-weight: bold; font-weight: bold;
margin-bottom: 1rem; margin-top: 26px;
color: #303133;
} }
.loading-anim { .loading-anim {
width: 35px;
height: 35px;
border: 5px solid rgba(189, 189, 189, 0.25);
border-left-color: rgba(66, 185, 131, 0.9);
border-top-color: rgba(66, 185, 131, 0.9);
border-radius: 50%;
display: inline-block; display: inline-block;
animation: rotate 600ms infinite linear; width: 100px;
} height: 100px;
background: url('../assets/images/favicon.png') no-repeat;
@keyframes rotate { background-size: cover;
to {
transform: rotate(1turn)
}
} }
</style> </style>