纯 css 写一个音乐播放效果

效果图,可上下波动

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;

    }

}

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
禁止转载,如需转载请通过简信或评论联系作者。

推荐阅读更多精彩内容

  • 选择qi:是表达式 标签选择器 类选择器 属性选择器 继承属性: color,font,text-align,li...
    love2013阅读 2,350评论 0 11
  • _________________________________________________________...
    fastwe阅读 492评论 0 0
  • 我喜欢码字,写过小说,偶尔写几首小诗,几百篇下来,写得多,感到满意的,还是散文。写作最辛苦的是小说。要有人物,要编...
    是梅啊阅读 962评论 19 24
  • 词儿干了,失去骑者 但有永不疲倦的马蹄声。
    404Not_found_阅读 233评论 0 0
  • 这几天在准备下周休假的事情,这次定的是和朋友一起去重庆和成都,逛吃一周。 其实,之前一直想过这样一种休假方式:就是...
    喜孜孜孜孜阅读 187评论 0 2