美文网首页
纯 css 写一个音乐播放效果

纯 css 写一个音乐播放效果

作者: 顽皮的大猩猩 | 来源:发表于2019-12-01 17:57 被阅读0次
效果图,可上下波动

wxml 代码

<view class="music-playing">

    <text class="first-step"></text>

    <text class="two-step"></text>

    <text class="third-step"></text>

    <text class="four-step"></text>

</view>

wxss  代码

.music-playing {

    width: 52rpx;

    height: 40rpx;

    display: flex;

    flex-direction: row;

    justify-content: space-between;

    align-items: flex-end;

    position:absolute;

    left:50%;

    top:50%;

    transform: translate(-50%,-50%);

    z-index: 20;

}

.music-playing text {

    width: 10rpx;

    border-radius: 5rpx;

    background-color: #f90f59;

}

.first-step {

    animation: music-play 0.8s linear infinite ;

    animation-delay:1s;

}

.two-step {

    animation: music-play 0.8s linear infinite;

    animation-delay:1.2s;

}

.third-step {

    animation: music-play 0.8s linear infinite;

    animation-delay:1.3s;

}

.four-step {

    animation: music-play 0.8s linear infinite;

    animation-delay:1.4s;

}

@keyframes music-play {

    0% {

        height: 10rpx;

    }

    50% {

        height: 40rpx;

    }

    100% {

        height: 10rpx;

    }

}

相关文章

网友评论

      本文标题:纯 css 写一个音乐播放效果

      本文链接:https://www.haomeiwen.com/subject/ewttgctx.html