<div class="el-loading-spinner">
<svg viewBox="25 25 50 50" class="circular">
<circle cx="50" cy="50" r="20" fill="none" class="path"></circle>
</svg>
<p class="el-loading-text">Loading…</p>
</div>
</div>
/* ******************* 加载动画 **************************** */
.el-loading-mask.is-fullscreen { position: fixed}
.el-loading-mask { background-color: hsla(0,0%,100%,.4)!important}
.el-loading-mask { position: absolutez-index: 10000background-color: hsla(0,0%,100%,.9)margin: 0top: 0right: 0bottom: 0left: 0transition: opacity .3s}
.el-loading-mask.is-fullscreen .el-loading-spinner { margin-top: -25px}
.el-loading-spinner { top: 50%margin-top: -21pxwidth: 100%text-align: centerposition: absolute}
.el-loading-mask.is-fullscreen .el-loading-spinner .circular { width: 50pxheight: 50px}
.el-loading-spinner .circular { width: 42pxheight: 42pxanimation: loading-rotate 2s linear infinite}
svg:not(:root) { overflow: hidden}
.el-loading-spinner .el-loading-text { color: #ff495e !important}
.el-loading-spinner .el-loading-text { color: #20a0ffmargin: 3px 0font-size: 14px}
.el-loading-spinner .path { stroke: #ff495e !important}
.el-loading-spinner .path {
animation: loading-dash 1.5s ease-in-out infinite
stroke-dasharray: 90,150
stroke-dashoffset: 0
stroke-width: 2
stroke: #20a0ff
stroke-linecap: round
}
@keyframes loading-rotate {
to {
transform:rotate(1turn)
}
}@keyframes loading-dash {
0% {
stroke-dasharray:1,200
stroke-dashoffset:0
}
50% {
stroke-dasharray:90,150
stroke-dashoffset:-40px
}
to {
stroke-dasharray:90,150
stroke-dashoffset:-120px
}
/* ********************** 加载动画end ***************************************************** */
创建动画序列,需要使用animation属性或其子属性,该属性允许配置动画时间、时长以及其他动画细节,但该属性不能配置动画的实际表现,动画的实际表现是由 @keyframes规则实现,具体情况参见使用keyframes定义动画序列小节部分。transition也可实现动画。transition强调过渡,是元素的一个或多个属性发生变化时产生的过渡效果,同一个元素通过两个不同的途径获取样式,而第二个途径当某种改变发生(如hover)时才能获取样式,这样就会产生过渡动画。