Skip to content

Commit

Permalink
refactor: improve loading mask in CodemirrorEditor.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
YangFong committed Aug 15, 2024
1 parent 570ca35 commit 998b145
Showing 1 changed file with 21 additions and 25 deletions.
46 changes: 21 additions & 25 deletions src/views/CodemirrorEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,10 @@ onMounted(() => {
<div class="preview">
<section id="output" v-html="output" />
<div v-if="isCoping" class="loading-mask">
<div class="loading__img" />
<span>正在生成</span>
<div class="loading-mask-box">
<div class="loading__img" />
<span>正在生成</span>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -564,32 +566,26 @@ onMounted(() => {
.loading-mask {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 376px;
height: 101%;
padding-top: 1px;
font-size: 15px;
left: 0;
top: 0;
width: 100%;
height: 100%;
text-align: center;
color: var(--el-text-color-regular);
background-color: var(--el-bg-color);
.loading__img {
position: absolute;
left: 50%;
top: 330px;
width: 50px;
height: 50px;
transform: translate(-50%, -50%);
background: url('../assets/images/favicon.png') no-repeat;
background-size: cover;
}
span {
position: absolute;
left: 50%;
top: 390px;
transform: translate(-50%, -50%);
.loading-mask-box {
position: sticky;
top: 50%;
transform: translateY(-50%);
.loading__img {
width: 75px;
height: 75px;
background: url('../assets/images/favicon.png') no-repeat;
margin: 1em auto;
background-size: cover;
}
}
}
Expand Down

0 comments on commit 998b145

Please sign in to comment.