update loading

This commit is contained in:
kuaifan 2022-09-08 21:31:22 +08:00
parent 081aadf468
commit 757606ecc5
11 changed files with 45 additions and 53 deletions

2
public/css/app.css vendored

File diff suppressed because one or more lines are too long

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
1068357027585caf 3815ac139a58e98a

View File

@ -1,8 +1,9 @@
<template> <template>
<ETooltip :disabled="windowSmall || content == ''" :content="content"> <ETooltip :disabled="windowSmall || content == ''" :content="content">
<svg viewBox="25 25 50 50" class="common-loading"> <svg v-if="type === 'svg'" viewBox="25 25 50 50" class="common-loading">
<circle cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10" class="common-path"></circle> <circle cx="50" cy="50" r="20" fill="none" stroke-width="5" stroke-miterlimit="10" class="common-path"></circle>
</svg> </svg>
<div v-else class="common-pureing"></div>
</ETooltip> </ETooltip>
</template> </template>
@ -10,6 +11,10 @@
export default { export default {
name: 'Loading', name: 'Loading',
props: { props: {
type: {
type: String,
default: 'svg'
},
content: { content: {
type: [String, Number], type: [String, Number],
default: '' default: ''

View File

@ -106,9 +106,7 @@
@on-emoji="onEmoji" @on-emoji="onEmoji"
@on-show-emoji-user="onShowEmojiUser"> @on-show-emoji-user="onShowEmojiUser">
<template slot="header"> <template slot="header">
<div v-if="(allMsgs.length === 0 && loadMsg) || prevId > 0" class="dialog-item loading"> <div v-if="(allMsgs.length === 0 && loadMsg) || prevId > 0" class="dialog-item loading"><Loading type="pure"/></div>
<div class="loading-spinner"></div>
</div>
<div v-else-if="allMsgs.length === 0" class="dialog-item nothing">{{$L('暂无消息')}}</div> <div v-else-if="allMsgs.length === 0" class="dialog-item nothing">{{$L('暂无消息')}}</div>
</template> </template>
</VirtualList> </VirtualList>

View File

@ -6,22 +6,35 @@
max-height: 100%; max-height: 100%;
margin: auto; margin: auto;
overflow: hidden; overflow: hidden;
animation: rotate 2s linear infinite; animation: loading-rotate 2s linear infinite;
.common-path { .common-path {
fill: none; fill: none;
stroke-dasharray: 1, 200; stroke-dasharray: 1, 200;
stroke-dashoffset: 0; stroke-dashoffset: 0;
stroke-linecap: round; stroke-linecap: round;
animation: dash 1.5s ease-in-out infinite, color 6s ease-in-out infinite; animation: path-dash 1.5s ease-in-out infinite, path-color 6s ease-in-out infinite;
} }
} }
@keyframes rotate {
.common-pureing {
width: 30px;
height: 30px;
border: 3px solid #eeeeee;
border-bottom-color: $primary-color;
border-radius: 50%;
display: inline-block;
box-sizing: border-box;
animation: pureing-rotation 0.75s linear infinite;
}
@keyframes loading-rotate {
to { to {
transform: rotate(1turn) transform: rotate(1turn)
} }
} }
@keyframes dash {
@keyframes path-dash {
0% { 0% {
stroke-dasharray: 1, 200; stroke-dasharray: 1, 200;
stroke-dashoffset: 0 stroke-dashoffset: 0
@ -37,7 +50,8 @@
stroke-dashoffset: -124 stroke-dashoffset: -124
} }
} }
@keyframes color {
@keyframes path-color {
0%, to { 0%, to {
stroke: #d62d20 stroke: #d62d20
} }
@ -54,3 +68,12 @@
stroke: #ffa700 stroke: #ffa700
} }
} }
@keyframes pureing-rotation {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

View File

@ -920,45 +920,11 @@
box-sizing: content-box; box-sizing: content-box;
justify-content: center; justify-content: center;
.loading-spinner { .common-pureing {
position: relative; margin: 0;
width: 18px; width: 18px;
height: 18px; height: 18px;
text-indent: -9999em; border-width: 2px;
border-radius: 50%;
background: linear-gradient(to right, #ccc 10%, rgba(255, 255, 255, 0) 42%);
animation: spinner-load 1.4s infinite linear;
transform: translateZ(0);
@keyframes spinner-load {
0% {transform: rotate(0deg);}
100% {transform: rotate(360deg);}
}
&:before {
width: 50%;
height: 50%;
background: #ccc;
border-radius: 100% 0 0 0;
position: absolute;
top: 0;
left: 0;
content: '';
}
&:after {
background: #ffffff;
width: 75%;
height: 75%;
border-radius: 50%;
content: '';
margin: auto;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
} }
} }