2019-09-07 19:18:37 +08:00

68 lines
1.2 KiB
Plaintext

@import '../common/style/var.less';
.van-loading {
position: relative;
z-index: 0;
display: inline-block;
line-height: 0;
vertical-align: middle;
&__spinner {
position: relative;
z-index: -1;
display: inline-block;
box-sizing: border-box;
width: 100%;
height: 100%;
animation: van-rotate 0.8s linear infinite;
&--spinner {
animation-timing-function: steps(12);
}
&--circular {
border: 1px solid;
border-color: transparent;
border-top-color: currentColor;
border-radius: 100%;
}
}
&__dot {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
&::before {
display: block;
width: 2px;
height: 25%;
margin: 0 auto;
background-color: currentColor;
border-radius: 40%;
content: ' ';
}
}
}
.generate(@n, @i: 1) when (@i =< @n) {
.van-loading__dot:nth-of-type(@{i}) {
transform: rotate(@i * 30deg);
opacity: 1 - (0.75 / 12) * (@i - 1);
}
.generate(@n, (@i + 1));
}
.generate(12);
@keyframes van-rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}