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

/ 9,274评论 / 43320阅读 / 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. RobertUnsuh说道:

    buy lisinopril in mexico: lisinopril tabs 4mg – lisinopril 10 mg tablet price

  2. JaimeNer说道:

    where to get generic clomid pills buying generic clomid price buy cheap clomid no prescription

  3. JimmieInawl说道:

    https://azithromycinus.com/# zithromax 1000 mg pills

  4. RobertUnsuh说道:

    buy ciprofloxacin: buy generic ciprofloxacin – buy cipro online canada

  5. ArmandoLiaig说道:

    can i get cheap clomid now: where can i buy cheap clomid no prescription – how to get generic clomid price

  6. JimmieInawl说道:

    http://azithromycinus.com/# where to buy zithromax in canada

  7. ArmandoLiaig说道:

    buy cytotec pills online cheap: buy cytotec pills online cheap – buy cytotec pills online cheap

  8. JimmieInawl说道:

    https://ciprofloxacin.cheap/# п»їcipro generic

  9. JaimeNer说道:

    lisinopril 80 mg daily lisinopril online pharmacy lisinopril 20 mg prices

  10. ArmandoLiaig说道:

    zithromax generic cost: cheap zithromax pills – zithromax tablets

  11. RobertUnsuh说道:

    ciprofloxacin 500 mg tablet price: buy cipro without rx – buy cipro online canada

  12. JimmieInawl说道:

    https://azithromycinus.com/# zithromax for sale cheap

  13. JaimeNer说道:

    lisinopril 420 1g rx lisinopril 10mg lisinopril 20 mg price online

  14. ArmandoLiaig说道:

    zithromax online usa: zithromax 500 mg lowest price drugstore online – zithromax for sale 500 mg

  15. ArmandoLiaig说道:

    how to buy cheap clomid no prescription: where can i get generic clomid without insurance – can you buy clomid now

  16. RobertUnsuh说道:

    lisinopril 2.5 mg cost: 100 mg lisinopril – 10 mg lisinopril tablets

  17. JimmieInawl说道:

    https://cytotec.top/# buy cytotec over the counter

  18. JaimeNer说道:

    buy cytotec over the counter buy cytotec in usa order cytotec online

  19. JimmieInawl说道:

    https://clomid.store/# can i buy clomid no prescription

  20. RobertUnsuh说道:

    get generic clomid tablets: where to buy generic clomid without a prescription – can i buy generic clomid pills

  21. JaimeNer说道:

    clomid online cost clomid without insurance where to get generic clomid pill

  22. RobertUnsuh说道:

    Abortion pills online: buy cytotec online – buy cytotec over the counter

发表回复

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