[HTML/CSS]audio音乐进度条(一)外观

/ 8,871评论 / 42094阅读 / 2点赞

预期效果

由于audio标签自带的控制面板样式可能不合我们的心意,很多时候会想把自定义音乐播放器的样式,其中进度条也是不可少的。


实现

<span id="cmusic_control_span_progressBar">
    <div class="cmusic_displayFlex_class cmusic_control_progress_div">
        <span id="cmusic_control_span_loadProgress" style="width:80%"></span>
        <span id="cmusic_control_span_progress" style="width:50%"></span>
    </div>
</span>
/*外框*/
#cmusic_control_span_progressBar{
    border-radius: 50px;
    height: 20px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    position: relative;
    background: transparent;
    box-shadow: inset 2px 2px 4px #bcc5d6,
        inset -2px -2px 5px #feffff;
    border: 2px solid #d0f4ff;
    justify-content: center;
    transition: all 0.8s ease;
}
/*布局类*/
.cmusic_displayFlex_class {
    width: 100%;
    display: flex;
    margin-left: auto;
    margin-right: auto;
}
.cmusic_control_progress_div {
    position:absolute;
    width:94% !important;
    height:100%;
    align-items: center;
}
/*进度条*/
#cmusic_control_span_progress,
#cmusic_control_span_loadProgress{
    background: linear-gradient(90deg, #c4f4fe, #66ccff);
    border-radius: 50px;
    position: absolute;
    height: 60%;
    pointer-events: none;
    transition: width 0.5s ease;
    box-shadow: 2px 2px 10px #ccd3ff,
    -2px -2px 10px #ccd3ff;
}
/*加载进度条*/
#cmusic_control_span_loadProgress {
    background: linear-gradient(90deg, #abecd6, #fff9d2);
}

目录

本文我们聊了如何搞出进度条的外观,接下来我们将聊聊如何让进度条跟随<audio>的已播放时长改变播放进度

  1. porn说道:

    Hi, I do think your site could be having internet browser compatibility issues. When I take a look at your blog in Safari, it looks fine however when opening in Internet Explorer, it’s got some overlapping issues. I merely wanted to give you a quick heads up! Besides that, great website.

  2. Derekjup说道:

    purchase prednisone no prescription: cheap prednisone – prednisone oral

  3. StevenWearo说道:

    cheap priligy: dapoxetine price – cheap priligy

  4. Brandenven说道:

    prednisone 10mg online: cheap prednisone – 10 mg prednisone

  5. StevenWearo说道:

    where can i buy clomid without a prescription: clomid online – can i get generic clomid

  6. Brandenven说道:

    can i buy clomid for sale: clomid online – get cheap clomid

  7. Great info. Lucky me I discovered your website by chance (stumbleupon). I’ve book-marked it for later!

  8. Derekjup说道:

    can i get clomid prices: clomid online – how can i get cheap clomid without a prescription

  9. porn说道:

    Good info. Lucky me I ran across your blog by accident (stumbleupon). I have saved it for later.

  10. Brandenven说道:

    generic clomid without dr prescription: cheap clomid – can i purchase cheap clomid without rx

  11. StevenWearo说道:

    amoxicillin 500mg prescription: cheap amoxil – amoxicillin 500mg over the counter

  12. Brandenven说道:

    how much is amoxicillin prescription: amoxil – over the counter amoxicillin canada

  13. Jessika Zerger说道:

    I love how detailed your posts are. Very informative!

  14. StevenWearo说道:

    buy priligy max pharm: dapoxetine price – buy priligy

  15. Brandenven说道:

    dapoxetine price: max pharm – priligy

  16. Derekjup说道:

    priligy maxpharm: dapoxetine price – priligy maxpharm

  17. learn more here说道:

    The next time I read a blog, I hope that it won’t disappoint me as much as this one. After all, I know it was my choice to read, but I genuinely believed you would have something interesting to say. All I hear is a bunch of complaining about something that you can fix if you were not too busy searching for attention.

  18. StevenWearo说道:

    prednisone 20mg price: order prednisone with mastercard debit – cost of prednisone 10mg tablets

  19. Brandenven说道:

    priligy: buy dapoxetine online – cheap priligy

  20. Bradleyarrip说道:

    amoxicillin 875 mg tablet amoxicillin 500 mg without prescription 875 mg amoxicillin cost

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注