仿互站小程序
This commit is contained in:
16
vant/loading/index.js
Normal file
16
vant/loading/index.js
Normal file
@@ -0,0 +1,16 @@
|
||||
(0, require("../common/component").VantComponent)({
|
||||
props: {
|
||||
size: {
|
||||
type: String,
|
||||
value: "30px"
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
value: "circular"
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
value: "#c9c9c9"
|
||||
}
|
||||
}
|
||||
});
|
13
vant/loading/index.json
Normal file
13
vant/loading/index.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"forview": "/utils/forview/index",
|
||||
"van-loading": "/vant/loading/index",
|
||||
"van-dialog": "/vant/dialog/index",
|
||||
"van-button": "/vant/button/index",
|
||||
"van-icon": "/vant/icon/index",
|
||||
"van-popup": "/vant/popup/index",
|
||||
"van-tab": "/vant/tab/index",
|
||||
"van-tabs": "/vant/tabs/index"
|
||||
}
|
||||
}
|
5
vant/loading/index.wxml
Normal file
5
vant/loading/index.wxml
Normal file
@@ -0,0 +1,5 @@
|
||||
<view class="van-loading custom-class" style="width: {{size}}; height: {{size}}">
|
||||
<view class="van-loading__spinner van-loading__spinner--{{type}}" style="color: {{color}};">
|
||||
<view class="van-loading__dot" wx:if="{{type==='spinner'}}" wx:for="item in 12" wx:key="index"></view>
|
||||
</view>
|
||||
</view>
|
128
vant/loading/index.wxss
Normal file
128
vant/loading/index.wxss
Normal file
@@ -0,0 +1,128 @@
|
||||
@import "../area/index.wxss";
|
||||
|
||||
.van-loading {
|
||||
z-index: 0;
|
||||
line-height: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.van-loading,.van-loading__spinner {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.van-loading__spinner {
|
||||
z-index: -1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
animation: van-rotate .8s linear infinite;
|
||||
}
|
||||
|
||||
.van-loading__spinner--spinner {
|
||||
animation-timing-function: steps(12);
|
||||
}
|
||||
|
||||
.van-loading__spinner--circular {
|
||||
border-radius: 100%;
|
||||
border: 1px solid transparent;
|
||||
border-top-color: initial;
|
||||
}
|
||||
|
||||
.van-loading__dot {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.van-loading__dot:before {
|
||||
width: 2px;
|
||||
height: 25%;
|
||||
content: " ";
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
border-radius: 40%;
|
||||
background-color: currentColor;
|
||||
}
|
||||
|
||||
.van-loading__dot:first-of-type {
|
||||
opacity: 1;
|
||||
transform: rotate(30deg);
|
||||
}
|
||||
|
||||
.van-loading__dot:nth-of-type(2) {
|
||||
opacity: .9375;
|
||||
transform: rotate(60deg);
|
||||
}
|
||||
|
||||
.van-loading__dot:nth-of-type(3) {
|
||||
opacity: .875;
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.van-loading__dot:nth-of-type(4) {
|
||||
opacity: .8125;
|
||||
transform: rotate(120deg);
|
||||
}
|
||||
|
||||
.van-loading__dot:nth-of-type(5) {
|
||||
opacity: .75;
|
||||
transform: rotate(150deg);
|
||||
}
|
||||
|
||||
.van-loading__dot:nth-of-type(6) {
|
||||
opacity: .6875;
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.van-loading__dot:nth-of-type(7) {
|
||||
opacity: .625;
|
||||
transform: rotate(210deg);
|
||||
}
|
||||
|
||||
.van-loading__dot:nth-of-type(8) {
|
||||
opacity: .5625;
|
||||
transform: rotate(240deg);
|
||||
}
|
||||
|
||||
.van-loading__dot:nth-of-type(9) {
|
||||
opacity: .5;
|
||||
transform: rotate(270deg);
|
||||
}
|
||||
|
||||
.van-loading__dot:nth-of-type(10) {
|
||||
opacity: .4375;
|
||||
transform: rotate(300deg);
|
||||
}
|
||||
|
||||
.van-loading__dot:nth-of-type(11) {
|
||||
opacity: .375;
|
||||
transform: rotate(330deg);
|
||||
}
|
||||
|
||||
.van-loading__dot:nth-of-type(12) {
|
||||
opacity: .3125;
|
||||
transform: rotate(1turn);
|
||||
}
|
||||
|
||||
@-webkit-keyframes van-rotate {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: rotate(1turn);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes van-rotate {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: rotate(1turn);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user