小程序闪烁效果/ 微信小程序 实现视屏录制REC闪烁效果动画

data: {
animationData: {}
},

created() {
let animation = wx.createAnimation({
duration: 500,
// delay: 1000,
timingFunction: 'ease'
});
this.animation = animation;
let next = true;
timer = setInterval(function () {
if (next) {
this.animation.opacity(0.2).step();
next = !next;
} else {
this.animation.opacity(1).step()
next = !next;
}
this.setData({
animationData: animation.export()
})
}.bind(this), 500)
}

 

<view  animation="{{animationData}}">
       <view class="rec_radius"></view>
       <text class="small">REC</text>
</view>

 

 

posted @ 2024-03-18 11:33  shuihanxiao  阅读(40)  评论(0编辑  收藏  举报