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

/ 3,066评论 / 11734阅读 / 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. WilliamRen说道:

    https://finasteride.store/# buy propecia now

  2. RandallGuesE说道:

    lisinopril prescription: cost of lisinopril 10 mg – lisinopril 12.5 20 g

  3. RandallGuesE说道:

    cheap propecia for sale: propecia without prescription – cheap propecia prices

  4. WilliamRen说道:

    http://nolvadex.life/# tamoxifen for men

  5. RonaldSwobe说道:

    https://nolvadex.life/# tamoxifen medication

  6. Davidfrify说道:

    cytotec buy online usa buy cytotec online Abortion pills online

  7. Davidfrify说道:

    Abortion pills online cytotec buy online usa cytotec online

  8. Davidfrify说道:

    cipro for sale ciprofloxacin 500mg buy online buy cipro cheap

  9. RandallGuesE说道:

    tamoxifen breast cancer prevention: tamoxifen adverse effects – tamoxifen depression

  10. RandallGuesE说道:

    cost of propecia price: cost propecia price – buy generic propecia without insurance

  11. Davidfrify说道:

    buy cytotec online fast delivery п»їcytotec pills online buy cytotec pills online cheap

  12. WilliamRen说道:

    https://lisinopril.network/# cost of lisinopril 2.5 mg

  13. Davidfrify说道:

    lisinopril prinivil zestril lisinopril online pharmacy lisinopril generic drug

  14. RandallGuesE说道:

    buy cheap propecia without a prescription: buying propecia tablets – order cheap propecia without a prescription

回复 Assumpmok 取消回复

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