<template>
<view>
<view class="box">
<view class="left_box">
<view class="left_item moving_left"></view>
</view>
<view class="right_box">
<view class="right_item moving_right"></view>
</view>
<view class="mask">3</view>
</view>
</view>
</template>
<style scoped>
.box{
width:160upx;
height:160upx;
margin: 0 auto;
position: relative;
overflow: hidden;
border-radius: 50%;
background-color: #ffac44;
}
.left_box,.right_box{
position: absolute;
top: 0;
width:81upx;
height:160upx;
overflow: hidden;
z-index: 1;
}
.left_box{
left: 0;
}
.right_box{
right: 0;
}
.left_item,.right_item{
width: 81upx;
height: 160upx;
background-color: #ffd298;
}
.left_item{
border-top-left-radius: 80upx;
border-bottom-left-radius: 80upx;
}
.moving_left{
transform-origin: right center;
transform: rotate(180deg);
animation: loading_left 1s linear infinite;
}
.right_item{
border-top-right-radius: 80upx;
border-bottom-right-radius: 80upx;
}
.moving_right{
transform-origin: left center;
transform: rotate(180deg);
animation: loading_right 1s linear infinite;
}
.mask{
position: absolute;
top: 25upx;
left: 25upx;
right: 25upx;
bottom: 25upx;
z-index: 2;
border-radius: 50%;
background-color: #fff;
color: red;
display: flex;
justify-content: center;
align-items: center;
font-size: 40rpx;
font-weight: bold;
}
@keyframes loading_left{
0%{
transform: rotate(0deg);
}
50%{
transform: rotate(0deg);
}
100%{
transform: rotate(180deg);
}
}
@keyframes loading_right{
0%{
transform: rotate(0deg);
}
50%{
transform: rotate(180deg);
}
100%{
transform: rotate(180deg);
}
}
</style>
你好,是H5的链接吗?
ios貌似没有这个问题, 我是安卓 vivo 第一次动画会有一点卡顿